diff --git a/samples/client/3_0_3_unit_test/java/README.md b/samples/client/3_0_3_unit_test/java/README.md index 3e52e49173e..f099f0a5a49 100644 --- a/samples/client/3_0_3_unit_test/java/README.md +++ b/samples/client/3_0_3_unit_test/java/README.md @@ -65,8 +65,8 @@ Here is the mapping from json schema types to Java types: | Json Schema Type | Java Base Class | | ---------------- | --------------- | -| object | FrozenMap (HashMap) | -| array | FrozenList (ArrayList) | +| object | FrozenMap (Map) | +| array | FrozenList (List) | | string | String | | number | Number (int, long, float, double) | | integer | int, long, float, double (with values equal to integers) | @@ -102,7 +102,7 @@ invalid Java variable names. Names like: - " " - "from" -To allow these use cases to work, FrozenMap (which extends HashMap) is used as the base class of type object schemas. +To allow these use cases to work, FrozenMap (which extends AbstractMap) is used as the base class of type object schemas. This means that one can use normal Map methods on instances of these classes.
@@ -118,8 +118,6 @@ This means that one can use normal Map methods on instances of these classes. N schemas can be validated on the same payload. To allow multiple schemas to validate, the data must be stored using one base class whether or not a json schema format constraint exists in the schema. -See the below accessors for string data: -- type string + format: See schemas.as_date, schemas.as_datetime, schemas.as_decimal, schemas.as_uuid In json schema, type: number with no format validates both integers and floats, so int and float values are stored for type number. @@ -137,7 +135,7 @@ For example the string payload '2023-12-20' is validates to both of these schema - type: string format: date ``` -Because of use cases like this, a datetime.date is allowed as an input to this schema, but the data +Because of use cases like this, a LocalDate is allowed as an input to this schema, but the data is stored as a string.
@@ -153,8 +151,16 @@ allowed input and output types. | ------------ | ----- | ----------- | | 0 | [Server0](docs/servers/Server0.md) | | -## Component Schemas +## Endpoints +All URIs are relative to the selected server +- The server is selected by passing in serverInfo + serverIndexInfo into configurations.ApiConfiguration +- The security info is selected by passing in securityInfo + securityIndexInfo into configurations.ApiConfiguration +- serverIndex + securityIndex can also be passed in to endpoint calls, see endpoint documentation + +| HTTP request | Methods | Description | +| ------------ | ------- | ----------- | +## Component Schemas | Class | Description | | ----- | ----------- | | [AdditionalpropertiesAllowsASchemaWhichShouldValidate.AdditionalpropertiesAllowsASchemaWhichShouldValidate1](docs/components/schemas/AdditionalpropertiesAllowsASchemaWhichShouldValidate.md#additionalpropertiesallowsaschemawhichshouldvalidate1) | | @@ -244,14 +250,3 @@ allowed input and output types. | [UriFormat.UriFormat1](docs/components/schemas/UriFormat.md#uriformat1) | | | [UriReferenceFormat.UriReferenceFormat1](docs/components/schemas/UriReferenceFormat.md#urireferenceformat1) | | | [UriTemplateFormat.UriTemplateFormat1](docs/components/schemas/UriTemplateFormat.md#uritemplateformat1) | | - -## Endpoints - -All URIs are relative to the selected server -- The server is selected by passing in serverInfo into configurations.ApiConfiguration -- The security info is selected by passing in securityInfo into configurations.ApiConfiguration -- TODO Code samples in endpoints documents show how to do this -- serverIndex + securityIndex can also be passed in to endpoint calls, see endpoint documentation - -| HTTP request | Method | Description | -| ------------ | ------ | ----------- | diff --git a/samples/client/3_1_0_unit_test/java/README.md b/samples/client/3_1_0_unit_test/java/README.md index 6b76c520aaf..13c34a587c5 100644 --- a/samples/client/3_1_0_unit_test/java/README.md +++ b/samples/client/3_1_0_unit_test/java/README.md @@ -65,8 +65,8 @@ Here is the mapping from json schema types to Java types: | Json Schema Type | Java Base Class | | ---------------- | --------------- | -| object | FrozenMap (HashMap) | -| array | FrozenList (ArrayList) | +| object | FrozenMap (Map) | +| array | FrozenList (List) | | string | String | | number | Number (int, long, float, double) | | integer | int, long, float, double (with values equal to integers) | @@ -102,7 +102,7 @@ invalid Java variable names. Names like: - " " - "from" -To allow these use cases to work, FrozenMap (which extends HashMap) is used as the base class of type object schemas. +To allow these use cases to work, FrozenMap (which extends AbstractMap) is used as the base class of type object schemas. This means that one can use normal Map methods on instances of these classes.
@@ -118,8 +118,6 @@ This means that one can use normal Map methods on instances of these classes. N schemas can be validated on the same payload. To allow multiple schemas to validate, the data must be stored using one base class whether or not a json schema format constraint exists in the schema. -See the below accessors for string data: -- type string + format: See schemas.as_date, schemas.as_datetime, schemas.as_decimal, schemas.as_uuid In json schema, type: number with no format validates both integers and floats, so int and float values are stored for type number. @@ -137,7 +135,7 @@ For example the string payload '2023-12-20' is validates to both of these schema - type: string format: date ``` -Because of use cases like this, a datetime.date is allowed as an input to this schema, but the data +Because of use cases like this, a LocalDate is allowed as an input to this schema, but the data is stored as a string.
@@ -153,8 +151,16 @@ allowed input and output types. | ------------ | ----- | ----------- | | 0 | [Server0](docs/servers/Server0.md) | | -## Component Schemas +## Endpoints +All URIs are relative to the selected server +- The server is selected by passing in serverInfo + serverIndexInfo into configurations.ApiConfiguration +- The security info is selected by passing in securityInfo + securityIndexInfo into configurations.ApiConfiguration +- serverIndex + securityIndex can also be passed in to endpoint calls, see endpoint documentation + +| HTTP request | Methods | Description | +| ------------ | ------- | ----------- | +## Component Schemas | Class | Description | | ----- | ----------- | | [ASchemaGivenForPrefixitems.ASchemaGivenForPrefixitems1](docs/components/schemas/ASchemaGivenForPrefixitems.md#aschemagivenforprefixitems1) | | @@ -300,14 +306,3 @@ allowed input and output types. | [UriTemplateFormat.UriTemplateFormat1](docs/components/schemas/UriTemplateFormat.md#uritemplateformat1) | | | [UuidFormat.UuidFormat1](docs/components/schemas/UuidFormat.md#uuidformat1) | | | [ValidateAgainstCorrectBranchThenVsElse.ValidateAgainstCorrectBranchThenVsElse1](docs/components/schemas/ValidateAgainstCorrectBranchThenVsElse.md#validateagainstcorrectbranchthenvselse1) | | - -## Endpoints - -All URIs are relative to the selected server -- The server is selected by passing in serverInfo into configurations.ApiConfiguration -- The security info is selected by passing in securityInfo into configurations.ApiConfiguration -- TODO Code samples in endpoints documents show how to do this -- serverIndex + securityIndex can also be passed in to endpoint calls, see endpoint documentation - -| HTTP request | Method | Description | -| ------------ | ------ | ----------- | diff --git a/samples/client/petstore/java/.openapi-generator/FILES b/samples/client/petstore/java/.openapi-generator/FILES index e1a0e83ecda..8db8d9ea067 100644 --- a/samples/client/petstore/java/.openapi-generator/FILES +++ b/samples/client/petstore/java/.openapi-generator/FILES @@ -1,5 +1,68 @@ README.md docs/RootServerInfo.md +docs/apis/paths/Anotherfakedummy.md +docs/apis/paths/Commonparamsubdir.md +docs/apis/paths/Fake.md +docs/apis/paths/Fakeadditionalpropertieswitharrayofenums.md +docs/apis/paths/Fakebodywithfileschema.md +docs/apis/paths/Fakebodywithqueryparams.md +docs/apis/paths/Fakecasesensitiveparams.md +docs/apis/paths/Fakeclassnametest.md +docs/apis/paths/Fakedeletecoffeeid.md +docs/apis/paths/Fakehealth.md +docs/apis/paths/Fakeinlineadditionalproperties.md +docs/apis/paths/Fakeinlinecomposition.md +docs/apis/paths/Fakejsonformdata.md +docs/apis/paths/Fakejsonpatch.md +docs/apis/paths/Fakejsonwithcharset.md +docs/apis/paths/Fakemultiplerequestbodycontenttypes.md +docs/apis/paths/Fakemultipleresponsebodies.md +docs/apis/paths/Fakemultiplesecurities.md +docs/apis/paths/Fakeobjinquery.md +docs/apis/paths/Fakeparametercollisions1ababselfab.md +docs/apis/paths/Fakepemcontenttype.md +docs/apis/paths/Fakepetiduploadimagewithrequiredfile.md +docs/apis/paths/Fakequeryparamwithjsoncontenttype.md +docs/apis/paths/Fakeredirection.md +docs/apis/paths/Fakerefobjinquery.md +docs/apis/paths/Fakerefsarraymodel.md +docs/apis/paths/Fakerefsarrayofenums.md +docs/apis/paths/Fakerefsboolean.md +docs/apis/paths/Fakerefscomposedoneofnumberwithvalidations.md +docs/apis/paths/Fakerefsenum.md +docs/apis/paths/Fakerefsmammal.md +docs/apis/paths/Fakerefsnumber.md +docs/apis/paths/Fakerefsobjectmodelwithrefprops.md +docs/apis/paths/Fakerefsstring.md +docs/apis/paths/Fakeresponsewithoutschema.md +docs/apis/paths/Faketestqueryparamters.md +docs/apis/paths/Fakeuploaddownloadfile.md +docs/apis/paths/Fakeuploadfile.md +docs/apis/paths/Fakeuploadfiles.md +docs/apis/paths/Fakewildcardresponses.md +docs/apis/paths/Foo.md +docs/apis/paths/Pet.md +docs/apis/paths/Petfindbystatus.md +docs/apis/paths/Petfindbytags.md +docs/apis/paths/Petpetid.md +docs/apis/paths/Petpetiduploadimage.md +docs/apis/paths/Solidus.md +docs/apis/paths/Storeinventory.md +docs/apis/paths/Storeorder.md +docs/apis/paths/Storeorderorderid.md +docs/apis/paths/User.md +docs/apis/paths/Usercreatewitharray.md +docs/apis/paths/Usercreatewithlist.md +docs/apis/paths/Userlogin.md +docs/apis/paths/Userlogout.md +docs/apis/paths/Userusername.md +docs/apis/tags/Anotherfake.md +docs/apis/tags/Default.md +docs/apis/tags/Fake.md +docs/apis/tags/Fakeclassnametags123.md +docs/apis/tags/Pet.md +docs/apis/tags/Store.md +docs/apis/tags/User.md docs/components/headers/Int32JsonContentTypeHeader.md docs/components/headers/NumberHeader.md docs/components/headers/RefContentSchemaHeader.md @@ -190,51 +253,51 @@ docs/components/securityschemes/HttpBasicTest.md docs/components/securityschemes/HttpSignatureTest.md docs/components/securityschemes/OpenIdConnectTest.md docs/components/securityschemes/PetstoreAuth.md -docs/paths/anotherfakedummy/Patch.md -docs/paths/anotherfakedummy/patch/RequestBody.md -docs/paths/anotherfakedummy/patch/Responses.md -docs/paths/anotherfakedummy/patch/responses/Code200Response.md +docs/paths/anotherfakedummy/AnotherfakedummyPatch.md +docs/paths/anotherfakedummy/patch/AnotherfakedummyPatchRequestBody.md +docs/paths/anotherfakedummy/patch/AnotherfakedummyPatchResponses.md +docs/paths/anotherfakedummy/patch/responses/AnotherfakedummyPatchCode200Response.md docs/paths/anotherfakedummy/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.md -docs/paths/commonparamsubdir/Delete.md -docs/paths/commonparamsubdir/Get.md -docs/paths/commonparamsubdir/Post.md -docs/paths/commonparamsubdir/delete/HeaderParameters.md -docs/paths/commonparamsubdir/delete/PathParameters.md -docs/paths/commonparamsubdir/delete/Responses.md +docs/paths/commonparamsubdir/CommonparamsubdirDelete.md +docs/paths/commonparamsubdir/CommonparamsubdirGet.md +docs/paths/commonparamsubdir/CommonparamsubdirPost.md +docs/paths/commonparamsubdir/delete/CommonparamsubdirDeleteHeaderParameters.md +docs/paths/commonparamsubdir/delete/CommonparamsubdirDeletePathParameters.md +docs/paths/commonparamsubdir/delete/CommonparamsubdirDeleteResponses.md docs/paths/commonparamsubdir/delete/parameters/parameter0/Schema0.md docs/paths/commonparamsubdir/delete/parameters/parameter1/Schema1.md -docs/paths/commonparamsubdir/delete/responses/Code200Response.md -docs/paths/commonparamsubdir/get/PathParameters.md -docs/paths/commonparamsubdir/get/QueryParameters.md -docs/paths/commonparamsubdir/get/Responses.md +docs/paths/commonparamsubdir/delete/responses/CommonparamsubdirDeleteCode200Response.md +docs/paths/commonparamsubdir/get/CommonparamsubdirGetPathParameters.md +docs/paths/commonparamsubdir/get/CommonparamsubdirGetQueryParameters.md +docs/paths/commonparamsubdir/get/CommonparamsubdirGetResponses.md docs/paths/commonparamsubdir/get/parameters/parameter0/Schema0.md -docs/paths/commonparamsubdir/get/responses/Code200Response.md +docs/paths/commonparamsubdir/get/responses/CommonparamsubdirGetCode200Response.md docs/paths/commonparamsubdir/parameters/routeparameter0/RouteParamSchema0.md -docs/paths/commonparamsubdir/post/HeaderParameters.md -docs/paths/commonparamsubdir/post/PathParameters.md -docs/paths/commonparamsubdir/post/Responses.md +docs/paths/commonparamsubdir/post/CommonparamsubdirPostHeaderParameters.md +docs/paths/commonparamsubdir/post/CommonparamsubdirPostPathParameters.md +docs/paths/commonparamsubdir/post/CommonparamsubdirPostResponses.md docs/paths/commonparamsubdir/post/parameters/parameter0/Schema0.md -docs/paths/commonparamsubdir/post/responses/Code200Response.md -docs/paths/fake/Delete.md -docs/paths/fake/Get.md -docs/paths/fake/Patch.md -docs/paths/fake/Post.md +docs/paths/commonparamsubdir/post/responses/CommonparamsubdirPostCode200Response.md +docs/paths/fake/FakeDelete.md +docs/paths/fake/FakeGet.md +docs/paths/fake/FakePatch.md +docs/paths/fake/FakePost.md +docs/paths/fake/delete/FakeDeleteHeaderParameters.md +docs/paths/fake/delete/FakeDeleteQueryParameters.md +docs/paths/fake/delete/FakeDeleteResponses.md docs/paths/fake/delete/FakeDeleteSecurityInfo.md -docs/paths/fake/delete/HeaderParameters.md -docs/paths/fake/delete/QueryParameters.md -docs/paths/fake/delete/Responses.md docs/paths/fake/delete/parameters/parameter0/Schema0.md docs/paths/fake/delete/parameters/parameter1/Schema1.md docs/paths/fake/delete/parameters/parameter2/Schema2.md docs/paths/fake/delete/parameters/parameter3/Schema3.md docs/paths/fake/delete/parameters/parameter4/Schema4.md docs/paths/fake/delete/parameters/parameter5/Schema5.md -docs/paths/fake/delete/responses/Code200Response.md +docs/paths/fake/delete/responses/FakeDeleteCode200Response.md docs/paths/fake/delete/security/FakeDeleteSecurityRequirementObject0.md -docs/paths/fake/get/HeaderParameters.md -docs/paths/fake/get/QueryParameters.md -docs/paths/fake/get/RequestBody.md -docs/paths/fake/get/Responses.md +docs/paths/fake/get/FakeGetHeaderParameters.md +docs/paths/fake/get/FakeGetQueryParameters.md +docs/paths/fake/get/FakeGetRequestBody.md +docs/paths/fake/get/FakeGetResponses.md docs/paths/fake/get/parameters/parameter0/Schema0.md docs/paths/fake/get/parameters/parameter1/Schema1.md docs/paths/fake/get/parameters/parameter2/Schema2.md @@ -242,127 +305,127 @@ docs/paths/fake/get/parameters/parameter3/Schema3.md docs/paths/fake/get/parameters/parameter4/Schema4.md docs/paths/fake/get/parameters/parameter5/Schema5.md docs/paths/fake/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md -docs/paths/fake/get/responses/Code200Response.md -docs/paths/fake/get/responses/Code404Response.md +docs/paths/fake/get/responses/FakeGetCode200Response.md +docs/paths/fake/get/responses/FakeGetCode404Response.md docs/paths/fake/get/responses/code404response/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fake/patch/RequestBody.md -docs/paths/fake/patch/Responses.md -docs/paths/fake/patch/responses/Code200Response.md +docs/paths/fake/patch/FakePatchRequestBody.md +docs/paths/fake/patch/FakePatchResponses.md +docs/paths/fake/patch/responses/FakePatchCode200Response.md docs/paths/fake/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.md +docs/paths/fake/post/FakePostRequestBody.md +docs/paths/fake/post/FakePostResponses.md docs/paths/fake/post/FakePostSecurityInfo.md -docs/paths/fake/post/RequestBody.md -docs/paths/fake/post/Responses.md docs/paths/fake/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md -docs/paths/fake/post/responses/Code200Response.md -docs/paths/fake/post/responses/Code404Response.md +docs/paths/fake/post/responses/FakePostCode200Response.md +docs/paths/fake/post/responses/FakePostCode404Response.md docs/paths/fake/post/security/FakePostSecurityRequirementObject0.md -docs/paths/fakeadditionalpropertieswitharrayofenums/Get.md -docs/paths/fakeadditionalpropertieswitharrayofenums/get/RequestBody.md -docs/paths/fakeadditionalpropertieswitharrayofenums/get/Responses.md +docs/paths/fakeadditionalpropertieswitharrayofenums/FakeadditionalpropertieswitharrayofenumsGet.md +docs/paths/fakeadditionalpropertieswitharrayofenums/get/FakeadditionalpropertieswitharrayofenumsGetRequestBody.md +docs/paths/fakeadditionalpropertieswitharrayofenums/get/FakeadditionalpropertieswitharrayofenumsGetResponses.md docs/paths/fakeadditionalpropertieswitharrayofenums/get/requestbody/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakeadditionalpropertieswitharrayofenums/get/responses/Code200Response.md +docs/paths/fakeadditionalpropertieswitharrayofenums/get/responses/FakeadditionalpropertieswitharrayofenumsGetCode200Response.md docs/paths/fakeadditionalpropertieswitharrayofenums/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakebodywithfileschema/Put.md -docs/paths/fakebodywithfileschema/put/RequestBody.md -docs/paths/fakebodywithfileschema/put/Responses.md +docs/paths/fakebodywithfileschema/FakebodywithfileschemaPut.md +docs/paths/fakebodywithfileschema/put/FakebodywithfileschemaPutRequestBody.md +docs/paths/fakebodywithfileschema/put/FakebodywithfileschemaPutResponses.md docs/paths/fakebodywithfileschema/put/requestbody/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakebodywithfileschema/put/responses/Code200Response.md -docs/paths/fakebodywithqueryparams/Put.md -docs/paths/fakebodywithqueryparams/put/QueryParameters.md -docs/paths/fakebodywithqueryparams/put/RequestBody.md -docs/paths/fakebodywithqueryparams/put/Responses.md +docs/paths/fakebodywithfileschema/put/responses/FakebodywithfileschemaPutCode200Response.md +docs/paths/fakebodywithqueryparams/FakebodywithqueryparamsPut.md +docs/paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutQueryParameters.md +docs/paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutRequestBody.md +docs/paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutResponses.md docs/paths/fakebodywithqueryparams/put/parameters/parameter0/Schema0.md docs/paths/fakebodywithqueryparams/put/requestbody/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakebodywithqueryparams/put/responses/Code200Response.md -docs/paths/fakecasesensitiveparams/Put.md -docs/paths/fakecasesensitiveparams/put/QueryParameters.md -docs/paths/fakecasesensitiveparams/put/Responses.md +docs/paths/fakebodywithqueryparams/put/responses/FakebodywithqueryparamsPutCode200Response.md +docs/paths/fakecasesensitiveparams/FakecasesensitiveparamsPut.md +docs/paths/fakecasesensitiveparams/put/FakecasesensitiveparamsPutQueryParameters.md +docs/paths/fakecasesensitiveparams/put/FakecasesensitiveparamsPutResponses.md docs/paths/fakecasesensitiveparams/put/parameters/parameter0/Schema0.md docs/paths/fakecasesensitiveparams/put/parameters/parameter1/Schema1.md docs/paths/fakecasesensitiveparams/put/parameters/parameter2/Schema2.md -docs/paths/fakecasesensitiveparams/put/responses/Code200Response.md -docs/paths/fakeclassnametest/Patch.md +docs/paths/fakecasesensitiveparams/put/responses/FakecasesensitiveparamsPutCode200Response.md +docs/paths/fakeclassnametest/FakeclassnametestPatch.md +docs/paths/fakeclassnametest/patch/FakeclassnametestPatchRequestBody.md +docs/paths/fakeclassnametest/patch/FakeclassnametestPatchResponses.md docs/paths/fakeclassnametest/patch/FakeclassnametestPatchSecurityInfo.md -docs/paths/fakeclassnametest/patch/RequestBody.md -docs/paths/fakeclassnametest/patch/Responses.md -docs/paths/fakeclassnametest/patch/responses/Code200Response.md +docs/paths/fakeclassnametest/patch/responses/FakeclassnametestPatchCode200Response.md docs/paths/fakeclassnametest/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakeclassnametest/patch/security/FakeclassnametestPatchSecurityRequirementObject0.md -docs/paths/fakedeletecoffeeid/Delete.md -docs/paths/fakedeletecoffeeid/delete/PathParameters.md -docs/paths/fakedeletecoffeeid/delete/Responses.md +docs/paths/fakedeletecoffeeid/FakedeletecoffeeidDelete.md +docs/paths/fakedeletecoffeeid/delete/FakedeletecoffeeidDeletePathParameters.md +docs/paths/fakedeletecoffeeid/delete/FakedeletecoffeeidDeleteResponses.md docs/paths/fakedeletecoffeeid/delete/parameters/parameter0/Schema0.md -docs/paths/fakedeletecoffeeid/delete/responses/Code200Response.md -docs/paths/fakedeletecoffeeid/delete/responses/CodedefaultResponse.md -docs/paths/fakehealth/Get.md -docs/paths/fakehealth/get/Responses.md -docs/paths/fakehealth/get/responses/Code200Response.md +docs/paths/fakedeletecoffeeid/delete/responses/FakedeletecoffeeidDeleteCode200Response.md +docs/paths/fakedeletecoffeeid/delete/responses/FakedeletecoffeeidDeleteCodedefaultResponse.md +docs/paths/fakehealth/FakehealthGet.md +docs/paths/fakehealth/get/FakehealthGetResponses.md +docs/paths/fakehealth/get/responses/FakehealthGetCode200Response.md docs/paths/fakehealth/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakeinlineadditionalproperties/Post.md -docs/paths/fakeinlineadditionalproperties/post/RequestBody.md -docs/paths/fakeinlineadditionalproperties/post/Responses.md +docs/paths/fakeinlineadditionalproperties/FakeinlineadditionalpropertiesPost.md +docs/paths/fakeinlineadditionalproperties/post/FakeinlineadditionalpropertiesPostRequestBody.md +docs/paths/fakeinlineadditionalproperties/post/FakeinlineadditionalpropertiesPostResponses.md docs/paths/fakeinlineadditionalproperties/post/requestbody/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakeinlineadditionalproperties/post/responses/Code200Response.md -docs/paths/fakeinlinecomposition/Post.md -docs/paths/fakeinlinecomposition/post/QueryParameters.md -docs/paths/fakeinlinecomposition/post/RequestBody.md -docs/paths/fakeinlinecomposition/post/Responses.md +docs/paths/fakeinlineadditionalproperties/post/responses/FakeinlineadditionalpropertiesPostCode200Response.md +docs/paths/fakeinlinecomposition/FakeinlinecompositionPost.md +docs/paths/fakeinlinecomposition/post/FakeinlinecompositionPostQueryParameters.md +docs/paths/fakeinlinecomposition/post/FakeinlinecompositionPostRequestBody.md +docs/paths/fakeinlinecomposition/post/FakeinlinecompositionPostResponses.md docs/paths/fakeinlinecomposition/post/parameters/parameter0/Schema0.md docs/paths/fakeinlinecomposition/post/parameters/parameter1/Schema1.md docs/paths/fakeinlinecomposition/post/requestbody/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakeinlinecomposition/post/requestbody/content/multipartformdata/MultipartformdataSchema.md -docs/paths/fakeinlinecomposition/post/responses/Code200Response.md +docs/paths/fakeinlinecomposition/post/responses/FakeinlinecompositionPostCode200Response.md docs/paths/fakeinlinecomposition/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakeinlinecomposition/post/responses/code200response/content/multipartformdata/MultipartformdataSchema.md -docs/paths/fakejsonformdata/Get.md -docs/paths/fakejsonformdata/get/RequestBody.md -docs/paths/fakejsonformdata/get/Responses.md +docs/paths/fakejsonformdata/FakejsonformdataGet.md +docs/paths/fakejsonformdata/get/FakejsonformdataGetRequestBody.md +docs/paths/fakejsonformdata/get/FakejsonformdataGetResponses.md docs/paths/fakejsonformdata/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md -docs/paths/fakejsonformdata/get/responses/Code200Response.md -docs/paths/fakejsonpatch/Patch.md -docs/paths/fakejsonpatch/patch/RequestBody.md -docs/paths/fakejsonpatch/patch/Responses.md +docs/paths/fakejsonformdata/get/responses/FakejsonformdataGetCode200Response.md +docs/paths/fakejsonpatch/FakejsonpatchPatch.md +docs/paths/fakejsonpatch/patch/FakejsonpatchPatchRequestBody.md +docs/paths/fakejsonpatch/patch/FakejsonpatchPatchResponses.md docs/paths/fakejsonpatch/patch/requestbody/content/applicationjsonpatchjson/ApplicationjsonpatchjsonSchema.md -docs/paths/fakejsonpatch/patch/responses/Code200Response.md -docs/paths/fakejsonwithcharset/Post.md -docs/paths/fakejsonwithcharset/post/RequestBody.md -docs/paths/fakejsonwithcharset/post/Responses.md +docs/paths/fakejsonpatch/patch/responses/FakejsonpatchPatchCode200Response.md +docs/paths/fakejsonwithcharset/FakejsonwithcharsetPost.md +docs/paths/fakejsonwithcharset/post/FakejsonwithcharsetPostRequestBody.md +docs/paths/fakejsonwithcharset/post/FakejsonwithcharsetPostResponses.md docs/paths/fakejsonwithcharset/post/requestbody/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.md -docs/paths/fakejsonwithcharset/post/responses/Code200Response.md +docs/paths/fakejsonwithcharset/post/responses/FakejsonwithcharsetPostCode200Response.md docs/paths/fakejsonwithcharset/post/responses/code200response/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.md -docs/paths/fakemultiplerequestbodycontenttypes/Post.md -docs/paths/fakemultiplerequestbodycontenttypes/post/RequestBody.md -docs/paths/fakemultiplerequestbodycontenttypes/post/Responses.md +docs/paths/fakemultiplerequestbodycontenttypes/FakemultiplerequestbodycontenttypesPost.md +docs/paths/fakemultiplerequestbodycontenttypes/post/FakemultiplerequestbodycontenttypesPostRequestBody.md +docs/paths/fakemultiplerequestbodycontenttypes/post/FakemultiplerequestbodycontenttypesPostResponses.md docs/paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/multipartformdata/MultipartformdataSchema.md -docs/paths/fakemultiplerequestbodycontenttypes/post/responses/Code200Response.md +docs/paths/fakemultiplerequestbodycontenttypes/post/responses/FakemultiplerequestbodycontenttypesPostCode200Response.md docs/paths/fakemultiplerequestbodycontenttypes/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakemultipleresponsebodies/Get.md -docs/paths/fakemultipleresponsebodies/get/Responses.md -docs/paths/fakemultipleresponsebodies/get/responses/Code200Response.md -docs/paths/fakemultipleresponsebodies/get/responses/Code202Response.md +docs/paths/fakemultipleresponsebodies/FakemultipleresponsebodiesGet.md +docs/paths/fakemultipleresponsebodies/get/FakemultipleresponsebodiesGetResponses.md +docs/paths/fakemultipleresponsebodies/get/responses/FakemultipleresponsebodiesGetCode200Response.md +docs/paths/fakemultipleresponsebodies/get/responses/FakemultipleresponsebodiesGetCode202Response.md docs/paths/fakemultipleresponsebodies/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakemultipleresponsebodies/get/responses/code202response/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakemultiplesecurities/Get.md +docs/paths/fakemultiplesecurities/FakemultiplesecuritiesGet.md +docs/paths/fakemultiplesecurities/get/FakemultiplesecuritiesGetResponses.md docs/paths/fakemultiplesecurities/get/FakemultiplesecuritiesGetSecurityInfo.md -docs/paths/fakemultiplesecurities/get/Responses.md -docs/paths/fakemultiplesecurities/get/responses/Code200Response.md +docs/paths/fakemultiplesecurities/get/responses/FakemultiplesecuritiesGetCode200Response.md docs/paths/fakemultiplesecurities/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakemultiplesecurities/get/security/FakemultiplesecuritiesGetSecurityRequirementObject0.md docs/paths/fakemultiplesecurities/get/security/FakemultiplesecuritiesGetSecurityRequirementObject1.md docs/paths/fakemultiplesecurities/get/security/FakemultiplesecuritiesGetSecurityRequirementObject2.md -docs/paths/fakeobjinquery/Get.md -docs/paths/fakeobjinquery/get/QueryParameters.md -docs/paths/fakeobjinquery/get/Responses.md +docs/paths/fakeobjinquery/FakeobjinqueryGet.md +docs/paths/fakeobjinquery/get/FakeobjinqueryGetQueryParameters.md +docs/paths/fakeobjinquery/get/FakeobjinqueryGetResponses.md docs/paths/fakeobjinquery/get/parameters/parameter0/Schema0.md -docs/paths/fakeobjinquery/get/responses/Code200Response.md -docs/paths/fakeparametercollisions1ababselfab/Post.md -docs/paths/fakeparametercollisions1ababselfab/post/CookieParameters.md -docs/paths/fakeparametercollisions1ababselfab/post/HeaderParameters.md -docs/paths/fakeparametercollisions1ababselfab/post/PathParameters.md -docs/paths/fakeparametercollisions1ababselfab/post/QueryParameters.md -docs/paths/fakeparametercollisions1ababselfab/post/RequestBody.md -docs/paths/fakeparametercollisions1ababselfab/post/Responses.md +docs/paths/fakeobjinquery/get/responses/FakeobjinqueryGetCode200Response.md +docs/paths/fakeparametercollisions1ababselfab/Fakeparametercollisions1ababselfabPost.md +docs/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostCookieParameters.md +docs/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostHeaderParameters.md +docs/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostPathParameters.md +docs/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostQueryParameters.md +docs/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostRequestBody.md +docs/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostResponses.md docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter0/Schema0.md docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter1/Schema1.md docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter10/Schema10.md @@ -383,306 +446,306 @@ docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter7/Schema7 docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter8/Schema8.md docs/paths/fakeparametercollisions1ababselfab/post/parameters/parameter9/Schema9.md docs/paths/fakeparametercollisions1ababselfab/post/requestbody/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakeparametercollisions1ababselfab/post/responses/Code200Response.md +docs/paths/fakeparametercollisions1ababselfab/post/responses/Fakeparametercollisions1ababselfabPostCode200Response.md docs/paths/fakeparametercollisions1ababselfab/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakepemcontenttype/Get.md -docs/paths/fakepemcontenttype/get/RequestBody.md -docs/paths/fakepemcontenttype/get/Responses.md +docs/paths/fakepemcontenttype/FakepemcontenttypeGet.md +docs/paths/fakepemcontenttype/get/FakepemcontenttypeGetRequestBody.md +docs/paths/fakepemcontenttype/get/FakepemcontenttypeGetResponses.md docs/paths/fakepemcontenttype/get/requestbody/content/applicationxpemfile/ApplicationxpemfileSchema.md -docs/paths/fakepemcontenttype/get/responses/Code200Response.md +docs/paths/fakepemcontenttype/get/responses/FakepemcontenttypeGetCode200Response.md docs/paths/fakepemcontenttype/get/responses/code200response/content/applicationxpemfile/ApplicationxpemfileSchema.md -docs/paths/fakepetiduploadimagewithrequiredfile/Post.md +docs/paths/fakepetiduploadimagewithrequiredfile/FakepetiduploadimagewithrequiredfilePost.md +docs/paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostPathParameters.md +docs/paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostRequestBody.md +docs/paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostResponses.md docs/paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostSecurityInfo.md -docs/paths/fakepetiduploadimagewithrequiredfile/post/PathParameters.md -docs/paths/fakepetiduploadimagewithrequiredfile/post/RequestBody.md -docs/paths/fakepetiduploadimagewithrequiredfile/post/Responses.md docs/paths/fakepetiduploadimagewithrequiredfile/post/parameters/parameter0/Schema0.md docs/paths/fakepetiduploadimagewithrequiredfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.md -docs/paths/fakepetiduploadimagewithrequiredfile/post/responses/Code200Response.md +docs/paths/fakepetiduploadimagewithrequiredfile/post/responses/FakepetiduploadimagewithrequiredfilePostCode200Response.md docs/paths/fakepetiduploadimagewithrequiredfile/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakepetiduploadimagewithrequiredfile/post/security/FakepetiduploadimagewithrequiredfilePostSecurityRequirementObject0.md -docs/paths/fakequeryparamwithjsoncontenttype/Get.md -docs/paths/fakequeryparamwithjsoncontenttype/get/QueryParameters.md -docs/paths/fakequeryparamwithjsoncontenttype/get/Responses.md +docs/paths/fakequeryparamwithjsoncontenttype/FakequeryparamwithjsoncontenttypeGet.md +docs/paths/fakequeryparamwithjsoncontenttype/get/FakequeryparamwithjsoncontenttypeGetQueryParameters.md +docs/paths/fakequeryparamwithjsoncontenttype/get/FakequeryparamwithjsoncontenttypeGetResponses.md docs/paths/fakequeryparamwithjsoncontenttype/get/parameters/parameter0/content/applicationjson/Schema0.md -docs/paths/fakequeryparamwithjsoncontenttype/get/responses/Code200Response.md +docs/paths/fakequeryparamwithjsoncontenttype/get/responses/FakequeryparamwithjsoncontenttypeGetCode200Response.md docs/paths/fakequeryparamwithjsoncontenttype/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakeredirection/Get.md -docs/paths/fakeredirection/get/Responses.md -docs/paths/fakeredirection/get/responses/Code303Response.md -docs/paths/fakeredirection/get/responses/Code3XXResponse.md -docs/paths/fakerefobjinquery/Get.md -docs/paths/fakerefobjinquery/get/QueryParameters.md -docs/paths/fakerefobjinquery/get/Responses.md +docs/paths/fakeredirection/FakeredirectionGet.md +docs/paths/fakeredirection/get/FakeredirectionGetResponses.md +docs/paths/fakeredirection/get/responses/FakeredirectionGetCode303Response.md +docs/paths/fakeredirection/get/responses/FakeredirectionGetCode3XXResponse.md +docs/paths/fakerefobjinquery/FakerefobjinqueryGet.md +docs/paths/fakerefobjinquery/get/FakerefobjinqueryGetQueryParameters.md +docs/paths/fakerefobjinquery/get/FakerefobjinqueryGetResponses.md docs/paths/fakerefobjinquery/get/parameters/parameter0/Schema0.md -docs/paths/fakerefobjinquery/get/responses/Code200Response.md -docs/paths/fakerefsarraymodel/Post.md -docs/paths/fakerefsarraymodel/post/RequestBody.md -docs/paths/fakerefsarraymodel/post/Responses.md +docs/paths/fakerefobjinquery/get/responses/FakerefobjinqueryGetCode200Response.md +docs/paths/fakerefsarraymodel/FakerefsarraymodelPost.md +docs/paths/fakerefsarraymodel/post/FakerefsarraymodelPostRequestBody.md +docs/paths/fakerefsarraymodel/post/FakerefsarraymodelPostResponses.md docs/paths/fakerefsarraymodel/post/requestbody/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakerefsarraymodel/post/responses/Code200Response.md +docs/paths/fakerefsarraymodel/post/responses/FakerefsarraymodelPostCode200Response.md docs/paths/fakerefsarraymodel/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakerefsarrayofenums/Post.md -docs/paths/fakerefsarrayofenums/post/RequestBody.md -docs/paths/fakerefsarrayofenums/post/Responses.md +docs/paths/fakerefsarrayofenums/FakerefsarrayofenumsPost.md +docs/paths/fakerefsarrayofenums/post/FakerefsarrayofenumsPostRequestBody.md +docs/paths/fakerefsarrayofenums/post/FakerefsarrayofenumsPostResponses.md docs/paths/fakerefsarrayofenums/post/requestbody/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakerefsarrayofenums/post/responses/Code200Response.md +docs/paths/fakerefsarrayofenums/post/responses/FakerefsarrayofenumsPostCode200Response.md docs/paths/fakerefsarrayofenums/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakerefsboolean/Post.md -docs/paths/fakerefsboolean/post/RequestBody.md -docs/paths/fakerefsboolean/post/Responses.md +docs/paths/fakerefsboolean/FakerefsbooleanPost.md +docs/paths/fakerefsboolean/post/FakerefsbooleanPostRequestBody.md +docs/paths/fakerefsboolean/post/FakerefsbooleanPostResponses.md docs/paths/fakerefsboolean/post/requestbody/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakerefsboolean/post/responses/Code200Response.md +docs/paths/fakerefsboolean/post/responses/FakerefsbooleanPostCode200Response.md docs/paths/fakerefsboolean/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakerefscomposedoneofnumberwithvalidations/Post.md -docs/paths/fakerefscomposedoneofnumberwithvalidations/post/RequestBody.md -docs/paths/fakerefscomposedoneofnumberwithvalidations/post/Responses.md +docs/paths/fakerefscomposedoneofnumberwithvalidations/FakerefscomposedoneofnumberwithvalidationsPost.md +docs/paths/fakerefscomposedoneofnumberwithvalidations/post/FakerefscomposedoneofnumberwithvalidationsPostRequestBody.md +docs/paths/fakerefscomposedoneofnumberwithvalidations/post/FakerefscomposedoneofnumberwithvalidationsPostResponses.md docs/paths/fakerefscomposedoneofnumberwithvalidations/post/requestbody/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/Code200Response.md +docs/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/FakerefscomposedoneofnumberwithvalidationsPostCode200Response.md docs/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakerefsenum/Post.md -docs/paths/fakerefsenum/post/RequestBody.md -docs/paths/fakerefsenum/post/Responses.md +docs/paths/fakerefsenum/FakerefsenumPost.md +docs/paths/fakerefsenum/post/FakerefsenumPostRequestBody.md +docs/paths/fakerefsenum/post/FakerefsenumPostResponses.md docs/paths/fakerefsenum/post/requestbody/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakerefsenum/post/responses/Code200Response.md +docs/paths/fakerefsenum/post/responses/FakerefsenumPostCode200Response.md docs/paths/fakerefsenum/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakerefsmammal/Post.md -docs/paths/fakerefsmammal/post/RequestBody.md -docs/paths/fakerefsmammal/post/Responses.md +docs/paths/fakerefsmammal/FakerefsmammalPost.md +docs/paths/fakerefsmammal/post/FakerefsmammalPostRequestBody.md +docs/paths/fakerefsmammal/post/FakerefsmammalPostResponses.md docs/paths/fakerefsmammal/post/requestbody/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakerefsmammal/post/responses/Code200Response.md +docs/paths/fakerefsmammal/post/responses/FakerefsmammalPostCode200Response.md docs/paths/fakerefsmammal/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakerefsnumber/Post.md -docs/paths/fakerefsnumber/post/RequestBody.md -docs/paths/fakerefsnumber/post/Responses.md +docs/paths/fakerefsnumber/FakerefsnumberPost.md +docs/paths/fakerefsnumber/post/FakerefsnumberPostRequestBody.md +docs/paths/fakerefsnumber/post/FakerefsnumberPostResponses.md docs/paths/fakerefsnumber/post/requestbody/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakerefsnumber/post/responses/Code200Response.md +docs/paths/fakerefsnumber/post/responses/FakerefsnumberPostCode200Response.md docs/paths/fakerefsnumber/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakerefsobjectmodelwithrefprops/Post.md -docs/paths/fakerefsobjectmodelwithrefprops/post/RequestBody.md -docs/paths/fakerefsobjectmodelwithrefprops/post/Responses.md +docs/paths/fakerefsobjectmodelwithrefprops/FakerefsobjectmodelwithrefpropsPost.md +docs/paths/fakerefsobjectmodelwithrefprops/post/FakerefsobjectmodelwithrefpropsPostRequestBody.md +docs/paths/fakerefsobjectmodelwithrefprops/post/FakerefsobjectmodelwithrefpropsPostResponses.md docs/paths/fakerefsobjectmodelwithrefprops/post/requestbody/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakerefsobjectmodelwithrefprops/post/responses/Code200Response.md +docs/paths/fakerefsobjectmodelwithrefprops/post/responses/FakerefsobjectmodelwithrefpropsPostCode200Response.md docs/paths/fakerefsobjectmodelwithrefprops/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakerefsstring/Post.md -docs/paths/fakerefsstring/post/RequestBody.md -docs/paths/fakerefsstring/post/Responses.md +docs/paths/fakerefsstring/FakerefsstringPost.md +docs/paths/fakerefsstring/post/FakerefsstringPostRequestBody.md +docs/paths/fakerefsstring/post/FakerefsstringPostResponses.md docs/paths/fakerefsstring/post/requestbody/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakerefsstring/post/responses/Code200Response.md +docs/paths/fakerefsstring/post/responses/FakerefsstringPostCode200Response.md docs/paths/fakerefsstring/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakeresponsewithoutschema/Get.md -docs/paths/fakeresponsewithoutschema/get/Responses.md -docs/paths/fakeresponsewithoutschema/get/responses/Code200Response.md -docs/paths/faketestqueryparamters/Put.md -docs/paths/faketestqueryparamters/put/QueryParameters.md -docs/paths/faketestqueryparamters/put/Responses.md +docs/paths/fakeresponsewithoutschema/FakeresponsewithoutschemaGet.md +docs/paths/fakeresponsewithoutschema/get/FakeresponsewithoutschemaGetResponses.md +docs/paths/fakeresponsewithoutschema/get/responses/FakeresponsewithoutschemaGetCode200Response.md +docs/paths/faketestqueryparamters/FaketestqueryparamtersPut.md +docs/paths/faketestqueryparamters/put/FaketestqueryparamtersPutQueryParameters.md +docs/paths/faketestqueryparamters/put/FaketestqueryparamtersPutResponses.md docs/paths/faketestqueryparamters/put/parameters/parameter0/Schema0.md docs/paths/faketestqueryparamters/put/parameters/parameter1/Schema1.md docs/paths/faketestqueryparamters/put/parameters/parameter2/Schema2.md docs/paths/faketestqueryparamters/put/parameters/parameter3/Schema3.md docs/paths/faketestqueryparamters/put/parameters/parameter4/Schema4.md docs/paths/faketestqueryparamters/put/parameters/parameter5/Schema5.md -docs/paths/faketestqueryparamters/put/responses/Code200Response.md -docs/paths/fakeuploaddownloadfile/Post.md -docs/paths/fakeuploaddownloadfile/post/RequestBody.md -docs/paths/fakeuploaddownloadfile/post/Responses.md +docs/paths/faketestqueryparamters/put/responses/FaketestqueryparamtersPutCode200Response.md +docs/paths/fakeuploaddownloadfile/FakeuploaddownloadfilePost.md +docs/paths/fakeuploaddownloadfile/post/FakeuploaddownloadfilePostRequestBody.md +docs/paths/fakeuploaddownloadfile/post/FakeuploaddownloadfilePostResponses.md docs/paths/fakeuploaddownloadfile/post/requestbody/content/applicationoctetstream/ApplicationoctetstreamSchema.md -docs/paths/fakeuploaddownloadfile/post/responses/Code200Response.md +docs/paths/fakeuploaddownloadfile/post/responses/FakeuploaddownloadfilePostCode200Response.md docs/paths/fakeuploaddownloadfile/post/responses/code200response/content/applicationoctetstream/ApplicationoctetstreamSchema.md -docs/paths/fakeuploadfile/Post.md -docs/paths/fakeuploadfile/post/RequestBody.md -docs/paths/fakeuploadfile/post/Responses.md +docs/paths/fakeuploadfile/FakeuploadfilePost.md +docs/paths/fakeuploadfile/post/FakeuploadfilePostRequestBody.md +docs/paths/fakeuploadfile/post/FakeuploadfilePostResponses.md docs/paths/fakeuploadfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.md -docs/paths/fakeuploadfile/post/responses/Code200Response.md +docs/paths/fakeuploadfile/post/responses/FakeuploadfilePostCode200Response.md docs/paths/fakeuploadfile/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakeuploadfiles/Post.md -docs/paths/fakeuploadfiles/post/RequestBody.md -docs/paths/fakeuploadfiles/post/Responses.md +docs/paths/fakeuploadfiles/FakeuploadfilesPost.md +docs/paths/fakeuploadfiles/post/FakeuploadfilesPostRequestBody.md +docs/paths/fakeuploadfiles/post/FakeuploadfilesPostResponses.md docs/paths/fakeuploadfiles/post/requestbody/content/multipartformdata/MultipartformdataSchema.md -docs/paths/fakeuploadfiles/post/responses/Code200Response.md +docs/paths/fakeuploadfiles/post/responses/FakeuploadfilesPostCode200Response.md docs/paths/fakeuploadfiles/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md -docs/paths/fakewildcardresponses/Get.md -docs/paths/fakewildcardresponses/get/Responses.md -docs/paths/fakewildcardresponses/get/responses/Code1XXResponse.md -docs/paths/fakewildcardresponses/get/responses/Code200Response.md -docs/paths/fakewildcardresponses/get/responses/Code2XXResponse.md -docs/paths/fakewildcardresponses/get/responses/Code3XXResponse.md -docs/paths/fakewildcardresponses/get/responses/Code4XXResponse.md -docs/paths/fakewildcardresponses/get/responses/Code5XXResponse.md +docs/paths/fakewildcardresponses/FakewildcardresponsesGet.md +docs/paths/fakewildcardresponses/get/FakewildcardresponsesGetResponses.md +docs/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode1XXResponse.md +docs/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode200Response.md +docs/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode2XXResponse.md +docs/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode3XXResponse.md +docs/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode4XXResponse.md +docs/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode5XXResponse.md docs/paths/fakewildcardresponses/get/responses/code1xxresponse/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakewildcardresponses/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakewildcardresponses/get/responses/code2xxresponse/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakewildcardresponses/get/responses/code3xxresponse/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakewildcardresponses/get/responses/code4xxresponse/content/applicationjson/ApplicationjsonSchema.md docs/paths/fakewildcardresponses/get/responses/code5xxresponse/content/applicationjson/ApplicationjsonSchema.md -docs/paths/foo/Get.md +docs/paths/foo/FooGet.md +docs/paths/foo/get/FooGetResponses.md docs/paths/foo/get/FooGetServerInfo.md -docs/paths/foo/get/Responses.md -docs/paths/foo/get/responses/CodedefaultResponse.md +docs/paths/foo/get/responses/FooGetCodedefaultResponse.md docs/paths/foo/get/responses/codedefaultresponse/content/applicationjson/ApplicationjsonSchema.md docs/paths/foo/get/servers/FooGetServer0.md docs/paths/foo/get/servers/FooGetServer1.md docs/paths/foo/get/servers/server1/Variables.md -docs/paths/pet/Post.md -docs/paths/pet/Put.md +docs/paths/pet/PetPost.md +docs/paths/pet/PetPut.md +docs/paths/pet/post/PetPostRequestBody.md +docs/paths/pet/post/PetPostResponses.md docs/paths/pet/post/PetPostSecurityInfo.md -docs/paths/pet/post/RequestBody.md -docs/paths/pet/post/Responses.md -docs/paths/pet/post/responses/Code200Response.md -docs/paths/pet/post/responses/Code405Response.md +docs/paths/pet/post/responses/PetPostCode200Response.md +docs/paths/pet/post/responses/PetPostCode405Response.md docs/paths/pet/post/security/PetPostSecurityRequirementObject0.md docs/paths/pet/post/security/PetPostSecurityRequirementObject1.md docs/paths/pet/post/security/PetPostSecurityRequirementObject2.md +docs/paths/pet/put/PetPutRequestBody.md +docs/paths/pet/put/PetPutResponses.md docs/paths/pet/put/PetPutSecurityInfo.md -docs/paths/pet/put/RequestBody.md -docs/paths/pet/put/Responses.md -docs/paths/pet/put/responses/Code400Response.md -docs/paths/pet/put/responses/Code404Response.md -docs/paths/pet/put/responses/Code405Response.md +docs/paths/pet/put/responses/PetPutCode400Response.md +docs/paths/pet/put/responses/PetPutCode404Response.md +docs/paths/pet/put/responses/PetPutCode405Response.md docs/paths/pet/put/security/PetPutSecurityRequirementObject0.md docs/paths/pet/put/security/PetPutSecurityRequirementObject1.md -docs/paths/petfindbystatus/Get.md +docs/paths/petfindbystatus/PetfindbystatusGet.md docs/paths/petfindbystatus/PetfindbystatusServerInfo.md +docs/paths/petfindbystatus/get/PetfindbystatusGetQueryParameters.md +docs/paths/petfindbystatus/get/PetfindbystatusGetResponses.md docs/paths/petfindbystatus/get/PetfindbystatusGetSecurityInfo.md -docs/paths/petfindbystatus/get/QueryParameters.md -docs/paths/petfindbystatus/get/Responses.md docs/paths/petfindbystatus/get/parameters/parameter0/Schema0.md -docs/paths/petfindbystatus/get/responses/Code200Response.md -docs/paths/petfindbystatus/get/responses/Code400Response.md +docs/paths/petfindbystatus/get/responses/PetfindbystatusGetCode200Response.md +docs/paths/petfindbystatus/get/responses/PetfindbystatusGetCode400Response.md docs/paths/petfindbystatus/get/security/PetfindbystatusGetSecurityRequirementObject0.md docs/paths/petfindbystatus/get/security/PetfindbystatusGetSecurityRequirementObject1.md docs/paths/petfindbystatus/get/security/PetfindbystatusGetSecurityRequirementObject2.md docs/paths/petfindbystatus/servers/PetfindbystatusServer0.md docs/paths/petfindbystatus/servers/PetfindbystatusServer1.md docs/paths/petfindbystatus/servers/server1/Variables.md -docs/paths/petfindbytags/Get.md +docs/paths/petfindbytags/PetfindbytagsGet.md +docs/paths/petfindbytags/get/PetfindbytagsGetQueryParameters.md +docs/paths/petfindbytags/get/PetfindbytagsGetResponses.md docs/paths/petfindbytags/get/PetfindbytagsGetSecurityInfo.md -docs/paths/petfindbytags/get/QueryParameters.md -docs/paths/petfindbytags/get/Responses.md docs/paths/petfindbytags/get/parameters/parameter0/Schema0.md -docs/paths/petfindbytags/get/responses/Code200Response.md -docs/paths/petfindbytags/get/responses/Code400Response.md +docs/paths/petfindbytags/get/responses/PetfindbytagsGetCode200Response.md +docs/paths/petfindbytags/get/responses/PetfindbytagsGetCode400Response.md docs/paths/petfindbytags/get/security/PetfindbytagsGetSecurityRequirementObject0.md docs/paths/petfindbytags/get/security/PetfindbytagsGetSecurityRequirementObject1.md -docs/paths/petpetid/Delete.md -docs/paths/petpetid/Get.md -docs/paths/petpetid/Post.md -docs/paths/petpetid/delete/HeaderParameters.md -docs/paths/petpetid/delete/PathParameters.md +docs/paths/petpetid/PetpetidDelete.md +docs/paths/petpetid/PetpetidGet.md +docs/paths/petpetid/PetpetidPost.md +docs/paths/petpetid/delete/PetpetidDeleteHeaderParameters.md +docs/paths/petpetid/delete/PetpetidDeletePathParameters.md +docs/paths/petpetid/delete/PetpetidDeleteResponses.md docs/paths/petpetid/delete/PetpetidDeleteSecurityInfo.md -docs/paths/petpetid/delete/Responses.md docs/paths/petpetid/delete/parameters/parameter0/Schema0.md docs/paths/petpetid/delete/parameters/parameter1/Schema1.md -docs/paths/petpetid/delete/responses/Code400Response.md +docs/paths/petpetid/delete/responses/PetpetidDeleteCode400Response.md docs/paths/petpetid/delete/security/PetpetidDeleteSecurityRequirementObject0.md docs/paths/petpetid/delete/security/PetpetidDeleteSecurityRequirementObject1.md -docs/paths/petpetid/get/PathParameters.md +docs/paths/petpetid/get/PetpetidGetPathParameters.md +docs/paths/petpetid/get/PetpetidGetResponses.md docs/paths/petpetid/get/PetpetidGetSecurityInfo.md -docs/paths/petpetid/get/Responses.md docs/paths/petpetid/get/parameters/parameter0/Schema0.md -docs/paths/petpetid/get/responses/Code200Response.md -docs/paths/petpetid/get/responses/Code400Response.md -docs/paths/petpetid/get/responses/Code404Response.md +docs/paths/petpetid/get/responses/PetpetidGetCode200Response.md +docs/paths/petpetid/get/responses/PetpetidGetCode400Response.md +docs/paths/petpetid/get/responses/PetpetidGetCode404Response.md docs/paths/petpetid/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/petpetid/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md docs/paths/petpetid/get/security/PetpetidGetSecurityRequirementObject0.md -docs/paths/petpetid/post/PathParameters.md +docs/paths/petpetid/post/PetpetidPostPathParameters.md +docs/paths/petpetid/post/PetpetidPostRequestBody.md +docs/paths/petpetid/post/PetpetidPostResponses.md docs/paths/petpetid/post/PetpetidPostSecurityInfo.md -docs/paths/petpetid/post/RequestBody.md -docs/paths/petpetid/post/Responses.md docs/paths/petpetid/post/parameters/parameter0/Schema0.md docs/paths/petpetid/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md -docs/paths/petpetid/post/responses/Code405Response.md +docs/paths/petpetid/post/responses/PetpetidPostCode405Response.md docs/paths/petpetid/post/security/PetpetidPostSecurityRequirementObject0.md docs/paths/petpetid/post/security/PetpetidPostSecurityRequirementObject1.md -docs/paths/petpetiduploadimage/Post.md -docs/paths/petpetiduploadimage/post/PathParameters.md +docs/paths/petpetiduploadimage/PetpetiduploadimagePost.md +docs/paths/petpetiduploadimage/post/PetpetiduploadimagePostPathParameters.md +docs/paths/petpetiduploadimage/post/PetpetiduploadimagePostRequestBody.md +docs/paths/petpetiduploadimage/post/PetpetiduploadimagePostResponses.md docs/paths/petpetiduploadimage/post/PetpetiduploadimagePostSecurityInfo.md -docs/paths/petpetiduploadimage/post/RequestBody.md -docs/paths/petpetiduploadimage/post/Responses.md docs/paths/petpetiduploadimage/post/parameters/parameter0/Schema0.md docs/paths/petpetiduploadimage/post/requestbody/content/multipartformdata/MultipartformdataSchema.md -docs/paths/petpetiduploadimage/post/responses/Code200Response.md +docs/paths/petpetiduploadimage/post/responses/PetpetiduploadimagePostCode200Response.md docs/paths/petpetiduploadimage/post/security/PetpetiduploadimagePostSecurityRequirementObject0.md -docs/paths/solidus/Get.md -docs/paths/solidus/get/Responses.md -docs/paths/solidus/get/responses/Code200Response.md -docs/paths/storeinventory/Get.md -docs/paths/storeinventory/get/Responses.md +docs/paths/solidus/SolidusGet.md +docs/paths/solidus/get/SolidusGetResponses.md +docs/paths/solidus/get/responses/SolidusGetCode200Response.md +docs/paths/storeinventory/StoreinventoryGet.md +docs/paths/storeinventory/get/StoreinventoryGetResponses.md docs/paths/storeinventory/get/StoreinventoryGetSecurityInfo.md -docs/paths/storeinventory/get/responses/Code200Response.md +docs/paths/storeinventory/get/responses/StoreinventoryGetCode200Response.md docs/paths/storeinventory/get/security/StoreinventoryGetSecurityRequirementObject0.md -docs/paths/storeorder/Post.md -docs/paths/storeorder/post/RequestBody.md -docs/paths/storeorder/post/Responses.md +docs/paths/storeorder/StoreorderPost.md +docs/paths/storeorder/post/StoreorderPostRequestBody.md +docs/paths/storeorder/post/StoreorderPostResponses.md docs/paths/storeorder/post/requestbody/content/applicationjson/ApplicationjsonSchema.md -docs/paths/storeorder/post/responses/Code200Response.md -docs/paths/storeorder/post/responses/Code400Response.md +docs/paths/storeorder/post/responses/StoreorderPostCode200Response.md +docs/paths/storeorder/post/responses/StoreorderPostCode400Response.md docs/paths/storeorder/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/storeorder/post/responses/code200response/content/applicationxml/ApplicationxmlSchema.md -docs/paths/storeorderorderid/Delete.md -docs/paths/storeorderorderid/Get.md -docs/paths/storeorderorderid/delete/PathParameters.md -docs/paths/storeorderorderid/delete/Responses.md +docs/paths/storeorderorderid/StoreorderorderidDelete.md +docs/paths/storeorderorderid/StoreorderorderidGet.md +docs/paths/storeorderorderid/delete/StoreorderorderidDeletePathParameters.md +docs/paths/storeorderorderid/delete/StoreorderorderidDeleteResponses.md docs/paths/storeorderorderid/delete/parameters/parameter0/Schema0.md -docs/paths/storeorderorderid/delete/responses/Code400Response.md -docs/paths/storeorderorderid/delete/responses/Code404Response.md -docs/paths/storeorderorderid/get/PathParameters.md -docs/paths/storeorderorderid/get/Responses.md +docs/paths/storeorderorderid/delete/responses/StoreorderorderidDeleteCode400Response.md +docs/paths/storeorderorderid/delete/responses/StoreorderorderidDeleteCode404Response.md +docs/paths/storeorderorderid/get/StoreorderorderidGetPathParameters.md +docs/paths/storeorderorderid/get/StoreorderorderidGetResponses.md docs/paths/storeorderorderid/get/parameters/parameter0/Schema0.md -docs/paths/storeorderorderid/get/responses/Code200Response.md -docs/paths/storeorderorderid/get/responses/Code400Response.md -docs/paths/storeorderorderid/get/responses/Code404Response.md +docs/paths/storeorderorderid/get/responses/StoreorderorderidGetCode200Response.md +docs/paths/storeorderorderid/get/responses/StoreorderorderidGetCode400Response.md +docs/paths/storeorderorderid/get/responses/StoreorderorderidGetCode404Response.md docs/paths/storeorderorderid/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/storeorderorderid/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md -docs/paths/user/Post.md -docs/paths/user/post/RequestBody.md -docs/paths/user/post/Responses.md +docs/paths/user/UserPost.md +docs/paths/user/post/UserPostRequestBody.md +docs/paths/user/post/UserPostResponses.md docs/paths/user/post/requestbody/content/applicationjson/ApplicationjsonSchema.md -docs/paths/user/post/responses/CodedefaultResponse.md -docs/paths/usercreatewitharray/Post.md -docs/paths/usercreatewitharray/post/RequestBody.md -docs/paths/usercreatewitharray/post/Responses.md -docs/paths/usercreatewitharray/post/responses/CodedefaultResponse.md -docs/paths/usercreatewithlist/Post.md -docs/paths/usercreatewithlist/post/RequestBody.md -docs/paths/usercreatewithlist/post/Responses.md -docs/paths/usercreatewithlist/post/responses/CodedefaultResponse.md -docs/paths/userlogin/Get.md -docs/paths/userlogin/get/QueryParameters.md -docs/paths/userlogin/get/Responses.md +docs/paths/user/post/responses/UserPostCodedefaultResponse.md +docs/paths/usercreatewitharray/UsercreatewitharrayPost.md +docs/paths/usercreatewitharray/post/UsercreatewitharrayPostRequestBody.md +docs/paths/usercreatewitharray/post/UsercreatewitharrayPostResponses.md +docs/paths/usercreatewitharray/post/responses/UsercreatewitharrayPostCodedefaultResponse.md +docs/paths/usercreatewithlist/UsercreatewithlistPost.md +docs/paths/usercreatewithlist/post/UsercreatewithlistPostRequestBody.md +docs/paths/usercreatewithlist/post/UsercreatewithlistPostResponses.md +docs/paths/usercreatewithlist/post/responses/UsercreatewithlistPostCodedefaultResponse.md +docs/paths/userlogin/UserloginGet.md +docs/paths/userlogin/get/UserloginGetQueryParameters.md +docs/paths/userlogin/get/UserloginGetResponses.md docs/paths/userlogin/get/parameters/parameter0/Schema0.md docs/paths/userlogin/get/parameters/parameter1/Schema1.md -docs/paths/userlogin/get/responses/Code200Response.md -docs/paths/userlogin/get/responses/Code400Response.md -docs/paths/userlogin/get/responses/code200response/Code200ResponseHeadersSchema.md +docs/paths/userlogin/get/responses/UserloginGetCode200Response.md +docs/paths/userlogin/get/responses/UserloginGetCode400Response.md +docs/paths/userlogin/get/responses/code200response/UserloginGetCode200ResponseHeadersSchema.md docs/paths/userlogin/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/userlogin/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md docs/paths/userlogin/get/responses/code200response/headers/xexpiresafter/XExpiresAfterSchema.md docs/paths/userlogin/get/responses/code200response/headers/xratelimit/content/applicationjson/XRateLimitSchema.md -docs/paths/userlogout/Get.md -docs/paths/userlogout/get/Responses.md -docs/paths/userlogout/get/responses/CodedefaultResponse.md -docs/paths/userusername/Delete.md -docs/paths/userusername/Get.md -docs/paths/userusername/Put.md -docs/paths/userusername/delete/PathParameters.md -docs/paths/userusername/delete/Responses.md -docs/paths/userusername/delete/responses/Code200Response.md -docs/paths/userusername/delete/responses/Code404Response.md -docs/paths/userusername/get/PathParameters.md -docs/paths/userusername/get/Responses.md -docs/paths/userusername/get/responses/Code200Response.md -docs/paths/userusername/get/responses/Code400Response.md -docs/paths/userusername/get/responses/Code404Response.md +docs/paths/userlogout/UserlogoutGet.md +docs/paths/userlogout/get/UserlogoutGetResponses.md +docs/paths/userlogout/get/responses/UserlogoutGetCodedefaultResponse.md +docs/paths/userusername/UserusernameDelete.md +docs/paths/userusername/UserusernameGet.md +docs/paths/userusername/UserusernamePut.md +docs/paths/userusername/delete/UserusernameDeletePathParameters.md +docs/paths/userusername/delete/UserusernameDeleteResponses.md +docs/paths/userusername/delete/responses/UserusernameDeleteCode200Response.md +docs/paths/userusername/delete/responses/UserusernameDeleteCode404Response.md +docs/paths/userusername/get/UserusernameGetPathParameters.md +docs/paths/userusername/get/UserusernameGetResponses.md +docs/paths/userusername/get/responses/UserusernameGetCode200Response.md +docs/paths/userusername/get/responses/UserusernameGetCode400Response.md +docs/paths/userusername/get/responses/UserusernameGetCode404Response.md docs/paths/userusername/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md docs/paths/userusername/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md -docs/paths/userusername/put/PathParameters.md -docs/paths/userusername/put/RequestBody.md -docs/paths/userusername/put/Responses.md +docs/paths/userusername/put/UserusernamePutPathParameters.md +docs/paths/userusername/put/UserusernamePutRequestBody.md +docs/paths/userusername/put/UserusernamePutResponses.md docs/paths/userusername/put/requestbody/content/applicationjson/ApplicationjsonSchema.md -docs/paths/userusername/put/responses/Code400Response.md -docs/paths/userusername/put/responses/Code404Response.md +docs/paths/userusername/put/responses/UserusernamePutCode400Response.md +docs/paths/userusername/put/responses/UserusernamePutCode404Response.md docs/servers/Server0.md docs/servers/Server1.md docs/servers/Server2.md @@ -747,6 +810,13 @@ src/main/java/org/openapijsonschematools/client/apis/paths/Usercreatewithlist.ja src/main/java/org/openapijsonschematools/client/apis/paths/Userlogin.java src/main/java/org/openapijsonschematools/client/apis/paths/Userlogout.java src/main/java/org/openapijsonschematools/client/apis/paths/Userusername.java +src/main/java/org/openapijsonschematools/client/apis/tags/Anotherfake.java +src/main/java/org/openapijsonschematools/client/apis/tags/Default.java +src/main/java/org/openapijsonschematools/client/apis/tags/Fake.java +src/main/java/org/openapijsonschematools/client/apis/tags/Fakeclassnametags123.java +src/main/java/org/openapijsonschematools/client/apis/tags/Pet.java +src/main/java/org/openapijsonschematools/client/apis/tags/Store.java +src/main/java/org/openapijsonschematools/client/apis/tags/User.java src/main/java/org/openapijsonschematools/client/components/headers/Int32JsonContentTypeHeader.java src/main/java/org/openapijsonschematools/client/components/headers/NumberHeader.java src/main/java/org/openapijsonschematools/client/components/headers/RefContentSchemaHeader.java @@ -1034,48 +1104,48 @@ src/main/java/org/openapijsonschematools/client/paths/Usercreatewithlist.java src/main/java/org/openapijsonschematools/client/paths/Userlogin.java src/main/java/org/openapijsonschematools/client/paths/Userlogout.java src/main/java/org/openapijsonschematools/client/paths/Userusername.java -src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/Patch.java -src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/Responses.java -src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/AnotherfakedummyPatch.java +src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/AnotherfakedummyPatchRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/AnotherfakedummyPatchResponses.java +src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/responses/AnotherfakedummyPatchCode200Response.java src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/Delete.java -src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/Get.java -src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/Post.java -src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/HeaderParameters.java +src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/CommonparamsubdirDelete.java +src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/CommonparamsubdirGet.java +src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/CommonparamsubdirPost.java +src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/CommonparamsubdirDeleteHeaderParameters.java +src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/CommonparamsubdirDeletePathParameters.java +src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/CommonparamsubdirDeleteResponses.java src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/Parameters.java -src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/PathParameters.java -src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/Responses.java src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/parameters/Parameter0.java src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/parameters/Parameter1.java src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/parameters/parameter0/Schema0.java src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/parameters/parameter1/Schema1.java -src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/responses/CommonparamsubdirDeleteCode200Response.java +src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/CommonparamsubdirGetPathParameters.java +src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/CommonparamsubdirGetQueryParameters.java +src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/CommonparamsubdirGetResponses.java src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/Parameters.java -src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/PathParameters.java -src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/QueryParameters.java -src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/Responses.java src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/parameters/Parameter0.java src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/parameters/parameter0/Schema0.java -src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/responses/CommonparamsubdirGetCode200Response.java src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/parameters/RouteParameter0.java src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/parameters/routeparameter0/RouteParamSchema0.java -src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/HeaderParameters.java +src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/CommonparamsubdirPostHeaderParameters.java +src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/CommonparamsubdirPostPathParameters.java +src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/CommonparamsubdirPostResponses.java src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/Parameters.java -src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/PathParameters.java -src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/Responses.java src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/parameters/Parameter0.java src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/parameters/parameter0/Schema0.java -src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/responses/Code200Response.java -src/main/java/org/openapijsonschematools/client/paths/fake/Delete.java -src/main/java/org/openapijsonschematools/client/paths/fake/Get.java -src/main/java/org/openapijsonschematools/client/paths/fake/Patch.java -src/main/java/org/openapijsonschematools/client/paths/fake/Post.java +src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/responses/CommonparamsubdirPostCode200Response.java +src/main/java/org/openapijsonschematools/client/paths/fake/FakeDelete.java +src/main/java/org/openapijsonschematools/client/paths/fake/FakeGet.java +src/main/java/org/openapijsonschematools/client/paths/fake/FakePatch.java +src/main/java/org/openapijsonschematools/client/paths/fake/FakePost.java +src/main/java/org/openapijsonschematools/client/paths/fake/delete/FakeDeleteHeaderParameters.java +src/main/java/org/openapijsonschematools/client/paths/fake/delete/FakeDeleteQueryParameters.java +src/main/java/org/openapijsonschematools/client/paths/fake/delete/FakeDeleteResponses.java src/main/java/org/openapijsonschematools/client/paths/fake/delete/FakeDeleteSecurityInfo.java -src/main/java/org/openapijsonschematools/client/paths/fake/delete/HeaderParameters.java src/main/java/org/openapijsonschematools/client/paths/fake/delete/Parameters.java -src/main/java/org/openapijsonschematools/client/paths/fake/delete/QueryParameters.java -src/main/java/org/openapijsonschematools/client/paths/fake/delete/Responses.java src/main/java/org/openapijsonschematools/client/paths/fake/delete/parameters/Parameter0.java src/main/java/org/openapijsonschematools/client/paths/fake/delete/parameters/Parameter1.java src/main/java/org/openapijsonschematools/client/paths/fake/delete/parameters/Parameter2.java @@ -1088,13 +1158,13 @@ src/main/java/org/openapijsonschematools/client/paths/fake/delete/parameters/par src/main/java/org/openapijsonschematools/client/paths/fake/delete/parameters/parameter3/Schema3.java src/main/java/org/openapijsonschematools/client/paths/fake/delete/parameters/parameter4/Schema4.java src/main/java/org/openapijsonschematools/client/paths/fake/delete/parameters/parameter5/Schema5.java -src/main/java/org/openapijsonschematools/client/paths/fake/delete/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fake/delete/responses/FakeDeleteCode200Response.java src/main/java/org/openapijsonschematools/client/paths/fake/delete/security/FakeDeleteSecurityRequirementObject0.java -src/main/java/org/openapijsonschematools/client/paths/fake/get/HeaderParameters.java +src/main/java/org/openapijsonschematools/client/paths/fake/get/FakeGetHeaderParameters.java +src/main/java/org/openapijsonschematools/client/paths/fake/get/FakeGetQueryParameters.java +src/main/java/org/openapijsonschematools/client/paths/fake/get/FakeGetRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/fake/get/FakeGetResponses.java src/main/java/org/openapijsonschematools/client/paths/fake/get/Parameters.java -src/main/java/org/openapijsonschematools/client/paths/fake/get/QueryParameters.java -src/main/java/org/openapijsonschematools/client/paths/fake/get/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fake/get/Responses.java src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/Parameter0.java src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/Parameter1.java src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/Parameter2.java @@ -1108,141 +1178,141 @@ src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parame src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parameter4/Schema4.java src/main/java/org/openapijsonschematools/client/paths/fake/get/parameters/parameter5/Schema5.java src/main/java/org/openapijsonschematools/client/paths/fake/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.java -src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/Code200Response.java -src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/Code404Response.java +src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/FakeGetCode200Response.java +src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/FakeGetCode404Response.java src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/code404response/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fake/patch/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fake/patch/Responses.java -src/main/java/org/openapijsonschematools/client/paths/fake/patch/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fake/patch/FakePatchRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/fake/patch/FakePatchResponses.java +src/main/java/org/openapijsonschematools/client/paths/fake/patch/responses/FakePatchCode200Response.java src/main/java/org/openapijsonschematools/client/paths/fake/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.java +src/main/java/org/openapijsonschematools/client/paths/fake/post/FakePostRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/fake/post/FakePostResponses.java src/main/java/org/openapijsonschematools/client/paths/fake/post/FakePostSecurityInfo.java -src/main/java/org/openapijsonschematools/client/paths/fake/post/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fake/post/Responses.java src/main/java/org/openapijsonschematools/client/paths/fake/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.java -src/main/java/org/openapijsonschematools/client/paths/fake/post/responses/Code200Response.java -src/main/java/org/openapijsonschematools/client/paths/fake/post/responses/Code404Response.java +src/main/java/org/openapijsonschematools/client/paths/fake/post/responses/FakePostCode200Response.java +src/main/java/org/openapijsonschematools/client/paths/fake/post/responses/FakePostCode404Response.java src/main/java/org/openapijsonschematools/client/paths/fake/post/security/FakePostSecurityRequirementObject0.java -src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/Get.java -src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/Responses.java +src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/FakeadditionalpropertieswitharrayofenumsGet.java +src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/FakeadditionalpropertieswitharrayofenumsGetRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/FakeadditionalpropertieswitharrayofenumsGetResponses.java src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/requestbody/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/responses/FakeadditionalpropertieswitharrayofenumsGetCode200Response.java src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/Put.java -src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/Responses.java +src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/FakebodywithfileschemaPut.java +src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/FakebodywithfileschemaPutRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/FakebodywithfileschemaPutResponses.java src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/requestbody/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/responses/Code200Response.java -src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/Put.java +src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/responses/FakebodywithfileschemaPutCode200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/FakebodywithqueryparamsPut.java +src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutQueryParameters.java +src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutResponses.java src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/Parameters.java -src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/QueryParameters.java -src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/Responses.java src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/parameters/Parameter0.java src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/parameters/parameter0/Schema0.java src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/requestbody/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/responses/Code200Response.java -src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/Put.java +src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/responses/FakebodywithqueryparamsPutCode200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/FakecasesensitiveparamsPut.java +src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/FakecasesensitiveparamsPutQueryParameters.java +src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/FakecasesensitiveparamsPutResponses.java src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/Parameters.java -src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/QueryParameters.java -src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/Responses.java src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/parameters/Parameter0.java src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/parameters/Parameter1.java src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/parameters/Parameter2.java src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/parameters/parameter0/Schema0.java src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/parameters/parameter1/Schema1.java src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/parameters/parameter2/Schema2.java -src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/responses/Code200Response.java -src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/Patch.java +src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/responses/FakecasesensitiveparamsPutCode200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/FakeclassnametestPatch.java +src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/FakeclassnametestPatchRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/FakeclassnametestPatchResponses.java src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/FakeclassnametestPatchSecurityInfo.java -src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/Responses.java -src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/responses/FakeclassnametestPatchCode200Response.java src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/security/FakeclassnametestPatchSecurityRequirementObject0.java -src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/Delete.java +src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/FakedeletecoffeeidDelete.java +src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/FakedeletecoffeeidDeletePathParameters.java +src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/FakedeletecoffeeidDeleteResponses.java src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/Parameters.java -src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/PathParameters.java -src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/Responses.java src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/parameters/Parameter0.java src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/parameters/parameter0/Schema0.java -src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/responses/Code200Response.java -src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/responses/CodedefaultResponse.java -src/main/java/org/openapijsonschematools/client/paths/fakehealth/Get.java -src/main/java/org/openapijsonschematools/client/paths/fakehealth/get/Responses.java -src/main/java/org/openapijsonschematools/client/paths/fakehealth/get/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/responses/FakedeletecoffeeidDeleteCode200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/responses/FakedeletecoffeeidDeleteCodedefaultResponse.java +src/main/java/org/openapijsonschematools/client/paths/fakehealth/FakehealthGet.java +src/main/java/org/openapijsonschematools/client/paths/fakehealth/get/FakehealthGetResponses.java +src/main/java/org/openapijsonschematools/client/paths/fakehealth/get/responses/FakehealthGetCode200Response.java src/main/java/org/openapijsonschematools/client/paths/fakehealth/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/Post.java -src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/Responses.java +src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/FakeinlineadditionalpropertiesPost.java +src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/FakeinlineadditionalpropertiesPostRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/FakeinlineadditionalpropertiesPostResponses.java src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/requestbody/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/responses/Code200Response.java -src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/Post.java +src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/responses/FakeinlineadditionalpropertiesPostCode200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/FakeinlinecompositionPost.java +src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/FakeinlinecompositionPostQueryParameters.java +src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/FakeinlinecompositionPostRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/FakeinlinecompositionPostResponses.java src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/Parameters.java -src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/QueryParameters.java -src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/Responses.java src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/parameters/Parameter0.java src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/parameters/Parameter1.java src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/parameters/parameter0/Schema0.java src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/parameters/parameter1/Schema1.java src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/requestbody/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/requestbody/content/multipartformdata/MultipartformdataSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/FakeinlinecompositionPostCode200Response.java src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/code200response/content/multipartformdata/MultipartformdataSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/Get.java -src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/Responses.java +src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/FakejsonformdataGet.java +src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/FakejsonformdataGetRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/FakejsonformdataGetResponses.java src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/responses/Code200Response.java -src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/Patch.java -src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/Responses.java +src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/responses/FakejsonformdataGetCode200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/FakejsonpatchPatch.java +src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/FakejsonpatchPatchRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/FakejsonpatchPatchResponses.java src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/requestbody/content/applicationjsonpatchjson/ApplicationjsonpatchjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/responses/Code200Response.java -src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/Post.java -src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/Responses.java +src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/responses/FakejsonpatchPatchCode200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/FakejsonwithcharsetPost.java +src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/FakejsonwithcharsetPostRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/FakejsonwithcharsetPostResponses.java src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/requestbody/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.java -src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/responses/FakejsonwithcharsetPostCode200Response.java src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/responses/code200response/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.java -src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/Post.java -src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/Responses.java +src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/FakemultiplerequestbodycontenttypesPost.java +src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/FakemultiplerequestbodycontenttypesPostRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/FakemultiplerequestbodycontenttypesPostResponses.java src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/multipartformdata/MultipartformdataSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/responses/FakemultiplerequestbodycontenttypesPostCode200Response.java src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/Get.java -src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/Responses.java -src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/Code200Response.java -src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/Code202Response.java +src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/FakemultipleresponsebodiesGet.java +src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/FakemultipleresponsebodiesGetResponses.java +src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/FakemultipleresponsebodiesGetCode200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/FakemultipleresponsebodiesGetCode202Response.java src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/code202response/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/Get.java +src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/FakemultiplesecuritiesGet.java +src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/FakemultiplesecuritiesGetResponses.java src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/FakemultiplesecuritiesGetSecurityInfo.java -src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/Responses.java -src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/responses/FakemultiplesecuritiesGetCode200Response.java src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/security/FakemultiplesecuritiesGetSecurityRequirementObject0.java src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/security/FakemultiplesecuritiesGetSecurityRequirementObject1.java src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/security/FakemultiplesecuritiesGetSecurityRequirementObject2.java -src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/Get.java +src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/FakeobjinqueryGet.java +src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/FakeobjinqueryGetQueryParameters.java +src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/FakeobjinqueryGetResponses.java src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/Parameters.java -src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/QueryParameters.java -src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/Responses.java src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/parameters/Parameter0.java src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/parameters/parameter0/Schema0.java -src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/responses/Code200Response.java -src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/Post.java -src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/CookieParameters.java -src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/HeaderParameters.java +src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/responses/FakeobjinqueryGetCode200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/Fakeparametercollisions1ababselfabPost.java +src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostCookieParameters.java +src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostHeaderParameters.java +src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostPathParameters.java +src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostQueryParameters.java +src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostResponses.java src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/Parameters.java -src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/PathParameters.java -src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/QueryParameters.java -src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/Responses.java src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/parameters/Parameter0.java src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/parameters/Parameter1.java src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/parameters/Parameter10.java @@ -1282,106 +1352,106 @@ src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ab src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/parameters/parameter8/Schema8.java src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/parameters/parameter9/Schema9.java src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/requestbody/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/responses/Fakeparametercollisions1ababselfabPostCode200Response.java src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/Get.java -src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/Responses.java +src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/FakepemcontenttypeGet.java +src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/FakepemcontenttypeGetRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/FakepemcontenttypeGetResponses.java src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/requestbody/content/applicationxpemfile/ApplicationxpemfileSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/responses/FakepemcontenttypeGetCode200Response.java src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/responses/code200response/content/applicationxpemfile/ApplicationxpemfileSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/Post.java +src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/FakepetiduploadimagewithrequiredfilePost.java +src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostPathParameters.java +src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostResponses.java src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostSecurityInfo.java src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/Parameters.java -src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/PathParameters.java -src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/Responses.java src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/parameters/Parameter0.java src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/parameters/parameter0/Schema0.java src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/responses/FakepetiduploadimagewithrequiredfilePostCode200Response.java src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/security/FakepetiduploadimagewithrequiredfilePostSecurityRequirementObject0.java -src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/Get.java +src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/FakequeryparamwithjsoncontenttypeGet.java +src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/FakequeryparamwithjsoncontenttypeGetQueryParameters.java +src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/FakequeryparamwithjsoncontenttypeGetResponses.java src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/Parameters.java -src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/QueryParameters.java -src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/Responses.java src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/parameters/Parameter0.java src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/parameters/parameter0/content/applicationjson/Schema0.java -src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/responses/FakequeryparamwithjsoncontenttypeGetCode200Response.java src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakeredirection/Get.java -src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/Responses.java -src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/responses/Code303Response.java -src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/responses/Code3XXResponse.java -src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/Get.java +src/main/java/org/openapijsonschematools/client/paths/fakeredirection/FakeredirectionGet.java +src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/FakeredirectionGetResponses.java +src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/responses/FakeredirectionGetCode303Response.java +src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/responses/FakeredirectionGetCode3XXResponse.java +src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/FakerefobjinqueryGet.java +src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/FakerefobjinqueryGetQueryParameters.java +src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/FakerefobjinqueryGetResponses.java src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/Parameters.java -src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/QueryParameters.java -src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/Responses.java src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/parameters/Parameter0.java src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/parameters/parameter0/Schema0.java -src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/responses/Code200Response.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/Post.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/Responses.java +src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/responses/FakerefobjinqueryGetCode200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/FakerefsarraymodelPost.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/FakerefsarraymodelPostRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/FakerefsarraymodelPostResponses.java src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/requestbody/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/responses/FakerefsarraymodelPostCode200Response.java src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/Post.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/Responses.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/FakerefsarrayofenumsPost.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/FakerefsarrayofenumsPostRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/FakerefsarrayofenumsPostResponses.java src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/requestbody/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/responses/FakerefsarrayofenumsPostCode200Response.java src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/Post.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/Responses.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/FakerefsbooleanPost.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/FakerefsbooleanPostRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/FakerefsbooleanPostResponses.java src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/requestbody/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/responses/FakerefsbooleanPostCode200Response.java src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/Post.java -src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/Responses.java +src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/FakerefscomposedoneofnumberwithvalidationsPost.java +src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/FakerefscomposedoneofnumberwithvalidationsPostRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/FakerefscomposedoneofnumberwithvalidationsPostResponses.java src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/requestbody/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/FakerefscomposedoneofnumberwithvalidationsPostCode200Response.java src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/Post.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/Responses.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/FakerefsenumPost.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/FakerefsenumPostRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/FakerefsenumPostResponses.java src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/requestbody/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/responses/FakerefsenumPostCode200Response.java src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/Post.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/Responses.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/FakerefsmammalPost.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/FakerefsmammalPostRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/FakerefsmammalPostResponses.java src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/requestbody/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/responses/FakerefsmammalPostCode200Response.java src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/Post.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/Responses.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/FakerefsnumberPost.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/FakerefsnumberPostRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/FakerefsnumberPostResponses.java src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/requestbody/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/responses/FakerefsnumberPostCode200Response.java src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/Post.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/Responses.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/FakerefsobjectmodelwithrefpropsPost.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/FakerefsobjectmodelwithrefpropsPostRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/FakerefsobjectmodelwithrefpropsPostResponses.java src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/requestbody/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/responses/FakerefsobjectmodelwithrefpropsPostCode200Response.java src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/Post.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/Responses.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/FakerefsstringPost.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/FakerefsstringPostRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/FakerefsstringPostResponses.java src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/requestbody/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/responses/FakerefsstringPostCode200Response.java src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakeresponsewithoutschema/Get.java -src/main/java/org/openapijsonschematools/client/paths/fakeresponsewithoutschema/get/Responses.java -src/main/java/org/openapijsonschematools/client/paths/fakeresponsewithoutschema/get/responses/Code200Response.java -src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/Put.java +src/main/java/org/openapijsonschematools/client/paths/fakeresponsewithoutschema/FakeresponsewithoutschemaGet.java +src/main/java/org/openapijsonschematools/client/paths/fakeresponsewithoutschema/get/FakeresponsewithoutschemaGetResponses.java +src/main/java/org/openapijsonschematools/client/paths/fakeresponsewithoutschema/get/responses/FakeresponsewithoutschemaGetCode200Response.java +src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/FaketestqueryparamtersPut.java +src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/FaketestqueryparamtersPutQueryParameters.java +src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/FaketestqueryparamtersPutResponses.java src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/Parameters.java -src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/QueryParameters.java -src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/Responses.java src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/Parameter0.java src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/Parameter1.java src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/Parameter2.java @@ -1394,201 +1464,201 @@ src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/parameter3/Schema3.java src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/parameter4/Schema4.java src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/parameters/parameter5/Schema5.java -src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/responses/Code200Response.java -src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/Post.java -src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/Responses.java +src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/responses/FaketestqueryparamtersPutCode200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/FakeuploaddownloadfilePost.java +src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/FakeuploaddownloadfilePostRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/FakeuploaddownloadfilePostResponses.java src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/requestbody/content/applicationoctetstream/ApplicationoctetstreamSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/responses/FakeuploaddownloadfilePostCode200Response.java src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/responses/code200response/content/applicationoctetstream/ApplicationoctetstreamSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/Post.java -src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/Responses.java +src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/FakeuploadfilePost.java +src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/FakeuploadfilePostRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/FakeuploadfilePostResponses.java src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/responses/FakeuploadfilePostCode200Response.java src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/Post.java -src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/Responses.java +src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/FakeuploadfilesPost.java +src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/FakeuploadfilesPostRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/FakeuploadfilesPostResponses.java src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/requestbody/content/multipartformdata/MultipartformdataSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/responses/FakeuploadfilesPostCode200Response.java src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/Get.java -src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/Responses.java -src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code1XXResponse.java -src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code200Response.java -src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code2XXResponse.java -src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code3XXResponse.java -src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code4XXResponse.java -src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code5XXResponse.java +src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/FakewildcardresponsesGet.java +src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/FakewildcardresponsesGetResponses.java +src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode1XXResponse.java +src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode200Response.java +src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode2XXResponse.java +src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode3XXResponse.java +src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode4XXResponse.java +src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode5XXResponse.java src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code1xxresponse/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code2xxresponse/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code3xxresponse/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code4xxresponse/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/code5xxresponse/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/foo/Get.java +src/main/java/org/openapijsonschematools/client/paths/foo/FooGet.java +src/main/java/org/openapijsonschematools/client/paths/foo/get/FooGetResponses.java src/main/java/org/openapijsonschematools/client/paths/foo/get/FooGetServerInfo.java -src/main/java/org/openapijsonschematools/client/paths/foo/get/Responses.java -src/main/java/org/openapijsonschematools/client/paths/foo/get/responses/CodedefaultResponse.java +src/main/java/org/openapijsonschematools/client/paths/foo/get/responses/FooGetCodedefaultResponse.java src/main/java/org/openapijsonschematools/client/paths/foo/get/responses/codedefaultresponse/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/foo/get/servers/FooGetServer0.java src/main/java/org/openapijsonschematools/client/paths/foo/get/servers/FooGetServer1.java src/main/java/org/openapijsonschematools/client/paths/foo/get/servers/server1/Variables.java -src/main/java/org/openapijsonschematools/client/paths/pet/Post.java -src/main/java/org/openapijsonschematools/client/paths/pet/Put.java +src/main/java/org/openapijsonschematools/client/paths/pet/PetPost.java +src/main/java/org/openapijsonschematools/client/paths/pet/PetPut.java +src/main/java/org/openapijsonschematools/client/paths/pet/post/PetPostRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/pet/post/PetPostResponses.java src/main/java/org/openapijsonschematools/client/paths/pet/post/PetPostSecurityInfo.java -src/main/java/org/openapijsonschematools/client/paths/pet/post/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/pet/post/Responses.java -src/main/java/org/openapijsonschematools/client/paths/pet/post/responses/Code200Response.java -src/main/java/org/openapijsonschematools/client/paths/pet/post/responses/Code405Response.java +src/main/java/org/openapijsonschematools/client/paths/pet/post/responses/PetPostCode200Response.java +src/main/java/org/openapijsonschematools/client/paths/pet/post/responses/PetPostCode405Response.java src/main/java/org/openapijsonschematools/client/paths/pet/post/security/PetPostSecurityRequirementObject0.java src/main/java/org/openapijsonschematools/client/paths/pet/post/security/PetPostSecurityRequirementObject1.java src/main/java/org/openapijsonschematools/client/paths/pet/post/security/PetPostSecurityRequirementObject2.java +src/main/java/org/openapijsonschematools/client/paths/pet/put/PetPutRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/pet/put/PetPutResponses.java src/main/java/org/openapijsonschematools/client/paths/pet/put/PetPutSecurityInfo.java -src/main/java/org/openapijsonschematools/client/paths/pet/put/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/pet/put/Responses.java -src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/Code400Response.java -src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/Code404Response.java -src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/Code405Response.java +src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/PetPutCode400Response.java +src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/PetPutCode404Response.java +src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/PetPutCode405Response.java src/main/java/org/openapijsonschematools/client/paths/pet/put/security/PetPutSecurityRequirementObject0.java src/main/java/org/openapijsonschematools/client/paths/pet/put/security/PetPutSecurityRequirementObject1.java -src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/Get.java +src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/PetfindbystatusGet.java src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/PetfindbystatusServerInfo.java src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/Parameters.java +src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/PetfindbystatusGetQueryParameters.java +src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/PetfindbystatusGetResponses.java src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/PetfindbystatusGetSecurityInfo.java -src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/QueryParameters.java -src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/Responses.java src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/parameters/Parameter0.java src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/parameters/parameter0/Schema0.java -src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/responses/Code200Response.java -src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/responses/Code400Response.java +src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/responses/PetfindbystatusGetCode200Response.java +src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/responses/PetfindbystatusGetCode400Response.java src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/security/PetfindbystatusGetSecurityRequirementObject0.java src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/security/PetfindbystatusGetSecurityRequirementObject1.java src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/security/PetfindbystatusGetSecurityRequirementObject2.java src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/servers/PetfindbystatusServer0.java src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/servers/PetfindbystatusServer1.java src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/servers/server1/Variables.java -src/main/java/org/openapijsonschematools/client/paths/petfindbytags/Get.java +src/main/java/org/openapijsonschematools/client/paths/petfindbytags/PetfindbytagsGet.java src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/Parameters.java +src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/PetfindbytagsGetQueryParameters.java +src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/PetfindbytagsGetResponses.java src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/PetfindbytagsGetSecurityInfo.java -src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/QueryParameters.java -src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/Responses.java src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/parameters/Parameter0.java src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/parameters/parameter0/Schema0.java -src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/responses/Code200Response.java -src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/responses/Code400Response.java +src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/responses/PetfindbytagsGetCode200Response.java +src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/responses/PetfindbytagsGetCode400Response.java src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/security/PetfindbytagsGetSecurityRequirementObject0.java src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/security/PetfindbytagsGetSecurityRequirementObject1.java -src/main/java/org/openapijsonschematools/client/paths/petpetid/Delete.java -src/main/java/org/openapijsonschematools/client/paths/petpetid/Get.java -src/main/java/org/openapijsonschematools/client/paths/petpetid/Post.java -src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/HeaderParameters.java +src/main/java/org/openapijsonschematools/client/paths/petpetid/PetpetidDelete.java +src/main/java/org/openapijsonschematools/client/paths/petpetid/PetpetidGet.java +src/main/java/org/openapijsonschematools/client/paths/petpetid/PetpetidPost.java src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/Parameters.java -src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/PathParameters.java +src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/PetpetidDeleteHeaderParameters.java +src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/PetpetidDeletePathParameters.java +src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/PetpetidDeleteResponses.java src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/PetpetidDeleteSecurityInfo.java -src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/Responses.java src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/parameters/Parameter0.java src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/parameters/Parameter1.java src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/parameters/parameter0/Schema0.java src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/parameters/parameter1/Schema1.java -src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/responses/Code400Response.java +src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/responses/PetpetidDeleteCode400Response.java src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/security/PetpetidDeleteSecurityRequirementObject0.java src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/security/PetpetidDeleteSecurityRequirementObject1.java src/main/java/org/openapijsonschematools/client/paths/petpetid/get/Parameters.java -src/main/java/org/openapijsonschematools/client/paths/petpetid/get/PathParameters.java +src/main/java/org/openapijsonschematools/client/paths/petpetid/get/PetpetidGetPathParameters.java +src/main/java/org/openapijsonschematools/client/paths/petpetid/get/PetpetidGetResponses.java src/main/java/org/openapijsonschematools/client/paths/petpetid/get/PetpetidGetSecurityInfo.java -src/main/java/org/openapijsonschematools/client/paths/petpetid/get/Responses.java src/main/java/org/openapijsonschematools/client/paths/petpetid/get/parameters/Parameter0.java src/main/java/org/openapijsonschematools/client/paths/petpetid/get/parameters/parameter0/Schema0.java -src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/Code200Response.java -src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/Code400Response.java -src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/Code404Response.java +src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/PetpetidGetCode200Response.java +src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/PetpetidGetCode400Response.java +src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/PetpetidGetCode404Response.java src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.java src/main/java/org/openapijsonschematools/client/paths/petpetid/get/security/PetpetidGetSecurityRequirementObject0.java src/main/java/org/openapijsonschematools/client/paths/petpetid/post/Parameters.java -src/main/java/org/openapijsonschematools/client/paths/petpetid/post/PathParameters.java +src/main/java/org/openapijsonschematools/client/paths/petpetid/post/PetpetidPostPathParameters.java +src/main/java/org/openapijsonschematools/client/paths/petpetid/post/PetpetidPostRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/petpetid/post/PetpetidPostResponses.java src/main/java/org/openapijsonschematools/client/paths/petpetid/post/PetpetidPostSecurityInfo.java -src/main/java/org/openapijsonschematools/client/paths/petpetid/post/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/petpetid/post/Responses.java src/main/java/org/openapijsonschematools/client/paths/petpetid/post/parameters/Parameter0.java src/main/java/org/openapijsonschematools/client/paths/petpetid/post/parameters/parameter0/Schema0.java src/main/java/org/openapijsonschematools/client/paths/petpetid/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.java -src/main/java/org/openapijsonschematools/client/paths/petpetid/post/responses/Code405Response.java +src/main/java/org/openapijsonschematools/client/paths/petpetid/post/responses/PetpetidPostCode405Response.java src/main/java/org/openapijsonschematools/client/paths/petpetid/post/security/PetpetidPostSecurityRequirementObject0.java src/main/java/org/openapijsonschematools/client/paths/petpetid/post/security/PetpetidPostSecurityRequirementObject1.java -src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/Post.java +src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/PetpetiduploadimagePost.java src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/Parameters.java -src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/PathParameters.java +src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/PetpetiduploadimagePostPathParameters.java +src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/PetpetiduploadimagePostRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/PetpetiduploadimagePostResponses.java src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/PetpetiduploadimagePostSecurityInfo.java -src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/Responses.java src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/parameters/Parameter0.java src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/parameters/parameter0/Schema0.java src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/requestbody/content/multipartformdata/MultipartformdataSchema.java -src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/responses/PetpetiduploadimagePostCode200Response.java src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/security/PetpetiduploadimagePostSecurityRequirementObject0.java -src/main/java/org/openapijsonschematools/client/paths/solidus/Get.java -src/main/java/org/openapijsonschematools/client/paths/solidus/get/Responses.java -src/main/java/org/openapijsonschematools/client/paths/solidus/get/responses/Code200Response.java -src/main/java/org/openapijsonschematools/client/paths/storeinventory/Get.java -src/main/java/org/openapijsonschematools/client/paths/storeinventory/get/Responses.java +src/main/java/org/openapijsonschematools/client/paths/solidus/SolidusGet.java +src/main/java/org/openapijsonschematools/client/paths/solidus/get/SolidusGetResponses.java +src/main/java/org/openapijsonschematools/client/paths/solidus/get/responses/SolidusGetCode200Response.java +src/main/java/org/openapijsonschematools/client/paths/storeinventory/StoreinventoryGet.java +src/main/java/org/openapijsonschematools/client/paths/storeinventory/get/StoreinventoryGetResponses.java src/main/java/org/openapijsonschematools/client/paths/storeinventory/get/StoreinventoryGetSecurityInfo.java -src/main/java/org/openapijsonschematools/client/paths/storeinventory/get/responses/Code200Response.java +src/main/java/org/openapijsonschematools/client/paths/storeinventory/get/responses/StoreinventoryGetCode200Response.java src/main/java/org/openapijsonschematools/client/paths/storeinventory/get/security/StoreinventoryGetSecurityRequirementObject0.java -src/main/java/org/openapijsonschematools/client/paths/storeorder/Post.java -src/main/java/org/openapijsonschematools/client/paths/storeorder/post/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/storeorder/post/Responses.java +src/main/java/org/openapijsonschematools/client/paths/storeorder/StoreorderPost.java +src/main/java/org/openapijsonschematools/client/paths/storeorder/post/StoreorderPostRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/storeorder/post/StoreorderPostResponses.java src/main/java/org/openapijsonschematools/client/paths/storeorder/post/requestbody/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/Code200Response.java -src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/Code400Response.java +src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/StoreorderPostCode200Response.java +src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/StoreorderPostCode400Response.java src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/code200response/content/applicationxml/ApplicationxmlSchema.java -src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/Delete.java -src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/Get.java +src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/StoreorderorderidDelete.java +src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/StoreorderorderidGet.java src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/Parameters.java -src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/PathParameters.java -src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/Responses.java +src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/StoreorderorderidDeletePathParameters.java +src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/StoreorderorderidDeleteResponses.java src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/parameters/Parameter0.java src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/parameters/parameter0/Schema0.java -src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/responses/Code400Response.java -src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/responses/Code404Response.java +src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/responses/StoreorderorderidDeleteCode400Response.java +src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/responses/StoreorderorderidDeleteCode404Response.java src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/Parameters.java -src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/PathParameters.java -src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/Responses.java +src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/StoreorderorderidGetPathParameters.java +src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/StoreorderorderidGetResponses.java src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/parameters/Parameter0.java src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/parameters/parameter0/Schema0.java -src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/Code200Response.java -src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/Code400Response.java -src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/Code404Response.java +src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/StoreorderorderidGetCode200Response.java +src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/StoreorderorderidGetCode400Response.java +src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/StoreorderorderidGetCode404Response.java src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.java -src/main/java/org/openapijsonschematools/client/paths/user/Post.java -src/main/java/org/openapijsonschematools/client/paths/user/post/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/user/post/Responses.java +src/main/java/org/openapijsonschematools/client/paths/user/UserPost.java +src/main/java/org/openapijsonschematools/client/paths/user/post/UserPostRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/user/post/UserPostResponses.java src/main/java/org/openapijsonschematools/client/paths/user/post/requestbody/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/user/post/responses/CodedefaultResponse.java -src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/Post.java -src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/post/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/post/Responses.java -src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/post/responses/CodedefaultResponse.java -src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/Post.java -src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/post/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/post/Responses.java -src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/post/responses/CodedefaultResponse.java -src/main/java/org/openapijsonschematools/client/paths/userlogin/Get.java +src/main/java/org/openapijsonschematools/client/paths/user/post/responses/UserPostCodedefaultResponse.java +src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/UsercreatewitharrayPost.java +src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/post/UsercreatewitharrayPostRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/post/UsercreatewitharrayPostResponses.java +src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/post/responses/UsercreatewitharrayPostCodedefaultResponse.java +src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/UsercreatewithlistPost.java +src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/post/UsercreatewithlistPostRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/post/UsercreatewithlistPostResponses.java +src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/post/responses/UsercreatewithlistPostCodedefaultResponse.java +src/main/java/org/openapijsonschematools/client/paths/userlogin/UserloginGet.java src/main/java/org/openapijsonschematools/client/paths/userlogin/get/Parameters.java -src/main/java/org/openapijsonschematools/client/paths/userlogin/get/QueryParameters.java -src/main/java/org/openapijsonschematools/client/paths/userlogin/get/Responses.java +src/main/java/org/openapijsonschematools/client/paths/userlogin/get/UserloginGetQueryParameters.java +src/main/java/org/openapijsonschematools/client/paths/userlogin/get/UserloginGetResponses.java src/main/java/org/openapijsonschematools/client/paths/userlogin/get/parameters/Parameter0.java src/main/java/org/openapijsonschematools/client/paths/userlogin/get/parameters/Parameter1.java src/main/java/org/openapijsonschematools/client/paths/userlogin/get/parameters/parameter0/Schema0.java src/main/java/org/openapijsonschematools/client/paths/userlogin/get/parameters/parameter1/Schema1.java -src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/Code200Response.java -src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/Code400Response.java -src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/Code200ResponseHeadersSchema.java +src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/UserloginGetCode200Response.java +src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/UserloginGetCode400Response.java src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/Headers.java +src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/UserloginGetCode200ResponseHeadersSchema.java src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.java src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/headers/Int32.java @@ -1598,35 +1668,35 @@ src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/co src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/headers/XRateLimit.java src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/headers/xexpiresafter/XExpiresAfterSchema.java src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/headers/xratelimit/content/applicationjson/XRateLimitSchema.java -src/main/java/org/openapijsonschematools/client/paths/userlogout/Get.java -src/main/java/org/openapijsonschematools/client/paths/userlogout/get/Responses.java -src/main/java/org/openapijsonschematools/client/paths/userlogout/get/responses/CodedefaultResponse.java -src/main/java/org/openapijsonschematools/client/paths/userusername/Delete.java -src/main/java/org/openapijsonschematools/client/paths/userusername/Get.java -src/main/java/org/openapijsonschematools/client/paths/userusername/Put.java +src/main/java/org/openapijsonschematools/client/paths/userlogout/UserlogoutGet.java +src/main/java/org/openapijsonschematools/client/paths/userlogout/get/UserlogoutGetResponses.java +src/main/java/org/openapijsonschematools/client/paths/userlogout/get/responses/UserlogoutGetCodedefaultResponse.java +src/main/java/org/openapijsonschematools/client/paths/userusername/UserusernameDelete.java +src/main/java/org/openapijsonschematools/client/paths/userusername/UserusernameGet.java +src/main/java/org/openapijsonschematools/client/paths/userusername/UserusernamePut.java src/main/java/org/openapijsonschematools/client/paths/userusername/delete/Parameters.java -src/main/java/org/openapijsonschematools/client/paths/userusername/delete/PathParameters.java -src/main/java/org/openapijsonschematools/client/paths/userusername/delete/Responses.java +src/main/java/org/openapijsonschematools/client/paths/userusername/delete/UserusernameDeletePathParameters.java +src/main/java/org/openapijsonschematools/client/paths/userusername/delete/UserusernameDeleteResponses.java src/main/java/org/openapijsonschematools/client/paths/userusername/delete/parameters/Parameter0.java -src/main/java/org/openapijsonschematools/client/paths/userusername/delete/responses/Code200Response.java -src/main/java/org/openapijsonschematools/client/paths/userusername/delete/responses/Code404Response.java +src/main/java/org/openapijsonschematools/client/paths/userusername/delete/responses/UserusernameDeleteCode200Response.java +src/main/java/org/openapijsonschematools/client/paths/userusername/delete/responses/UserusernameDeleteCode404Response.java src/main/java/org/openapijsonschematools/client/paths/userusername/get/Parameters.java -src/main/java/org/openapijsonschematools/client/paths/userusername/get/PathParameters.java -src/main/java/org/openapijsonschematools/client/paths/userusername/get/Responses.java +src/main/java/org/openapijsonschematools/client/paths/userusername/get/UserusernameGetPathParameters.java +src/main/java/org/openapijsonschematools/client/paths/userusername/get/UserusernameGetResponses.java src/main/java/org/openapijsonschematools/client/paths/userusername/get/parameters/Parameter0.java -src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/Code200Response.java -src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/Code400Response.java -src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/Code404Response.java +src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/UserusernameGetCode200Response.java +src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/UserusernameGetCode400Response.java +src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/UserusernameGetCode404Response.java src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.java src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.java src/main/java/org/openapijsonschematools/client/paths/userusername/put/Parameters.java -src/main/java/org/openapijsonschematools/client/paths/userusername/put/PathParameters.java -src/main/java/org/openapijsonschematools/client/paths/userusername/put/RequestBody.java -src/main/java/org/openapijsonschematools/client/paths/userusername/put/Responses.java +src/main/java/org/openapijsonschematools/client/paths/userusername/put/UserusernamePutPathParameters.java +src/main/java/org/openapijsonschematools/client/paths/userusername/put/UserusernamePutRequestBody.java +src/main/java/org/openapijsonschematools/client/paths/userusername/put/UserusernamePutResponses.java src/main/java/org/openapijsonschematools/client/paths/userusername/put/parameters/Parameter0.java src/main/java/org/openapijsonschematools/client/paths/userusername/put/requestbody/content/applicationjson/ApplicationjsonSchema.java -src/main/java/org/openapijsonschematools/client/paths/userusername/put/responses/Code400Response.java -src/main/java/org/openapijsonschematools/client/paths/userusername/put/responses/Code404Response.java +src/main/java/org/openapijsonschematools/client/paths/userusername/put/responses/UserusernamePutCode400Response.java +src/main/java/org/openapijsonschematools/client/paths/userusername/put/responses/UserusernamePutCode404Response.java src/main/java/org/openapijsonschematools/client/requestbody/GenericRequestBody.java src/main/java/org/openapijsonschematools/client/requestbody/RequestBodySerializer.java src/main/java/org/openapijsonschematools/client/requestbody/SerializedRequestBody.java diff --git a/samples/client/petstore/java/README.md b/samples/client/petstore/java/README.md index 74b5c37447f..dd39c08745e 100644 --- a/samples/client/petstore/java/README.md +++ b/samples/client/petstore/java/README.md @@ -65,8 +65,8 @@ Here is the mapping from json schema types to Java types: | Json Schema Type | Java Base Class | | ---------------- | --------------- | -| object | FrozenMap (HashMap) | -| array | FrozenList (ArrayList) | +| object | FrozenMap (Map) | +| array | FrozenList (List) | | string | String | | number | Number (int, long, float, double) | | integer | int, long, float, double (with values equal to integers) | @@ -102,7 +102,7 @@ invalid Java variable names. Names like: - " " - "from" -To allow these use cases to work, FrozenMap (which extends HashMap) is used as the base class of type object schemas. +To allow these use cases to work, FrozenMap (which extends AbstractMap) is used as the base class of type object schemas. This means that one can use normal Map methods on instances of these classes.
@@ -118,8 +118,6 @@ This means that one can use normal Map methods on instances of these classes. N schemas can be validated on the same payload. To allow multiple schemas to validate, the data must be stored using one base class whether or not a json schema format constraint exists in the schema. -See the below accessors for string data: -- type string + format: See schemas.as_date, schemas.as_datetime, schemas.as_decimal, schemas.as_uuid In json schema, type: number with no format validates both integers and floats, so int and float values are stored for type number. @@ -137,7 +135,7 @@ For example the string payload '2023-12-20' is validates to both of these schema - type: string format: date ``` -Because of use cases like this, a datetime.date is allowed as an input to this schema, but the data +Because of use cases like this, a LocalDate is allowed as an input to this schema, but the data is stored as a string.
@@ -148,6 +146,73 @@ org.openapijsonschematools.client.components.schemas to validate input payloads output classes. Json schemas allow multiple types for one schema, so a schema's validate method can have allowed input and output types. +## Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.solidus.get.responses.SolidusGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.solidus.get.SolidusGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new SolidusGet.GetRequestBuilder().build(); + +SolidusGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +SolidusGetResponses.EndpointSolidusGetCode200Response castResponse = (SolidusGetResponses.EndpointSolidusGetCode200Response) response; +``` ## Servers | server_index | Class | Description | | ------------ | ----- | ----------- | @@ -155,8 +220,94 @@ allowed input and output types. | 1 | [Server1](docs/servers/Server1.md) | The local server | | 2 | [Server2](docs/servers/Server2.md) | staging server with no variables | -## Component Schemas +## Component SecuritySchemes +| Class | Description | +| ----- | ----------- | +| [ApiKey](docs/components/securityschemes/ApiKey.md) | apiKey in header | +| [ApiKeyQuery](docs/components/securityschemes/ApiKeyQuery.md) | apiKey in query | +| [BearerTest](docs/components/securityschemes/BearerTest.md) | http bearer with JWT bearer format | +| [HttpBasicTest](docs/components/securityschemes/HttpBasicTest.md) | http basic | +| [HttpSignatureTest](docs/components/securityschemes/HttpSignatureTest.md) | http + signature | +| [OpenIdConnectTest](docs/components/securityschemes/OpenIdConnectTest.md) | openIdConnect | +| [PetstoreAuth](docs/components/securityschemes/PetstoreAuth.md) | oauth2 implicit flow with two scopes | + +## Endpoints +All URIs are relative to the selected server +- The server is selected by passing in serverInfo + serverIndexInfo into configurations.ApiConfiguration +- The security info is selected by passing in securityInfo + securityIndexInfo into configurations.ApiConfiguration +- serverIndex + securityIndex can also be passed in to endpoint calls, see endpoint documentation + +| HTTP request | Methods | Description | +| ------------ | ------- | ----------- | +| / **get** | [Fake.slashRoute](docs/apis/tags/Fake.md#slashroute) [Solidus.get](docs/paths/Solidus.md#get) [SolidusGet.Get.get](docs/paths/solidus/SolidusGet.md#get) | slash route | +| /another-fake/dummy **patch** | [Anotherfake.model123TestSpecialTags](docs/apis/tags/Anotherfake.md#model123testspecialtags) [Anotherfakedummy.patch](docs/paths/Anotherfakedummy.md#patch) [AnotherfakedummyPatch.Patch.patch](docs/paths/anotherfakedummy/AnotherfakedummyPatch.md#patch) | To test special tags | +| /commonParam/{subDir}/ **delete** | [Fake.deleteCommonParam](docs/apis/tags/Fake.md#deletecommonparam) [Commonparamsubdir.delete](docs/paths/Commonparamsubdir.md#delete) [CommonparamsubdirDelete.Delete.delete](docs/paths/commonparamsubdir/CommonparamsubdirDelete.md#delete) | | +| /commonParam/{subDir}/ **get** | [Fake.getCommonParam](docs/apis/tags/Fake.md#getcommonparam) [Commonparamsubdir.get](docs/paths/Commonparamsubdir.md#get) [CommonparamsubdirGet.Get.get](docs/paths/commonparamsubdir/CommonparamsubdirGet.md#get) | | +| /commonParam/{subDir}/ **post** | [Fake.postCommonParam](docs/apis/tags/Fake.md#postcommonparam) [Commonparamsubdir.post](docs/paths/Commonparamsubdir.md#post) [CommonparamsubdirPost.Post.post](docs/paths/commonparamsubdir/CommonparamsubdirPost.md#post) | | +| /fake **delete** | [Fake.groupParameters](docs/apis/tags/Fake.md#groupparameters) [Fake.delete](docs/paths/Fake.md#delete) [FakeDelete.Delete.delete](docs/paths/fake/FakeDelete.md#delete) | Fake endpoint to test group parameters (optional) | +| /fake **get** | [Fake.enumParameters](docs/apis/tags/Fake.md#enumparameters) [Fake.get](docs/paths/Fake.md#get) [FakeGet.Get.get](docs/paths/fake/FakeGet.md#get) | To test enum parameters | +| /fake **patch** | [Fake.clientModel](docs/apis/tags/Fake.md#clientmodel) [Fake.patch](docs/paths/Fake.md#patch) [FakePatch.Patch.patch](docs/paths/fake/FakePatch.md#patch) | To test "client" model | +| /fake **post** | [Fake.endpointParameters](docs/apis/tags/Fake.md#endpointparameters) [Fake.post](docs/paths/Fake.md#post) [FakePost.Post.post](docs/paths/fake/FakePost.md#post) | Fake endpoint for testing various parameters
假端點
偽のエンドポイント
가짜 엔드 포인트
| +| /fake/additional-properties-with-array-of-enums **get** | [Fake.additionalPropertiesWithArrayOfEnums](docs/apis/tags/Fake.md#additionalpropertieswitharrayofenums) [Fakeadditionalpropertieswitharrayofenums.get](docs/paths/Fakeadditionalpropertieswitharrayofenums.md#get) [FakeadditionalpropertieswitharrayofenumsGet.Get.get](docs/paths/fakeadditionalpropertieswitharrayofenums/FakeadditionalpropertieswitharrayofenumsGet.md#get) | Additional Properties with Array of Enums | +| /fake/body-with-file-schema **put** | [Fake.bodyWithFileSchema](docs/apis/tags/Fake.md#bodywithfileschema) [Fakebodywithfileschema.put](docs/paths/Fakebodywithfileschema.md#put) [FakebodywithfileschemaPut.Put.put](docs/paths/fakebodywithfileschema/FakebodywithfileschemaPut.md#put) | | +| /fake/body-with-query-params **put** | [Fake.bodyWithQueryParams](docs/apis/tags/Fake.md#bodywithqueryparams) [Fakebodywithqueryparams.put](docs/paths/Fakebodywithqueryparams.md#put) [FakebodywithqueryparamsPut.Put.put](docs/paths/fakebodywithqueryparams/FakebodywithqueryparamsPut.md#put) | | +| /fake/case-sensitive-params **put** | [Fake.caseSensitiveParams](docs/apis/tags/Fake.md#casesensitiveparams) [Fakecasesensitiveparams.put](docs/paths/Fakecasesensitiveparams.md#put) [FakecasesensitiveparamsPut.Put.put](docs/paths/fakecasesensitiveparams/FakecasesensitiveparamsPut.md#put) | | +| /fake/deleteCoffee/{id} **delete** | [Fake.deleteCoffee](docs/apis/tags/Fake.md#deletecoffee) [Fakedeletecoffeeid.delete](docs/paths/Fakedeletecoffeeid.md#delete) [FakedeletecoffeeidDelete.Delete.delete](docs/paths/fakedeletecoffeeid/FakedeletecoffeeidDelete.md#delete) | Delete coffee | +| /fake/health **get** | [Fake.fakeHealthGet](docs/apis/tags/Fake.md#fakehealthget) [Fakehealth.get](docs/paths/Fakehealth.md#get) [FakehealthGet.Get.get](docs/paths/fakehealth/FakehealthGet.md#get) | Health check endpoint | +| /fake/inline-additionalProperties **post** | [Fake.inlineAdditionalProperties](docs/apis/tags/Fake.md#inlineadditionalproperties) [Fakeinlineadditionalproperties.post](docs/paths/Fakeinlineadditionalproperties.md#post) [FakeinlineadditionalpropertiesPost.Post.post](docs/paths/fakeinlineadditionalproperties/FakeinlineadditionalpropertiesPost.md#post) | test inline additionalProperties | +| /fake/inlineComposition/ **post** | [Fake.inlineComposition](docs/apis/tags/Fake.md#inlinecomposition) [Fakeinlinecomposition.post](docs/paths/Fakeinlinecomposition.md#post) [FakeinlinecompositionPost.Post.post](docs/paths/fakeinlinecomposition/FakeinlinecompositionPost.md#post) | testing composed schemas at inline locations | +| /fake/jsonFormData **get** | [Fake.jsonFormData](docs/apis/tags/Fake.md#jsonformdata) [Fakejsonformdata.get](docs/paths/Fakejsonformdata.md#get) [FakejsonformdataGet.Get.get](docs/paths/fakejsonformdata/FakejsonformdataGet.md#get) | test json serialization of form data | +| /fake/jsonPatch **patch** | [Fake.jsonPatch](docs/apis/tags/Fake.md#jsonpatch) [Fakejsonpatch.patch](docs/paths/Fakejsonpatch.md#patch) [FakejsonpatchPatch.Patch.patch](docs/paths/fakejsonpatch/FakejsonpatchPatch.md#patch) | json patch | +| /fake/jsonWithCharset **post** | [Fake.jsonWithCharset](docs/apis/tags/Fake.md#jsonwithcharset) [Fakejsonwithcharset.post](docs/paths/Fakejsonwithcharset.md#post) [FakejsonwithcharsetPost.Post.post](docs/paths/fakejsonwithcharset/FakejsonwithcharsetPost.md#post) | json with charset tx and rx | +| /fake/multipleRequestBodyContentTypes/ **post** | [Fake.multipleRequestBodyContentTypes](docs/apis/tags/Fake.md#multiplerequestbodycontenttypes) [Fakemultiplerequestbodycontenttypes.post](docs/paths/Fakemultiplerequestbodycontenttypes.md#post) [FakemultiplerequestbodycontenttypesPost.Post.post](docs/paths/fakemultiplerequestbodycontenttypes/FakemultiplerequestbodycontenttypesPost.md#post) | testing composed schemas at inline locations | +| /fake/multipleResponseBodies **get** | [Fake.multipleResponseBodies](docs/apis/tags/Fake.md#multipleresponsebodies) [Fakemultipleresponsebodies.get](docs/paths/Fakemultipleresponsebodies.md#get) [FakemultipleresponsebodiesGet.Get.get](docs/paths/fakemultipleresponsebodies/FakemultipleresponsebodiesGet.md#get) | multiple responses have response bodies | +| /fake/multipleSecurities **get** | [Fake.multipleSecurities](docs/apis/tags/Fake.md#multiplesecurities) [Fakemultiplesecurities.get](docs/paths/Fakemultiplesecurities.md#get) [FakemultiplesecuritiesGet.Get.get](docs/paths/fakemultiplesecurities/FakemultiplesecuritiesGet.md#get) | multiple security requirements | +| /fake/objInQuery **get** | [Fake.objectInQuery](docs/apis/tags/Fake.md#objectinquery) [Fakeobjinquery.get](docs/paths/Fakeobjinquery.md#get) [FakeobjinqueryGet.Get.get](docs/paths/fakeobjinquery/FakeobjinqueryGet.md#get) | user list | +| /fake/parameterCollisions/{1}/{aB}/{Ab}/{self}/{A-B}/ **post** | [Fake.parameterCollisions](docs/apis/tags/Fake.md#parametercollisions) [Fakeparametercollisions1ababselfab.post](docs/paths/Fakeparametercollisions1ababselfab.md#post) [Fakeparametercollisions1ababselfabPost.Post.post](docs/paths/fakeparametercollisions1ababselfab/Fakeparametercollisions1ababselfabPost.md#post) | parameter collision case | +| /fake/pemContentType **get** | [Fake.pemContentType](docs/apis/tags/Fake.md#pemcontenttype) [Fakepemcontenttype.get](docs/paths/Fakepemcontenttype.md#get) [FakepemcontenttypeGet.Get.get](docs/paths/fakepemcontenttype/FakepemcontenttypeGet.md#get) | route with tx and rx pem content type | +| /fake/queryParamWithJsonContentType **get** | [Fake.queryParamWithJsonContentType](docs/apis/tags/Fake.md#queryparamwithjsoncontenttype) [Fakequeryparamwithjsoncontenttype.get](docs/paths/Fakequeryparamwithjsoncontenttype.md#get) [FakequeryparamwithjsoncontenttypeGet.Get.get](docs/paths/fakequeryparamwithjsoncontenttype/FakequeryparamwithjsoncontenttypeGet.md#get) | query param with json content-type | +| /fake/redirection **get** | [Fake.redirection](docs/apis/tags/Fake.md#redirection) [Fakeredirection.get](docs/paths/Fakeredirection.md#get) [FakeredirectionGet.Get.get](docs/paths/fakeredirection/FakeredirectionGet.md#get) | operation with redirection responses | +| /fake/refObjInQuery **get** | [Fake.refObjectInQuery](docs/apis/tags/Fake.md#refobjectinquery) [Fakerefobjinquery.get](docs/paths/Fakerefobjinquery.md#get) [FakerefobjinqueryGet.Get.get](docs/paths/fakerefobjinquery/FakerefobjinqueryGet.md#get) | user list | +| /fake/refs/array-of-enums **post** | [Fake.arrayOfEnums](docs/apis/tags/Fake.md#arrayofenums) [Fakerefsarrayofenums.post](docs/paths/Fakerefsarrayofenums.md#post) [FakerefsarrayofenumsPost.Post.post](docs/paths/fakerefsarrayofenums/FakerefsarrayofenumsPost.md#post) | Array of Enums | +| /fake/refs/arraymodel **post** | [Fake.arrayModel](docs/apis/tags/Fake.md#arraymodel) [Fakerefsarraymodel.post](docs/paths/Fakerefsarraymodel.md#post) [FakerefsarraymodelPost.Post.post](docs/paths/fakerefsarraymodel/FakerefsarraymodelPost.md#post) | | +| /fake/refs/boolean **post** | [Fake.modelBoolean](docs/apis/tags/Fake.md#modelboolean) [Fakerefsboolean.post](docs/paths/Fakerefsboolean.md#post) [FakerefsbooleanPost.Post.post](docs/paths/fakerefsboolean/FakerefsbooleanPost.md#post) | | +| /fake/refs/composed_one_of_number_with_validations **post** | [Fake.composedOneOfDifferentTypes](docs/apis/tags/Fake.md#composedoneofdifferenttypes) [Fakerefscomposedoneofnumberwithvalidations.post](docs/paths/Fakerefscomposedoneofnumberwithvalidations.md#post) [FakerefscomposedoneofnumberwithvalidationsPost.Post.post](docs/paths/fakerefscomposedoneofnumberwithvalidations/FakerefscomposedoneofnumberwithvalidationsPost.md#post) | | +| /fake/refs/enum **post** | [Fake.stringEnum](docs/apis/tags/Fake.md#stringenum) [Fakerefsenum.post](docs/paths/Fakerefsenum.md#post) [FakerefsenumPost.Post.post](docs/paths/fakerefsenum/FakerefsenumPost.md#post) | | +| /fake/refs/mammal **post** | [Fake.mammal](docs/apis/tags/Fake.md#mammal) [Fakerefsmammal.post](docs/paths/Fakerefsmammal.md#post) [FakerefsmammalPost.Post.post](docs/paths/fakerefsmammal/FakerefsmammalPost.md#post) | | +| /fake/refs/number **post** | [Fake.numberWithValidations](docs/apis/tags/Fake.md#numberwithvalidations) [Fakerefsnumber.post](docs/paths/Fakerefsnumber.md#post) [FakerefsnumberPost.Post.post](docs/paths/fakerefsnumber/FakerefsnumberPost.md#post) | | +| /fake/refs/object_model_with_ref_props **post** | [Fake.objectModelWithRefProps](docs/apis/tags/Fake.md#objectmodelwithrefprops) [Fakerefsobjectmodelwithrefprops.post](docs/paths/Fakerefsobjectmodelwithrefprops.md#post) [FakerefsobjectmodelwithrefpropsPost.Post.post](docs/paths/fakerefsobjectmodelwithrefprops/FakerefsobjectmodelwithrefpropsPost.md#post) | | +| /fake/refs/string **post** | [Fake.modelString](docs/apis/tags/Fake.md#modelstring) [Fakerefsstring.post](docs/paths/Fakerefsstring.md#post) [FakerefsstringPost.Post.post](docs/paths/fakerefsstring/FakerefsstringPost.md#post) | | +| /fake/responseWithoutSchema **get** | [Fake.responseWithoutSchema](docs/apis/tags/Fake.md#responsewithoutschema) [Fakeresponsewithoutschema.get](docs/paths/Fakeresponsewithoutschema.md#get) [FakeresponsewithoutschemaGet.Get.get](docs/paths/fakeresponsewithoutschema/FakeresponsewithoutschemaGet.md#get) | receives a response without schema | +| /fake/test-query-paramters **put** | [Fake.queryParameterCollectionFormat](docs/apis/tags/Fake.md#queryparametercollectionformat) [Faketestqueryparamters.put](docs/paths/Faketestqueryparamters.md#put) [FaketestqueryparamtersPut.Put.put](docs/paths/faketestqueryparamters/FaketestqueryparamtersPut.md#put) | | +| /fake/uploadDownloadFile **post** | [Fake.uploadDownloadFile](docs/apis/tags/Fake.md#uploaddownloadfile) [Fakeuploaddownloadfile.post](docs/paths/Fakeuploaddownloadfile.md#post) [FakeuploaddownloadfilePost.Post.post](docs/paths/fakeuploaddownloadfile/FakeuploaddownloadfilePost.md#post) | uploads a file and downloads a file using application/octet-stream | +| /fake/uploadFile **post** | [Fake.uploadFile](docs/apis/tags/Fake.md#uploadfile) [Fakeuploadfile.post](docs/paths/Fakeuploadfile.md#post) [FakeuploadfilePost.Post.post](docs/paths/fakeuploadfile/FakeuploadfilePost.md#post) | uploads a file using multipart/form-data | +| /fake/uploadFiles **post** | [Fake.uploadFiles](docs/apis/tags/Fake.md#uploadfiles) [Fakeuploadfiles.post](docs/paths/Fakeuploadfiles.md#post) [FakeuploadfilesPost.Post.post](docs/paths/fakeuploadfiles/FakeuploadfilesPost.md#post) | uploads files using multipart/form-data | +| /fake/wildCardResponses **get** | [Fake.wildCardResponses](docs/apis/tags/Fake.md#wildcardresponses) [Fakewildcardresponses.get](docs/paths/Fakewildcardresponses.md#get) [FakewildcardresponsesGet.Get.get](docs/paths/fakewildcardresponses/FakewildcardresponsesGet.md#get) | operation with wildcard responses | +| /fake/{petId}/uploadImageWithRequiredFile **post** | [Pet.uploadFileWithRequiredFile](docs/apis/tags/Pet.md#uploadfilewithrequiredfile) [Fakepetiduploadimagewithrequiredfile.post](docs/paths/Fakepetiduploadimagewithrequiredfile.md#post) [FakepetiduploadimagewithrequiredfilePost.Post.post](docs/paths/fakepetiduploadimagewithrequiredfile/FakepetiduploadimagewithrequiredfilePost.md#post) | uploads an image (required) | +| /fake_classname_test **patch** | [Fakeclassnametags123.classname](docs/apis/tags/Fakeclassnametags123.md#classname) [Fakeclassnametest.patch](docs/paths/Fakeclassnametest.md#patch) [FakeclassnametestPatch.Patch.patch](docs/paths/fakeclassnametest/FakeclassnametestPatch.md#patch) | To test class name in snake case | +| /foo **get** | [Default.fooGet](docs/apis/tags/Default.md#fooget) [Foo.get](docs/paths/Foo.md#get) [FooGet.Get.get](docs/paths/foo/FooGet.md#get) | | +| /pet **post** | [Pet.addPet](docs/apis/tags/Pet.md#addpet) [Pet.post](docs/paths/Pet.md#post) [PetPost.Post.post](docs/paths/pet/PetPost.md#post) | Add a new pet to the store | +| /pet **put** | [Pet.updatePet](docs/apis/tags/Pet.md#updatepet) [Pet.put](docs/paths/Pet.md#put) [PetPut.Put.put](docs/paths/pet/PetPut.md#put) | Update an existing pet | +| /pet/findByStatus **get** | [Pet.findPetsByStatus](docs/apis/tags/Pet.md#findpetsbystatus) [Petfindbystatus.get](docs/paths/Petfindbystatus.md#get) [PetfindbystatusGet.Get.get](docs/paths/petfindbystatus/PetfindbystatusGet.md#get) | Finds Pets by status | +| /pet/findByTags **get** | [Pet.findPetsByTags](docs/apis/tags/Pet.md#findpetsbytags) [Petfindbytags.get](docs/paths/Petfindbytags.md#get) [PetfindbytagsGet.Get.get](docs/paths/petfindbytags/PetfindbytagsGet.md#get) | Finds Pets by tags | +| /pet/{petId} **delete** | [Pet.deletePet](docs/apis/tags/Pet.md#deletepet) [Petpetid.delete](docs/paths/Petpetid.md#delete) [PetpetidDelete.Delete.delete](docs/paths/petpetid/PetpetidDelete.md#delete) | Deletes a pet | +| /pet/{petId} **get** | [Pet.getPetById](docs/apis/tags/Pet.md#getpetbyid) [Petpetid.get](docs/paths/Petpetid.md#get) [PetpetidGet.Get.get](docs/paths/petpetid/PetpetidGet.md#get) | Find pet by ID | +| /pet/{petId} **post** | [Pet.updatePetWithForm](docs/apis/tags/Pet.md#updatepetwithform) [Petpetid.post](docs/paths/Petpetid.md#post) [PetpetidPost.Post.post](docs/paths/petpetid/PetpetidPost.md#post) | Updates a pet in the store with form data | +| /pet/{petId}/uploadImage **post** | [Pet.uploadImage](docs/apis/tags/Pet.md#uploadimage) [Petpetiduploadimage.post](docs/paths/Petpetiduploadimage.md#post) [PetpetiduploadimagePost.Post.post](docs/paths/petpetiduploadimage/PetpetiduploadimagePost.md#post) | uploads an image | +| /store/inventory **get** | [Store.getInventory](docs/apis/tags/Store.md#getinventory) [Storeinventory.get](docs/paths/Storeinventory.md#get) [StoreinventoryGet.Get.get](docs/paths/storeinventory/StoreinventoryGet.md#get) | Returns pet inventories by status | +| /store/order **post** | [Store.placeOrder](docs/apis/tags/Store.md#placeorder) [Storeorder.post](docs/paths/Storeorder.md#post) [StoreorderPost.Post.post](docs/paths/storeorder/StoreorderPost.md#post) | Place an order for a pet | +| /store/order/{order_id} **delete** | [Store.deleteOrder](docs/apis/tags/Store.md#deleteorder) [Storeorderorderid.delete](docs/paths/Storeorderorderid.md#delete) [StoreorderorderidDelete.Delete.delete](docs/paths/storeorderorderid/StoreorderorderidDelete.md#delete) | Delete purchase order by ID | +| /store/order/{order_id} **get** | [Store.getOrderById](docs/apis/tags/Store.md#getorderbyid) [Storeorderorderid.get](docs/paths/Storeorderorderid.md#get) [StoreorderorderidGet.Get.get](docs/paths/storeorderorderid/StoreorderorderidGet.md#get) | Find purchase order by ID | +| /user **post** | [User.createUser](docs/apis/tags/User.md#createuser) [User.post](docs/paths/User.md#post) [UserPost.Post.post](docs/paths/user/UserPost.md#post) | Create user | +| /user/createWithArray **post** | [User.createUsersWithArrayInput](docs/apis/tags/User.md#createuserswitharrayinput) [Usercreatewitharray.post](docs/paths/Usercreatewitharray.md#post) [UsercreatewitharrayPost.Post.post](docs/paths/usercreatewitharray/UsercreatewitharrayPost.md#post) | Creates list of users with given input array | +| /user/createWithList **post** | [User.createUsersWithListInput](docs/apis/tags/User.md#createuserswithlistinput) [Usercreatewithlist.post](docs/paths/Usercreatewithlist.md#post) [UsercreatewithlistPost.Post.post](docs/paths/usercreatewithlist/UsercreatewithlistPost.md#post) | Creates list of users with given input array | +| /user/login **get** | [User.loginUser](docs/apis/tags/User.md#loginuser) [Userlogin.get](docs/paths/Userlogin.md#get) [UserloginGet.Get.get](docs/paths/userlogin/UserloginGet.md#get) | Logs user into the system | +| /user/logout **get** | [User.logoutUser](docs/apis/tags/User.md#logoutuser) [Userlogout.get](docs/paths/Userlogout.md#get) [UserlogoutGet.Get.get](docs/paths/userlogout/UserlogoutGet.md#get) | Logs out current logged in user session | +| /user/{username} **delete** | [User.deleteUser](docs/apis/tags/User.md#deleteuser) [Userusername.delete](docs/paths/Userusername.md#delete) [UserusernameDelete.Delete.delete](docs/paths/userusername/UserusernameDelete.md#delete) | Delete user | +| /user/{username} **get** | [User.getUserByName](docs/apis/tags/User.md#getuserbyname) [Userusername.get](docs/paths/Userusername.md#get) [UserusernameGet.Get.get](docs/paths/userusername/UserusernameGet.md#get) | Get user by user name | +| /user/{username} **put** | [User.updateUser](docs/apis/tags/User.md#updateuser) [Userusername.put](docs/paths/Userusername.md#put) [UserusernamePut.Put.put](docs/paths/userusername/UserusernamePut.md#put) | Updated user | +## Component Schemas | Class | Description | | ----- | ----------- | | [Schema200Response.Schema200Response1](docs/components/schemas/Schema200Response.md#schema200response1) | model with an invalid class name for python, starts with a number | @@ -301,86 +452,7 @@ allowed input and output types. | [Whale.Whale1](docs/components/schemas/Whale.md#whale1) | | | [Zebra.Zebra1](docs/components/schemas/Zebra.md#zebra1) | | -## Endpoints - -All URIs are relative to the selected server -- The server is selected by passing in serverInfo into configurations.ApiConfiguration -- The security info is selected by passing in securityInfo into configurations.ApiConfiguration -- TODO Code samples in endpoints documents show how to do this -- serverIndex + securityIndex can also be passed in to endpoint calls, see endpoint documentation - -| HTTP request | Method | Description | -| ------------ | ------ | ----------- | -| / **get** | [Get1.get](docs/paths/solidus/Get.md#get1) | slash route | -| /another-fake/dummy **patch** | [Patch1.patch](docs/paths/anotherfakedummy/Patch.md#patch1) | To test special tags | -| /commonParam/{subDir}/ **delete** | [Delete1.delete](docs/paths/commonparamsubdir/Delete.md#delete1) | | -| /commonParam/{subDir}/ **get** | [Get1.get](docs/paths/commonparamsubdir/Get.md#get1) | | -| /commonParam/{subDir}/ **post** | [Post1.post](docs/paths/commonparamsubdir/Post.md#post1) | | -| /fake **delete** | [Delete1.delete](docs/paths/fake/Delete.md#delete1) | Fake endpoint to test group parameters (optional) | -| /fake **get** | [Get1.get](docs/paths/fake/Get.md#get1) | To test enum parameters | -| /fake **patch** | [Patch1.patch](docs/paths/fake/Patch.md#patch1) | To test "client" model | -| /fake **post** | [Post1.post](docs/paths/fake/Post.md#post1) | Fake endpoint for testing various parameters
假端點
偽のエンドポイント
가짜 엔드 포인트
| -| /fake/additional-properties-with-array-of-enums **get** | [Get1.get](docs/paths/fakeadditionalpropertieswitharrayofenums/Get.md#get1) | Additional Properties with Array of Enums | -| /fake/body-with-file-schema **put** | [Put1.put](docs/paths/fakebodywithfileschema/Put.md#put1) | | -| /fake/body-with-query-params **put** | [Put1.put](docs/paths/fakebodywithqueryparams/Put.md#put1) | | -| /fake/case-sensitive-params **put** | [Put1.put](docs/paths/fakecasesensitiveparams/Put.md#put1) | | -| /fake/deleteCoffee/{id} **delete** | [Delete1.delete](docs/paths/fakedeletecoffeeid/Delete.md#delete1) | Delete coffee | -| /fake/health **get** | [Get1.get](docs/paths/fakehealth/Get.md#get1) | Health check endpoint | -| /fake/inline-additionalProperties **post** | [Post1.post](docs/paths/fakeinlineadditionalproperties/Post.md#post1) | test inline additionalProperties | -| /fake/inlineComposition/ **post** | [Post1.post](docs/paths/fakeinlinecomposition/Post.md#post1) | testing composed schemas at inline locations | -| /fake/jsonFormData **get** | [Get1.get](docs/paths/fakejsonformdata/Get.md#get1) | test json serialization of form data | -| /fake/jsonPatch **patch** | [Patch1.patch](docs/paths/fakejsonpatch/Patch.md#patch1) | json patch | -| /fake/jsonWithCharset **post** | [Post1.post](docs/paths/fakejsonwithcharset/Post.md#post1) | json with charset tx and rx | -| /fake/multipleRequestBodyContentTypes/ **post** | [Post1.post](docs/paths/fakemultiplerequestbodycontenttypes/Post.md#post1) | testing composed schemas at inline locations | -| /fake/multipleResponseBodies **get** | [Get1.get](docs/paths/fakemultipleresponsebodies/Get.md#get1) | multiple responses have response bodies | -| /fake/multipleSecurities **get** | [Get1.get](docs/paths/fakemultiplesecurities/Get.md#get1) | multiple security requirements | -| /fake/objInQuery **get** | [Get1.get](docs/paths/fakeobjinquery/Get.md#get1) | user list | -| /fake/parameterCollisions/{1}/{aB}/{Ab}/{self}/{A-B}/ **post** | [Post1.post](docs/paths/fakeparametercollisions1ababselfab/Post.md#post1) | parameter collision case | -| /fake/pemContentType **get** | [Get1.get](docs/paths/fakepemcontenttype/Get.md#get1) | route with tx and rx pem content type | -| /fake/queryParamWithJsonContentType **get** | [Get1.get](docs/paths/fakequeryparamwithjsoncontenttype/Get.md#get1) | query param with json content-type | -| /fake/redirection **get** | [Get1.get](docs/paths/fakeredirection/Get.md#get1) | operation with redirection responses | -| /fake/refObjInQuery **get** | [Get1.get](docs/paths/fakerefobjinquery/Get.md#get1) | user list | -| /fake/refs/array-of-enums **post** | [Post1.post](docs/paths/fakerefsarrayofenums/Post.md#post1) | Array of Enums | -| /fake/refs/arraymodel **post** | [Post1.post](docs/paths/fakerefsarraymodel/Post.md#post1) | | -| /fake/refs/boolean **post** | [Post1.post](docs/paths/fakerefsboolean/Post.md#post1) | | -| /fake/refs/composed_one_of_number_with_validations **post** | [Post1.post](docs/paths/fakerefscomposedoneofnumberwithvalidations/Post.md#post1) | | -| /fake/refs/enum **post** | [Post1.post](docs/paths/fakerefsenum/Post.md#post1) | | -| /fake/refs/mammal **post** | [Post1.post](docs/paths/fakerefsmammal/Post.md#post1) | | -| /fake/refs/number **post** | [Post1.post](docs/paths/fakerefsnumber/Post.md#post1) | | -| /fake/refs/object_model_with_ref_props **post** | [Post1.post](docs/paths/fakerefsobjectmodelwithrefprops/Post.md#post1) | | -| /fake/refs/string **post** | [Post1.post](docs/paths/fakerefsstring/Post.md#post1) | | -| /fake/responseWithoutSchema **get** | [Get1.get](docs/paths/fakeresponsewithoutschema/Get.md#get1) | receives a response without schema | -| /fake/test-query-paramters **put** | [Put1.put](docs/paths/faketestqueryparamters/Put.md#put1) | | -| /fake/uploadDownloadFile **post** | [Post1.post](docs/paths/fakeuploaddownloadfile/Post.md#post1) | uploads a file and downloads a file using application/octet-stream | -| /fake/uploadFile **post** | [Post1.post](docs/paths/fakeuploadfile/Post.md#post1) | uploads a file using multipart/form-data | -| /fake/uploadFiles **post** | [Post1.post](docs/paths/fakeuploadfiles/Post.md#post1) | uploads files using multipart/form-data | -| /fake/wildCardResponses **get** | [Get1.get](docs/paths/fakewildcardresponses/Get.md#get1) | operation with wildcard responses | -| /fake/{petId}/uploadImageWithRequiredFile **post** | [Post1.post](docs/paths/fakepetiduploadimagewithrequiredfile/Post.md#post1) | uploads an image (required) | -| /fake_classname_test **patch** | [Patch1.patch](docs/paths/fakeclassnametest/Patch.md#patch1) | To test class name in snake case | -| /foo **get** | [Get1.get](docs/paths/foo/Get.md#get1) | | -| /pet **post** | [Post1.post](docs/paths/pet/Post.md#post1) | Add a new pet to the store | -| /pet **put** | [Put1.put](docs/paths/pet/Put.md#put1) | Update an existing pet | -| /pet/findByStatus **get** | [Get1.get](docs/paths/petfindbystatus/Get.md#get1) | Finds Pets by status | -| /pet/findByTags **get** | [Get1.get](docs/paths/petfindbytags/Get.md#get1) | Finds Pets by tags | -| /pet/{petId} **delete** | [Delete1.delete](docs/paths/petpetid/Delete.md#delete1) | Deletes a pet | -| /pet/{petId} **get** | [Get1.get](docs/paths/petpetid/Get.md#get1) | Find pet by ID | -| /pet/{petId} **post** | [Post1.post](docs/paths/petpetid/Post.md#post1) | Updates a pet in the store with form data | -| /pet/{petId}/uploadImage **post** | [Post1.post](docs/paths/petpetiduploadimage/Post.md#post1) | uploads an image | -| /store/inventory **get** | [Get1.get](docs/paths/storeinventory/Get.md#get1) | Returns pet inventories by status | -| /store/order **post** | [Post1.post](docs/paths/storeorder/Post.md#post1) | Place an order for a pet | -| /store/order/{order_id} **delete** | [Delete1.delete](docs/paths/storeorderorderid/Delete.md#delete1) | Delete purchase order by ID | -| /store/order/{order_id} **get** | [Get1.get](docs/paths/storeorderorderid/Get.md#get1) | Find purchase order by ID | -| /user **post** | [Post1.post](docs/paths/user/Post.md#post1) | Create user | -| /user/createWithArray **post** | [Post1.post](docs/paths/usercreatewitharray/Post.md#post1) | Creates list of users with given input array | -| /user/createWithList **post** | [Post1.post](docs/paths/usercreatewithlist/Post.md#post1) | Creates list of users with given input array | -| /user/login **get** | [Get1.get](docs/paths/userlogin/Get.md#get1) | Logs user into the system | -| /user/logout **get** | [Get1.get](docs/paths/userlogout/Get.md#get1) | Logs out current logged in user session | -| /user/{username} **delete** | [Delete1.delete](docs/paths/userusername/Delete.md#delete1) | Delete user | -| /user/{username} **get** | [Get1.get](docs/paths/userusername/Get.md#get1) | Get user by user name | -| /user/{username} **put** | [Put1.put](docs/paths/userusername/Put.md#put1) | Updated user | - ## Component RequestBodies - | Class | Description | | ----- | ----------- | | [Client.Client1](docs/components/requestbodies/Client.md#client1) | client model | @@ -389,7 +461,6 @@ All URIs are relative to the selected server | [UserArray.UserArray1](docs/components/requestbodies/UserArray.md#userarray1) | List of user object | ## Component Responses - | Class | Description | | ----- | ----------- | | [HeadersWithNoBody.HeadersWithNoBody1](docs/components/responses/HeadersWithNoBody.md#headerswithnobody1) | A response that contains headers but no body
| @@ -401,7 +472,6 @@ All URIs are relative to the selected server | [SuccessfulXmlAndJsonArrayOfPet.SuccessfulXmlAndJsonArrayOfPet1](docs/components/responses/SuccessfulXmlAndJsonArrayOfPet.md#successfulxmlandjsonarrayofpet1) | successful operation, multiple content types| ## Component Headers - | Class | Description | | ----- | ----------- | | [Int32JsonContentTypeHeader.Int32JsonContentTypeHeader1](docs/components/headers/Int32JsonContentTypeHeader.md#int32jsoncontenttypeheader1) | int32 JSON content-type header | @@ -412,22 +482,9 @@ All URIs are relative to the selected server | [StringHeader.StringHeader1](docs/components/headers/StringHeader.md#stringheader1) | string header description | ## Component Parameters - | Class | Description | | ----- | ----------- | | [ComponentRefSchemaStringWithValidation.ComponentRefSchemaStringWithValidation1](docs/components/parameters/ComponentRefSchemaStringWithValidation.md#componentrefschemastringwithvalidation1) | a path string with validation | | [PathUserName.PathUserName1](docs/components/parameters/PathUserName.md#pathusername1) | the use name to use | | [RefPathUserName.RefPathUserName1](docs/components/parameters/RefPathUserName.md#refpathusername1) | | | [RefSchemaStringWithValidation.RefSchemaStringWithValidation1](docs/components/parameters/RefSchemaStringWithValidation.md#refschemastringwithvalidation1) | a path string with validation | - -## Component SecuritySchemes - -| Class | Description | -| ----- | ----------- | -| [ApiKey](docs/components/securityschemes/ApiKey.md) | apiKey in header | -| [ApiKeyQuery](docs/components/securityschemes/ApiKeyQuery.md) | apiKey in query | -| [BearerTest](docs/components/securityschemes/BearerTest.md) | http bearer with JWT bearer format | -| [HttpBasicTest](docs/components/securityschemes/HttpBasicTest.md) | http basic | -| [HttpSignatureTest](docs/components/securityschemes/HttpSignatureTest.md) | http + signature | -| [OpenIdConnectTest](docs/components/securityschemes/OpenIdConnectTest.md) | openIdConnect | -| [PetstoreAuth](docs/components/securityschemes/PetstoreAuth.md) | oauth2 implicit flow with two scopes | diff --git a/samples/client/petstore/java/docs/apis/paths/Anotherfakedummy.md b/samples/client/petstore/java/docs/apis/paths/Anotherfakedummy.md new file mode 100644 index 00000000000..dfff5e5ce61 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Anotherfakedummy.md @@ -0,0 +1,116 @@ +# Anotherfakedummy + +public class Anotherfakedummy extends extends ApiClient implements +[AnotherfakedummyPatch.PatchOperation](../../paths/anotherfakedummy/AnotherfakedummyPatch.md#patchoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [AnotherfakedummyPatchResponses.EndpointResponse](../../paths/anotherfakedummy/patch/AnotherfakedummyPatchResponses.md#endpointresponse) | [patch](#patch)([AnotherfakedummyPatch.PatchRequest](../../paths/anotherfakedummy/AnotherfakedummyPatch.md#patchrequest) request)
To test special tags and operation ID starting with number | + +## Method Detail + +### patch +public [AnotherfakedummyPatchResponses.EndpointResponse](../../paths/anotherfakedummy/patch/AnotherfakedummyPatchResponses.md#endpointresponse) patch([AnotherfakedummyPatch.PatchRequest](../../paths/anotherfakedummy/AnotherfakedummyPatch.md#patchrequest) request) + +To test special tags and operation ID starting with number + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.anotherfakedummy.patch.AnotherfakedummyPatchRequestBody; +import org.openapijsonschematools.client.components.schemas.Client; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.anotherfakedummy.patch.responses.AnotherfakedummyPatchCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Anotherfakedummy; +import org.openapijsonschematools.client.paths.anotherfakedummy.patch.AnotherfakedummyPatchResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Anotherfakedummy apiClient = new Anotherfakedummy(apiConfiguration, schemaConfiguration); + + +Client1BoxedMap requestBodyPayload = + Client.Client1.validateAndBox( + new Client.ClientMapBuilder1() + .client("a") + + .build(), + schemaConfiguration +); +AnotherfakedummyPatchRequestBody.SealedRequestBody requestBody = new AnotherfakedummyPatchRequestBody.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new AnotherfakedummyPatch.PatchRequestBuilder() + .requestBody(requestBody) + .build(); + +AnotherfakedummyPatchResponses.EndpointResponse response; +try { + response = apiClient.patch(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +AnotherfakedummyPatchResponses.EndpointAnotherfakedummyPatchCode200Response castResponse = (AnotherfakedummyPatchResponses.EndpointAnotherfakedummyPatchCode200Response) response; +AnotherfakedummyPatchCode200Response.ApplicationjsonResponseBody deserializedBody = (AnotherfakedummyPatchCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Commonparamsubdir.md b/samples/client/petstore/java/docs/apis/paths/Commonparamsubdir.md new file mode 100644 index 00000000000..288534965ef --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Commonparamsubdir.md @@ -0,0 +1,312 @@ +# Commonparamsubdir + +public class Commonparamsubdir extends extends ApiClient implements +[CommonparamsubdirDelete.DeleteOperation](../../paths/commonparamsubdir/CommonparamsubdirDelete.md#deleteoperation), +[CommonparamsubdirGet.GetOperation](../../paths/commonparamsubdir/CommonparamsubdirGet.md#getoperation), +[CommonparamsubdirPost.PostOperation](../../paths/commonparamsubdir/CommonparamsubdirPost.md#postoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [CommonparamsubdirDeleteResponses.EndpointResponse](../../paths/commonparamsubdir/delete/CommonparamsubdirDeleteResponses.md#endpointresponse) | [delete](#delete)([CommonparamsubdirDelete.DeleteRequest](../../paths/commonparamsubdir/CommonparamsubdirDelete.md#deleterequest) request)
common param is overwritten | +| [CommonparamsubdirGetResponses.EndpointResponse](../../paths/commonparamsubdir/get/CommonparamsubdirGetResponses.md#endpointresponse) | [get](#get)([CommonparamsubdirGet.GetRequest](../../paths/commonparamsubdir/CommonparamsubdirGet.md#getrequest) request) | +| [CommonparamsubdirPostResponses.EndpointResponse](../../paths/commonparamsubdir/post/CommonparamsubdirPostResponses.md#endpointresponse) | [post](#post)([CommonparamsubdirPost.PostRequest](../../paths/commonparamsubdir/CommonparamsubdirPost.md#postrequest) request) | + +## Method Detail + +### delete +public [CommonparamsubdirDeleteResponses.EndpointResponse](../../paths/commonparamsubdir/delete/CommonparamsubdirDeleteResponses.md#endpointresponse) delete([CommonparamsubdirDelete.DeleteRequest](../../paths/commonparamsubdir/CommonparamsubdirDelete.md#deleterequest) request) + +common param is overwritten + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.commonparamsubdir.delete.CommonparamsubdirDeleteHeaderParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.commonparamsubdir.delete.CommonparamsubdirDeletePathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.commonparamsubdir.delete.responses.CommonparamsubdirDeleteCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Commonparamsubdir; +import org.openapijsonschematools.client.paths.commonparamsubdir.delete.CommonparamsubdirDeleteResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Commonparamsubdir apiClient = new Commonparamsubdir(apiConfiguration, schemaConfiguration); + + +// Map validation +CommonparamsubdirDeletePathParameters.CommonparamsubdirDeletePathParametersMap pathParameters = + CommonparamsubdirDeletePathParameters.CommonparamsubdirDeletePathParameters1.validate( + new CommonparamsubdirDeletePathParameters.CommonparamsubdirDeletePathParametersMapBuilder() + .subDir("c") + + .build(), + schemaConfiguration +); + +var request = new CommonparamsubdirDelete.DeleteRequestBuilder() + .pathParameters(pathParameters) + .build(); + +CommonparamsubdirDeleteResponses.EndpointResponse response; +try { + response = apiClient.delete(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +CommonparamsubdirDeleteResponses.EndpointCommonparamsubdirDeleteCode200Response castResponse = (CommonparamsubdirDeleteResponses.EndpointCommonparamsubdirDeleteCode200Response) response; +``` +### get +public [CommonparamsubdirGetResponses.EndpointResponse](../../paths/commonparamsubdir/get/CommonparamsubdirGetResponses.md#endpointresponse) get([CommonparamsubdirGet.GetRequest](../../paths/commonparamsubdir/CommonparamsubdirGet.md#getrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.commonparamsubdir.get.CommonparamsubdirGetQueryParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.commonparamsubdir.get.CommonparamsubdirGetPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.commonparamsubdir.get.responses.CommonparamsubdirGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Commonparamsubdir; +import org.openapijsonschematools.client.paths.commonparamsubdir.get.CommonparamsubdirGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Commonparamsubdir apiClient = new Commonparamsubdir(apiConfiguration, schemaConfiguration); + + +// Map validation +CommonparamsubdirGetPathParameters.CommonparamsubdirGetPathParametersMap pathParameters = + CommonparamsubdirGetPathParameters.CommonparamsubdirGetPathParameters1.validate( + new CommonparamsubdirGetPathParameters.CommonparamsubdirGetPathParametersMapBuilder() + .subDir("a") + + .build(), + schemaConfiguration +); + +var request = new CommonparamsubdirGet.GetRequestBuilder() + .pathParameters(pathParameters) + .build(); + +CommonparamsubdirGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +CommonparamsubdirGetResponses.EndpointCommonparamsubdirGetCode200Response castResponse = (CommonparamsubdirGetResponses.EndpointCommonparamsubdirGetCode200Response) response; +``` +### post +public [CommonparamsubdirPostResponses.EndpointResponse](../../paths/commonparamsubdir/post/CommonparamsubdirPostResponses.md#endpointresponse) post([CommonparamsubdirPost.PostRequest](../../paths/commonparamsubdir/CommonparamsubdirPost.md#postrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.commonparamsubdir.post.CommonparamsubdirPostHeaderParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.commonparamsubdir.post.CommonparamsubdirPostPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.commonparamsubdir.post.responses.CommonparamsubdirPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Commonparamsubdir; +import org.openapijsonschematools.client.paths.commonparamsubdir.post.CommonparamsubdirPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Commonparamsubdir apiClient = new Commonparamsubdir(apiConfiguration, schemaConfiguration); + + +// Map validation +CommonparamsubdirPostPathParameters.CommonparamsubdirPostPathParametersMap pathParameters = + CommonparamsubdirPostPathParameters.CommonparamsubdirPostPathParameters1.validate( + new CommonparamsubdirPostPathParameters.CommonparamsubdirPostPathParametersMapBuilder() + .subDir("a") + + .build(), + schemaConfiguration +); + +var request = new CommonparamsubdirPost.PostRequestBuilder() + .pathParameters(pathParameters) + .build(); + +CommonparamsubdirPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +CommonparamsubdirPostResponses.EndpointCommonparamsubdirPostCode200Response castResponse = (CommonparamsubdirPostResponses.EndpointCommonparamsubdirPostCode200Response) response; +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fake.md b/samples/client/petstore/java/docs/apis/paths/Fake.md new file mode 100644 index 00000000000..f06c8b53c84 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fake.md @@ -0,0 +1,448 @@ +# Fake + +public class Fake extends extends ApiClient implements +[FakeDelete.DeleteOperation](../../paths/fake/FakeDelete.md#deleteoperation), +[FakeGet.GetOperation](../../paths/fake/FakeGet.md#getoperation), +[FakePatch.PatchOperation](../../paths/fake/FakePatch.md#patchoperation), +[FakePost.PostOperation](../../paths/fake/FakePost.md#postoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeDeleteResponses.EndpointResponse](../../paths/fake/delete/FakeDeleteResponses.md#endpointresponse) | [delete](#delete)([FakeDelete.DeleteRequest](../../paths/fake/FakeDelete.md#deleterequest) request)
Fake endpoint to test group parameters (optional) | +| [FakeGetResponses.EndpointResponse](../../paths/fake/get/FakeGetResponses.md#endpointresponse) | [get](#get)([FakeGet.GetRequest](../../paths/fake/FakeGet.md#getrequest) request)
To test enum parameters | +| [FakePatchResponses.EndpointResponse](../../paths/fake/patch/FakePatchResponses.md#endpointresponse) | [patch](#patch)([FakePatch.PatchRequest](../../paths/fake/FakePatch.md#patchrequest) request)
To test "client" model | +| [FakePostResponses.EndpointResponse](../../paths/fake/post/FakePostResponses.md#endpointresponse) | [post](#post)([FakePost.PostRequest](../../paths/fake/FakePost.md#postrequest) request)
Fake endpoint for testing various parameters
假端點
偽のエンドポイント
가짜 엔드 포인트
| + +## Method Detail + +### delete +public [FakeDeleteResponses.EndpointResponse](../../paths/fake/delete/FakeDeleteResponses.md#endpointresponse) delete([FakeDelete.DeleteRequest](../../paths/fake/FakeDelete.md#deleterequest) request) + +Fake endpoint to test group parameters (optional) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fake.delete.FakeDeleteSecurityInfo; +import org.openapijsonschematools.client.paths.fake.delete.FakeDeleteHeaderParameters; +import org.openapijsonschematools.client.paths.fake.delete.FakeDeleteQueryParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.BearerTest; +import org.openapijsonschematools.client.paths.fake.delete.responses.FakeDeleteCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fake; +import org.openapijsonschematools.client.paths.fake.delete.FakeDeleteResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new BearerTest("someAccessToken"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .fakeDeleteSecurityRequirementObject0SecurityIndex(FakeDeleteSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +// Map validation +FakeDeleteHeaderParameters.FakeDeleteHeaderParametersMap headerParameters = + FakeDeleteHeaderParameters.FakeDeleteHeaderParameters1.validate( + new FakeDeleteHeaderParameters.FakeDeleteHeaderParametersMapBuilder() + .required_boolean_group("true") + + .boolean_group("true") + + .build(), + schemaConfiguration +); + +// Map validation +FakeDeleteQueryParameters.FakeDeleteQueryParametersMap queryParameters = + FakeDeleteQueryParameters.FakeDeleteQueryParameters1.validate( + new FakeDeleteQueryParameters.FakeDeleteQueryParametersMapBuilder() + .required_int64_group(1L) + + .required_string_group("a") + + .int64_group(1L) + + .string_group("a") + + .build(), + schemaConfiguration +); + +var request = new FakeDelete.DeleteRequestBuilder() + .headerParameters(headerParameters) + .queryParameters(queryParameters) + .build(); + +FakeDeleteResponses.EndpointResponse response; +try { + response = apiClient.delete(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeDeleteResponses.EndpointFakeDeleteCode200Response castResponse = (FakeDeleteResponses.EndpointFakeDeleteCode200Response) response; +``` +### get +public [FakeGetResponses.EndpointResponse](../../paths/fake/get/FakeGetResponses.md#endpointresponse) get([FakeGet.GetRequest](../../paths/fake/FakeGet.md#getrequest) request) + +To test enum parameters + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fake.get.FakeGetRequestBody; +import org.openapijsonschematools.client.paths.fake.get.requestbody.content.applicationxwwwformurlencoded.ApplicationxwwwformurlencodedSchema; +import org.openapijsonschematools.client.paths.fake.get.FakeGetHeaderParameters; +import org.openapijsonschematools.client.paths.fake.get.FakeGetQueryParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fake.get.responses.FakeGetCode200Response; +import org.openapijsonschematools.client.paths.fake.get.responses.FakeGetCode404Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fake; +import org.openapijsonschematools.client.paths.fake.get.FakeGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new FakeGet.GetRequestBuilder().build(); + +FakeGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (FakeGetCode404Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeGetResponses.EndpointFakeGetCode200Response castResponse = (FakeGetResponses.EndpointFakeGetCode200Response) response; +``` +### patch +public [FakePatchResponses.EndpointResponse](../../paths/fake/patch/FakePatchResponses.md#endpointresponse) patch([FakePatch.PatchRequest](../../paths/fake/FakePatch.md#patchrequest) request) + +To test "client" model + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fake.patch.FakePatchRequestBody; +import org.openapijsonschematools.client.components.schemas.Client; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fake.patch.responses.FakePatchCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fake; +import org.openapijsonschematools.client.paths.fake.patch.FakePatchResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +Client1BoxedMap requestBodyPayload = + Client.Client1.validateAndBox( + new Client.ClientMapBuilder1() + .client("a") + + .build(), + schemaConfiguration +); +FakePatchRequestBody.SealedRequestBody requestBody = new FakePatchRequestBody.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new FakePatch.PatchRequestBuilder() + .requestBody(requestBody) + .build(); + +FakePatchResponses.EndpointResponse response; +try { + response = apiClient.patch(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakePatchResponses.EndpointFakePatchCode200Response castResponse = (FakePatchResponses.EndpointFakePatchCode200Response) response; +FakePatchCode200Response.ApplicationjsonResponseBody deserializedBody = (FakePatchCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### post +public [FakePostResponses.EndpointResponse](../../paths/fake/post/FakePostResponses.md#endpointresponse) post([FakePost.PostRequest](../../paths/fake/FakePost.md#postrequest) request) + +Fake endpoint for testing various parameters
假端點
偽のエンドポイント
가짜 엔드 포인트
+ +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fake.post.FakePostRequestBody; +import org.openapijsonschematools.client.paths.fake.post.requestbody.content.applicationxwwwformurlencoded.ApplicationxwwwformurlencodedSchema; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fake.post.FakePostSecurityInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.HttpBasicTest; +import org.openapijsonschematools.client.paths.fake.post.responses.FakePostCode200Response; +import org.openapijsonschematools.client.paths.fake.post.responses.FakePostCode404Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fake; +import org.openapijsonschematools.client.paths.fake.post.FakePostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new HttpBasicTest("someUserId", "somePassword"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .fakePostSecurityRequirementObject0SecurityIndex(FakePostSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new FakePost.PostRequestBuilder().build(); + +FakePostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (FakePostCode404Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakePostResponses.EndpointFakePostCode200Response castResponse = (FakePostResponses.EndpointFakePostCode200Response) response; +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakeadditionalpropertieswitharrayofenums.md b/samples/client/petstore/java/docs/apis/paths/Fakeadditionalpropertieswitharrayofenums.md new file mode 100644 index 00000000000..214de5c1394 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakeadditionalpropertieswitharrayofenums.md @@ -0,0 +1,102 @@ +# Fakeadditionalpropertieswitharrayofenums + +public class Fakeadditionalpropertieswitharrayofenums extends extends ApiClient implements +[FakeadditionalpropertieswitharrayofenumsGet.GetOperation](../../paths/fakeadditionalpropertieswitharrayofenums/FakeadditionalpropertieswitharrayofenumsGet.md#getoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeadditionalpropertieswitharrayofenumsGetResponses.EndpointResponse](../../paths/fakeadditionalpropertieswitharrayofenums/get/FakeadditionalpropertieswitharrayofenumsGetResponses.md#endpointresponse) | [get](#get)([FakeadditionalpropertieswitharrayofenumsGet.GetRequest](../../paths/fakeadditionalpropertieswitharrayofenums/FakeadditionalpropertieswitharrayofenumsGet.md#getrequest) request) | + +## Method Detail + +### get +public [FakeadditionalpropertieswitharrayofenumsGetResponses.EndpointResponse](../../paths/fakeadditionalpropertieswitharrayofenums/get/FakeadditionalpropertieswitharrayofenumsGetResponses.md#endpointresponse) get([FakeadditionalpropertieswitharrayofenumsGet.GetRequest](../../paths/fakeadditionalpropertieswitharrayofenums/FakeadditionalpropertieswitharrayofenumsGet.md#getrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get.FakeadditionalpropertieswitharrayofenumsGetRequestBody; +import org.openapijsonschematools.client.components.schemas.AdditionalPropertiesWithArrayOfEnums; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get.responses.FakeadditionalpropertieswitharrayofenumsGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakeadditionalpropertieswitharrayofenums; +import org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get.FakeadditionalpropertieswitharrayofenumsGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakeadditionalpropertieswitharrayofenums apiClient = new Fakeadditionalpropertieswitharrayofenums(apiConfiguration, schemaConfiguration); + + +var request = new FakeadditionalpropertieswitharrayofenumsGet.GetRequestBuilder().build(); + +FakeadditionalpropertieswitharrayofenumsGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeadditionalpropertieswitharrayofenumsGetResponses.EndpointFakeadditionalpropertieswitharrayofenumsGetCode200Response castResponse = (FakeadditionalpropertieswitharrayofenumsGetResponses.EndpointFakeadditionalpropertieswitharrayofenumsGetCode200Response) response; +FakeadditionalpropertieswitharrayofenumsGetCode200Response.ApplicationjsonResponseBody deserializedBody = (FakeadditionalpropertieswitharrayofenumsGetCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakebodywithfileschema.md b/samples/client/petstore/java/docs/apis/paths/Fakebodywithfileschema.md new file mode 100644 index 00000000000..5d36cc1dfd5 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakebodywithfileschema.md @@ -0,0 +1,116 @@ +# Fakebodywithfileschema + +public class Fakebodywithfileschema extends extends ApiClient implements +[FakebodywithfileschemaPut.PutOperation](../../paths/fakebodywithfileschema/FakebodywithfileschemaPut.md#putoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakebodywithfileschemaPutResponses.EndpointResponse](../../paths/fakebodywithfileschema/put/FakebodywithfileschemaPutResponses.md#endpointresponse) | [put](#put)([FakebodywithfileschemaPut.PutRequest](../../paths/fakebodywithfileschema/FakebodywithfileschemaPut.md#putrequest) request)
For this test, the body for this request much reference a schema named `File`. | + +## Method Detail + +### put +public [FakebodywithfileschemaPutResponses.EndpointResponse](../../paths/fakebodywithfileschema/put/FakebodywithfileschemaPutResponses.md#endpointresponse) put([FakebodywithfileschemaPut.PutRequest](../../paths/fakebodywithfileschema/FakebodywithfileschemaPut.md#putrequest) request) + +For this test, the body for this request much reference a schema named `File`. + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakebodywithfileschema.put.FakebodywithfileschemaPutRequestBody; +import org.openapijsonschematools.client.components.schemas.FileSchemaTestClass; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakebodywithfileschema.put.responses.FakebodywithfileschemaPutCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakebodywithfileschema; +import org.openapijsonschematools.client.paths.fakebodywithfileschema.put.FakebodywithfileschemaPutResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakebodywithfileschema apiClient = new Fakebodywithfileschema(apiConfiguration, schemaConfiguration); + + +FileSchemaTestClass1BoxedMap requestBodyPayload = + FileSchemaTestClass.FileSchemaTestClass1.validateAndBox( + new FileSchemaTestClass.FileSchemaTestClassMapBuilder() + .files( + Arrays.asList( + ) + ) + .build(), + schemaConfiguration +); +FakebodywithfileschemaPut.SealedRequestBody requestBody = new FakebodywithfileschemaPut.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new FakebodywithfileschemaPut.PutRequestBuilder() + .requestBody(requestBody) + .build(); + +FakebodywithfileschemaPutResponses.EndpointResponse response; +try { + response = apiClient.put(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakebodywithfileschemaPutResponses.EndpointFakebodywithfileschemaPutCode200Response castResponse = (FakebodywithfileschemaPutResponses.EndpointFakebodywithfileschemaPutCode200Response) response; +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakebodywithqueryparams.md b/samples/client/petstore/java/docs/apis/paths/Fakebodywithqueryparams.md new file mode 100644 index 00000000000..566aa4a6765 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakebodywithqueryparams.md @@ -0,0 +1,140 @@ +# Fakebodywithqueryparams + +public class Fakebodywithqueryparams extends extends ApiClient implements +[FakebodywithqueryparamsPut.PutOperation](../../paths/fakebodywithqueryparams/FakebodywithqueryparamsPut.md#putoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakebodywithqueryparamsPutResponses.EndpointResponse](../../paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutResponses.md#endpointresponse) | [put](#put)([FakebodywithqueryparamsPut.PutRequest](../../paths/fakebodywithqueryparams/FakebodywithqueryparamsPut.md#putrequest) request) | + +## Method Detail + +### put +public [FakebodywithqueryparamsPutResponses.EndpointResponse](../../paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutResponses.md#endpointresponse) put([FakebodywithqueryparamsPut.PutRequest](../../paths/fakebodywithqueryparams/FakebodywithqueryparamsPut.md#putrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.FakebodywithqueryparamsPutRequestBody; +import org.openapijsonschematools.client.components.schemas.User; +import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.FakebodywithqueryparamsPutQueryParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.responses.FakebodywithqueryparamsPutCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakebodywithqueryparams; +import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.FakebodywithqueryparamsPutResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakebodywithqueryparams apiClient = new Fakebodywithqueryparams(apiConfiguration, schemaConfiguration); + + +User1BoxedMap requestBodyPayload = + User.User1.validateAndBox( + new User.UserMapBuilder() + .id(1L) + + .username("a") + + .firstName("a") + + .lastName("a") + + .email("a") + + .password("a") + + .phone("a") + + .userStatus(1) + + .objectWithNoDeclaredPropsNullable(null) + + .build(), + schemaConfiguration +); +FakebodywithqueryparamsPut.SealedRequestBody requestBody = new FakebodywithqueryparamsPut.ApplicationjsonRequestBody(requestBodyPayload); + +// Map validation +FakebodywithqueryparamsPutQueryParameters.FakebodywithqueryparamsPutQueryParametersMap queryParameters = + FakebodywithqueryparamsPutQueryParameters.FakebodywithqueryparamsPutQueryParameters1.validate( + new FakebodywithqueryparamsPutQueryParameters.FakebodywithqueryparamsPutQueryParametersMapBuilder() + .query("a") + + .build(), + schemaConfiguration +); + +var request = new FakebodywithqueryparamsPut.PutRequestBuilder() + .requestBody(requestBody) + .queryParameters(queryParameters) + .build(); + +FakebodywithqueryparamsPutResponses.EndpointResponse response; +try { + response = apiClient.put(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakebodywithqueryparamsPutResponses.EndpointFakebodywithqueryparamsPutCode200Response castResponse = (FakebodywithqueryparamsPutResponses.EndpointFakebodywithqueryparamsPutCode200Response) response; +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakecasesensitiveparams.md b/samples/client/petstore/java/docs/apis/paths/Fakecasesensitiveparams.md new file mode 100644 index 00000000000..df8e70eb129 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakecasesensitiveparams.md @@ -0,0 +1,117 @@ +# Fakecasesensitiveparams + +public class Fakecasesensitiveparams extends extends ApiClient implements +[FakecasesensitiveparamsPut.PutOperation](../../paths/fakecasesensitiveparams/FakecasesensitiveparamsPut.md#putoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakecasesensitiveparamsPutResponses.EndpointResponse](../../paths/fakecasesensitiveparams/put/FakecasesensitiveparamsPutResponses.md#endpointresponse) | [put](#put)([FakecasesensitiveparamsPut.PutRequest](../../paths/fakecasesensitiveparams/FakecasesensitiveparamsPut.md#putrequest) request)
Ensures that original naming is used in endpoint params, that way we don't have collisions | + +## Method Detail + +### put +public [FakecasesensitiveparamsPutResponses.EndpointResponse](../../paths/fakecasesensitiveparams/put/FakecasesensitiveparamsPutResponses.md#endpointresponse) put([FakecasesensitiveparamsPut.PutRequest](../../paths/fakecasesensitiveparams/FakecasesensitiveparamsPut.md#putrequest) request) + +Ensures that original naming is used in endpoint params, that way we don't have collisions + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.FakecasesensitiveparamsPutQueryParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.responses.FakecasesensitiveparamsPutCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakecasesensitiveparams; +import org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.FakecasesensitiveparamsPutResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakecasesensitiveparams apiClient = new Fakecasesensitiveparams(apiConfiguration, schemaConfiguration); + + +// Map validation +FakecasesensitiveparamsPutQueryParameters.FakecasesensitiveparamsPutQueryParametersMap queryParameters = + FakecasesensitiveparamsPutQueryParameters.FakecasesensitiveparamsPutQueryParameters1.validate( + new FakecasesensitiveparamsPutQueryParameters.FakecasesensitiveparamsPutQueryParametersMapBuilder() + .SomeVar("a") + + .someVar("a") + + .some_var("a") + + .build(), + schemaConfiguration +); + +var request = new FakecasesensitiveparamsPut.PutRequestBuilder() + .queryParameters(queryParameters) + .build(); + +FakecasesensitiveparamsPutResponses.EndpointResponse response; +try { + response = apiClient.put(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakecasesensitiveparamsPutResponses.EndpointFakecasesensitiveparamsPutCode200Response castResponse = (FakecasesensitiveparamsPutResponses.EndpointFakecasesensitiveparamsPutCode200Response) response; +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakeclassnametest.md b/samples/client/petstore/java/docs/apis/paths/Fakeclassnametest.md new file mode 100644 index 00000000000..086168f5024 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakeclassnametest.md @@ -0,0 +1,128 @@ +# Fakeclassnametest + +public class Fakeclassnametest extends extends ApiClient implements +[FakeclassnametestPatch.PatchOperation](../../paths/fakeclassnametest/FakeclassnametestPatch.md#patchoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeclassnametestPatchResponses.EndpointResponse](../../paths/fakeclassnametest/patch/FakeclassnametestPatchResponses.md#endpointresponse) | [patch](#patch)([FakeclassnametestPatch.PatchRequest](../../paths/fakeclassnametest/FakeclassnametestPatch.md#patchrequest) request)
To test class name in snake case | + +## Method Detail + +### patch +public [FakeclassnametestPatchResponses.EndpointResponse](../../paths/fakeclassnametest/patch/FakeclassnametestPatchResponses.md#endpointresponse) patch([FakeclassnametestPatch.PatchRequest](../../paths/fakeclassnametest/FakeclassnametestPatch.md#patchrequest) request) + +To test class name in snake case + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeclassnametest.patch.FakeclassnametestPatchSecurityInfo; +import org.openapijsonschematools.client.paths.fakeclassnametest.patch.FakeclassnametestPatchRequestBody; +import org.openapijsonschematools.client.components.schemas.Client; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.ApiKeyQuery; +import org.openapijsonschematools.client.paths.fakeclassnametest.patch.responses.FakeclassnametestPatchCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakeclassnametest; +import org.openapijsonschematools.client.paths.fakeclassnametest.patch.FakeclassnametestPatchResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new ApiKeyQuery("someApiKey"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .fakeclassnametestPatchSecurityRequirementObject0SecurityIndex(FakeclassnametestPatchSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakeclassnametest apiClient = new Fakeclassnametest(apiConfiguration, schemaConfiguration); + + +Client1BoxedMap requestBodyPayload = + Client.Client1.validateAndBox( + new Client.ClientMapBuilder1() + .client("a") + + .build(), + schemaConfiguration +); +FakeclassnametestPatchRequestBody.SealedRequestBody requestBody = new FakeclassnametestPatchRequestBody.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new FakeclassnametestPatch.PatchRequestBuilder() + .requestBody(requestBody) + .build(); + +FakeclassnametestPatchResponses.EndpointResponse response; +try { + response = apiClient.patch(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeclassnametestPatchResponses.EndpointFakeclassnametestPatchCode200Response castResponse = (FakeclassnametestPatchResponses.EndpointFakeclassnametestPatchCode200Response) response; +FakeclassnametestPatchCode200Response.ApplicationjsonResponseBody deserializedBody = (FakeclassnametestPatchCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakedeletecoffeeid.md b/samples/client/petstore/java/docs/apis/paths/Fakedeletecoffeeid.md new file mode 100644 index 00000000000..cad83a20f06 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakedeletecoffeeid.md @@ -0,0 +1,117 @@ +# Fakedeletecoffeeid + +public class Fakedeletecoffeeid extends extends ApiClient implements +[FakedeletecoffeeidDelete.DeleteOperation](../../paths/fakedeletecoffeeid/FakedeletecoffeeidDelete.md#deleteoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakedeletecoffeeidDeleteResponses.EndpointResponse](../../paths/fakedeletecoffeeid/delete/FakedeletecoffeeidDeleteResponses.md#endpointresponse) | [delete](#delete)([FakedeletecoffeeidDelete.DeleteRequest](../../paths/fakedeletecoffeeid/FakedeletecoffeeidDelete.md#deleterequest) request)
Delete the coffee identified by the given id, (delete without request body) | + +## Method Detail + +### delete +public [FakedeletecoffeeidDeleteResponses.EndpointResponse](../../paths/fakedeletecoffeeid/delete/FakedeletecoffeeidDeleteResponses.md#endpointresponse) delete([FakedeletecoffeeidDelete.DeleteRequest](../../paths/fakedeletecoffeeid/FakedeletecoffeeidDelete.md#deleterequest) request) + +Delete the coffee identified by the given id, (delete without request body) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.FakedeletecoffeeidDeletePathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.responses.FakedeletecoffeeidDeleteCode200Response; +import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.responses.FakedeletecoffeeidDeleteCodedefaultResponse; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakedeletecoffeeid; +import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.FakedeletecoffeeidDeleteResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakedeletecoffeeid apiClient = new Fakedeletecoffeeid(apiConfiguration, schemaConfiguration); + + +// Map validation +FakedeletecoffeeidDeletePathParameters.FakedeletecoffeeidDeletePathParametersMap pathParameters = + FakedeletecoffeeidDeletePathParameters.FakedeletecoffeeidDeletePathParameters1.validate( + new FakedeletecoffeeidDeletePathParameters.FakedeletecoffeeidDeletePathParametersMapBuilder() + .id("a") + + .build(), + schemaConfiguration +); + +var request = new FakedeletecoffeeidDelete.DeleteRequestBuilder() + .pathParameters(pathParameters) + .build(); + +FakedeletecoffeeidDeleteResponses.EndpointResponse response; +try { + response = apiClient.delete(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +if (response instanceof FakedeletecoffeeidDeleteResponses.EndpointFakedeletecoffeeidDeleteCode200Response castResponse) { +} else { + FakedeletecoffeeidDeleteResponses.EndpointFakedeletecoffeeidDeleteCodedefaultResponse castResponse = (FakedeletecoffeeidDeleteResponses.EndpointFakedeletecoffeeidDeleteCodedefaultResponse) response; +} +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakehealth.md b/samples/client/petstore/java/docs/apis/paths/Fakehealth.md new file mode 100644 index 00000000000..5c0455c6d33 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakehealth.md @@ -0,0 +1,100 @@ +# Fakehealth + +public class Fakehealth extends extends ApiClient implements +[FakehealthGet.GetOperation](../../paths/fakehealth/FakehealthGet.md#getoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakehealthGetResponses.EndpointResponse](../../paths/fakehealth/get/FakehealthGetResponses.md#endpointresponse) | [get](#get)([FakehealthGet.GetRequest](../../paths/fakehealth/FakehealthGet.md#getrequest) request) | + +## Method Detail + +### get +public [FakehealthGetResponses.EndpointResponse](../../paths/fakehealth/get/FakehealthGetResponses.md#endpointresponse) get([FakehealthGet.GetRequest](../../paths/fakehealth/FakehealthGet.md#getrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakehealth.get.responses.FakehealthGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakehealth; +import org.openapijsonschematools.client.paths.fakehealth.get.FakehealthGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakehealth apiClient = new Fakehealth(apiConfiguration, schemaConfiguration); + + +var request = new FakehealthGet.GetRequestBuilder().build(); + +FakehealthGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakehealthGetResponses.EndpointFakehealthGetCode200Response castResponse = (FakehealthGetResponses.EndpointFakehealthGetCode200Response) response; +FakehealthGetCode200Response.ApplicationjsonResponseBody deserializedBody = (FakehealthGetCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakeinlineadditionalproperties.md b/samples/client/petstore/java/docs/apis/paths/Fakeinlineadditionalproperties.md new file mode 100644 index 00000000000..d1df32c55d0 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakeinlineadditionalproperties.md @@ -0,0 +1,114 @@ +# Fakeinlineadditionalproperties + +public class Fakeinlineadditionalproperties extends extends ApiClient implements +[FakeinlineadditionalpropertiesPost.PostOperation](../../paths/fakeinlineadditionalproperties/FakeinlineadditionalpropertiesPost.md#postoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeinlineadditionalpropertiesPostResponses.EndpointResponse](../../paths/fakeinlineadditionalproperties/post/FakeinlineadditionalpropertiesPostResponses.md#endpointresponse) | [post](#post)([FakeinlineadditionalpropertiesPost.PostRequest](../../paths/fakeinlineadditionalproperties/FakeinlineadditionalpropertiesPost.md#postrequest) request)
| + +## Method Detail + +### post +public [FakeinlineadditionalpropertiesPostResponses.EndpointResponse](../../paths/fakeinlineadditionalproperties/post/FakeinlineadditionalpropertiesPostResponses.md#endpointresponse) post([FakeinlineadditionalpropertiesPost.PostRequest](../../paths/fakeinlineadditionalproperties/FakeinlineadditionalpropertiesPost.md#postrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post.FakeinlineadditionalpropertiesPostRequestBody; +import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post.requestbody.content.applicationjson.ApplicationjsonSchema; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post.responses.FakeinlineadditionalpropertiesPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakeinlineadditionalproperties; +import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post.FakeinlineadditionalpropertiesPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakeinlineadditionalproperties apiClient = new Fakeinlineadditionalproperties(apiConfiguration, schemaConfiguration); + + +ApplicationjsonSchema1BoxedMap requestBodyPayload = + ApplicationjsonSchema.ApplicationjsonSchema1.validateAndBox( + new ApplicationjsonSchema.ApplicationjsonSchemaMapBuilder() + .additionalProperty("someAdditionalProperty", "a") + + .build(), + schemaConfiguration +); +FakeinlineadditionalpropertiesPost.SealedRequestBody requestBody = new FakeinlineadditionalpropertiesPost.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new FakeinlineadditionalpropertiesPost.PostRequestBuilder() + .requestBody(requestBody) + .build(); + +FakeinlineadditionalpropertiesPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeinlineadditionalpropertiesPostResponses.EndpointFakeinlineadditionalpropertiesPostCode200Response castResponse = (FakeinlineadditionalpropertiesPostResponses.EndpointFakeinlineadditionalpropertiesPostCode200Response) response; +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakeinlinecomposition.md b/samples/client/petstore/java/docs/apis/paths/Fakeinlinecomposition.md new file mode 100644 index 00000000000..f676e498494 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakeinlinecomposition.md @@ -0,0 +1,109 @@ +# Fakeinlinecomposition + +public class Fakeinlinecomposition extends extends ApiClient implements +[FakeinlinecompositionPost.PostOperation](../../paths/fakeinlinecomposition/FakeinlinecompositionPost.md#postoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeinlinecompositionPostResponses.EndpointResponse](../../paths/fakeinlinecomposition/post/FakeinlinecompositionPostResponses.md#endpointresponse) | [post](#post)([FakeinlinecompositionPost.PostRequest](../../paths/fakeinlinecomposition/FakeinlinecompositionPost.md#postrequest) request)
composed schemas at inline locations + multiple requestBody content types | + +## Method Detail + +### post +public [FakeinlinecompositionPostResponses.EndpointResponse](../../paths/fakeinlinecomposition/post/FakeinlinecompositionPostResponses.md#endpointresponse) post([FakeinlinecompositionPost.PostRequest](../../paths/fakeinlinecomposition/FakeinlinecompositionPost.md#postrequest) request) + +composed schemas at inline locations + multiple requestBody content types + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.FakeinlinecompositionPostRequestBody; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.requestbody.content.applicationjson.ApplicationjsonSchema; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.FakeinlinecompositionPostQueryParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.responses.FakeinlinecompositionPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakeinlinecomposition; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.FakeinlinecompositionPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakeinlinecomposition apiClient = new Fakeinlinecomposition(apiConfiguration, schemaConfiguration); + + +var request = new FakeinlinecompositionPost.PostRequestBuilder().build(); + +FakeinlinecompositionPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeinlinecompositionPostResponses.EndpointFakeinlinecompositionPostCode200Response castResponse = (FakeinlinecompositionPostResponses.EndpointFakeinlinecompositionPostCode200Response) response; +if (castResponse.body instanceof FakeinlinecompositionPostCode200Response.ApplicationjsonResponseBody deserializedBody) { + // handle deserialized body here +} else { + FakeinlinecompositionPostCode200Response.MultipartformdataResponseBody deserializedBody = (FakeinlinecompositionPostCode200Response.MultipartformdataResponseBody) castResponse.body; + // handle deserialized body here +} +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakejsonformdata.md b/samples/client/petstore/java/docs/apis/paths/Fakejsonformdata.md new file mode 100644 index 00000000000..36ce2df9027 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakejsonformdata.md @@ -0,0 +1,102 @@ +# Fakejsonformdata + +public class Fakejsonformdata extends extends ApiClient implements +[FakejsonformdataGet.GetOperation](../../paths/fakejsonformdata/FakejsonformdataGet.md#getoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakejsonformdataGetResponses.EndpointResponse](../../paths/fakejsonformdata/get/FakejsonformdataGetResponses.md#endpointresponse) | [get](#get)([FakejsonformdataGet.GetRequest](../../paths/fakejsonformdata/FakejsonformdataGet.md#getrequest) request)
| + +## Method Detail + +### get +public [FakejsonformdataGetResponses.EndpointResponse](../../paths/fakejsonformdata/get/FakejsonformdataGetResponses.md#endpointresponse) get([FakejsonformdataGet.GetRequest](../../paths/fakejsonformdata/FakejsonformdataGet.md#getrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakejsonformdata.get.FakejsonformdataGetRequestBody; +import org.openapijsonschematools.client.paths.fakejsonformdata.get.requestbody.content.applicationxwwwformurlencoded.ApplicationxwwwformurlencodedSchema; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakejsonformdata.get.responses.FakejsonformdataGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakejsonformdata; +import org.openapijsonschematools.client.paths.fakejsonformdata.get.FakejsonformdataGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakejsonformdata apiClient = new Fakejsonformdata(apiConfiguration, schemaConfiguration); + + +var request = new FakejsonformdataGet.GetRequestBuilder().build(); + +FakejsonformdataGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakejsonformdataGetResponses.EndpointFakejsonformdataGetCode200Response castResponse = (FakejsonformdataGetResponses.EndpointFakejsonformdataGetCode200Response) response; +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakejsonpatch.md b/samples/client/petstore/java/docs/apis/paths/Fakejsonpatch.md new file mode 100644 index 00000000000..87d6db78edc --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakejsonpatch.md @@ -0,0 +1,102 @@ +# Fakejsonpatch + +public class Fakejsonpatch extends extends ApiClient implements +[FakejsonpatchPatch.PatchOperation](../../paths/fakejsonpatch/FakejsonpatchPatch.md#patchoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakejsonpatchPatchResponses.EndpointResponse](../../paths/fakejsonpatch/patch/FakejsonpatchPatchResponses.md#endpointresponse) | [patch](#patch)([FakejsonpatchPatch.PatchRequest](../../paths/fakejsonpatch/FakejsonpatchPatch.md#patchrequest) request)
json patch route with a requestBody | + +## Method Detail + +### patch +public [FakejsonpatchPatchResponses.EndpointResponse](../../paths/fakejsonpatch/patch/FakejsonpatchPatchResponses.md#endpointresponse) patch([FakejsonpatchPatch.PatchRequest](../../paths/fakejsonpatch/FakejsonpatchPatch.md#patchrequest) request) + +json patch route with a requestBody + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakejsonpatch.patch.FakejsonpatchPatchRequestBody; +import org.openapijsonschematools.client.components.schemas.JSONPatchRequest; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakejsonpatch.patch.responses.FakejsonpatchPatchCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakejsonpatch; +import org.openapijsonschematools.client.paths.fakejsonpatch.patch.FakejsonpatchPatchResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakejsonpatch apiClient = new Fakejsonpatch(apiConfiguration, schemaConfiguration); + + +var request = new FakejsonpatchPatch.PatchRequestBuilder().build(); + +FakejsonpatchPatchResponses.EndpointResponse response; +try { + response = apiClient.patch(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakejsonpatchPatchResponses.EndpointFakejsonpatchPatchCode200Response castResponse = (FakejsonpatchPatchResponses.EndpointFakejsonpatchPatchCode200Response) response; +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakejsonwithcharset.md b/samples/client/petstore/java/docs/apis/paths/Fakejsonwithcharset.md new file mode 100644 index 00000000000..7afbe600ae7 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakejsonwithcharset.md @@ -0,0 +1,102 @@ +# Fakejsonwithcharset + +public class Fakejsonwithcharset extends extends ApiClient implements +[FakejsonwithcharsetPost.PostOperation](../../paths/fakejsonwithcharset/FakejsonwithcharsetPost.md#postoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakejsonwithcharsetPostResponses.EndpointResponse](../../paths/fakejsonwithcharset/post/FakejsonwithcharsetPostResponses.md#endpointresponse) | [post](#post)([FakejsonwithcharsetPost.PostRequest](../../paths/fakejsonwithcharset/FakejsonwithcharsetPost.md#postrequest) request) | + +## Method Detail + +### post +public [FakejsonwithcharsetPostResponses.EndpointResponse](../../paths/fakejsonwithcharset/post/FakejsonwithcharsetPostResponses.md#endpointresponse) post([FakejsonwithcharsetPost.PostRequest](../../paths/fakejsonwithcharset/FakejsonwithcharsetPost.md#postrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakejsonwithcharset.post.FakejsonwithcharsetPostRequestBody; +import org.openapijsonschematools.client.paths.fakejsonwithcharset.post.requestbody.content.applicationjsoncharsetutf8.Applicationjsoncharsetutf8Schema; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakejsonwithcharset.post.responses.FakejsonwithcharsetPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakejsonwithcharset; +import org.openapijsonschematools.client.paths.fakejsonwithcharset.post.FakejsonwithcharsetPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakejsonwithcharset apiClient = new Fakejsonwithcharset(apiConfiguration, schemaConfiguration); + + +var request = new FakejsonwithcharsetPost.PostRequestBuilder().build(); + +FakejsonwithcharsetPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakejsonwithcharsetPostResponses.EndpointFakejsonwithcharsetPostCode200Response castResponse = (FakejsonwithcharsetPostResponses.EndpointFakejsonwithcharsetPostCode200Response) response; +FakejsonwithcharsetPostCode200Response.Applicationjsoncharsetutf8ResponseBody deserializedBody = (FakejsonwithcharsetPostCode200Response.Applicationjsoncharsetutf8ResponseBody) castResponse.body; +// handle deserialized body here +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakemultiplerequestbodycontenttypes.md b/samples/client/petstore/java/docs/apis/paths/Fakemultiplerequestbodycontenttypes.md new file mode 100644 index 00000000000..cb5535784b7 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakemultiplerequestbodycontenttypes.md @@ -0,0 +1,104 @@ +# Fakemultiplerequestbodycontenttypes + +public class Fakemultiplerequestbodycontenttypes extends extends ApiClient implements +[FakemultiplerequestbodycontenttypesPost.PostOperation](../../paths/fakemultiplerequestbodycontenttypes/FakemultiplerequestbodycontenttypesPost.md#postoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakemultiplerequestbodycontenttypesPostResponses.EndpointResponse](../../paths/fakemultiplerequestbodycontenttypes/post/FakemultiplerequestbodycontenttypesPostResponses.md#endpointresponse) | [post](#post)([FakemultiplerequestbodycontenttypesPost.PostRequest](../../paths/fakemultiplerequestbodycontenttypes/FakemultiplerequestbodycontenttypesPost.md#postrequest) request)
composed schemas at inline locations + multiple requestBody content types | + +## Method Detail + +### post +public [FakemultiplerequestbodycontenttypesPostResponses.EndpointResponse](../../paths/fakemultiplerequestbodycontenttypes/post/FakemultiplerequestbodycontenttypesPostResponses.md#endpointresponse) post([FakemultiplerequestbodycontenttypesPost.PostRequest](../../paths/fakemultiplerequestbodycontenttypes/FakemultiplerequestbodycontenttypesPost.md#postrequest) request) + +composed schemas at inline locations + multiple requestBody content types + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.FakemultiplerequestbodycontenttypesPostRequestBody; +import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.requestbody.content.applicationjson.ApplicationjsonSchema; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.responses.FakemultiplerequestbodycontenttypesPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakemultiplerequestbodycontenttypes; +import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.FakemultiplerequestbodycontenttypesPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakemultiplerequestbodycontenttypes apiClient = new Fakemultiplerequestbodycontenttypes(apiConfiguration, schemaConfiguration); + + +var request = new FakemultiplerequestbodycontenttypesPost.PostRequestBuilder().build(); + +FakemultiplerequestbodycontenttypesPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakemultiplerequestbodycontenttypesPostResponses.EndpointFakemultiplerequestbodycontenttypesPostCode200Response castResponse = (FakemultiplerequestbodycontenttypesPostResponses.EndpointFakemultiplerequestbodycontenttypesPostCode200Response) response; +FakemultiplerequestbodycontenttypesPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakemultiplerequestbodycontenttypesPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakemultipleresponsebodies.md b/samples/client/petstore/java/docs/apis/paths/Fakemultipleresponsebodies.md new file mode 100644 index 00000000000..dbcb8f54004 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakemultipleresponsebodies.md @@ -0,0 +1,106 @@ +# Fakemultipleresponsebodies + +public class Fakemultipleresponsebodies extends extends ApiClient implements +[FakemultipleresponsebodiesGet.GetOperation](../../paths/fakemultipleresponsebodies/FakemultipleresponsebodiesGet.md#getoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakemultipleresponsebodiesGetResponses.EndpointResponse](../../paths/fakemultipleresponsebodies/get/FakemultipleresponsebodiesGetResponses.md#endpointresponse) | [get](#get)([FakemultipleresponsebodiesGet.GetRequest](../../paths/fakemultipleresponsebodies/FakemultipleresponsebodiesGet.md#getrequest) request) | + +## Method Detail + +### get +public [FakemultipleresponsebodiesGetResponses.EndpointResponse](../../paths/fakemultipleresponsebodies/get/FakemultipleresponsebodiesGetResponses.md#endpointresponse) get([FakemultipleresponsebodiesGet.GetRequest](../../paths/fakemultipleresponsebodies/FakemultipleresponsebodiesGet.md#getrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.responses.FakemultipleresponsebodiesGetCode200Response; +import org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.responses.FakemultipleresponsebodiesGetCode202Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakemultipleresponsebodies; +import org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.FakemultipleresponsebodiesGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakemultipleresponsebodies apiClient = new Fakemultipleresponsebodies(apiConfiguration, schemaConfiguration); + + +var request = new FakemultipleresponsebodiesGet.GetRequestBuilder().build(); + +FakemultipleresponsebodiesGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +if (response instanceof FakemultipleresponsebodiesGetResponses.EndpointFakemultipleresponsebodiesGetCode200Response castResponse) { +FakemultipleresponsebodiesGetCode200Response.ApplicationjsonResponseBody deserializedBody = (FakemultipleresponsebodiesGetCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +} else { + FakemultipleresponsebodiesGetResponses.EndpointFakemultipleresponsebodiesGetCode202Response castResponse = (FakemultipleresponsebodiesGetResponses.EndpointFakemultipleresponsebodiesGetCode202Response) response; +FakemultipleresponsebodiesGetCode202Response.ApplicationjsonResponseBody deserializedBody = (FakemultipleresponsebodiesGetCode202Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +} +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakemultiplesecurities.md b/samples/client/petstore/java/docs/apis/paths/Fakemultiplesecurities.md new file mode 100644 index 00000000000..f171c5f627c --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakemultiplesecurities.md @@ -0,0 +1,117 @@ +# Fakemultiplesecurities + +public class Fakemultiplesecurities extends extends ApiClient implements +[FakemultiplesecuritiesGet.GetOperation](../../paths/fakemultiplesecurities/FakemultiplesecuritiesGet.md#getoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakemultiplesecuritiesGetResponses.EndpointResponse](../../paths/fakemultiplesecurities/get/FakemultiplesecuritiesGetResponses.md#endpointresponse) | [get](#get)([FakemultiplesecuritiesGet.GetRequest](../../paths/fakemultiplesecurities/FakemultiplesecuritiesGet.md#getrequest) request) | + +## Method Detail + +### get +public [FakemultiplesecuritiesGetResponses.EndpointResponse](../../paths/fakemultiplesecurities/get/FakemultiplesecuritiesGetResponses.md#endpointresponse) get([FakemultiplesecuritiesGet.GetRequest](../../paths/fakemultiplesecurities/FakemultiplesecuritiesGet.md#getrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakemultiplesecurities.get.FakemultiplesecuritiesGetSecurityInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.HttpBasicTest; +import org.openapijsonschematools.client.components.securityschemes.ApiKey; +import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; +import org.openapijsonschematools.client.paths.fakemultiplesecurities.get.responses.FakemultiplesecuritiesGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakemultiplesecurities; +import org.openapijsonschematools.client.paths.fakemultiplesecurities.get.FakemultiplesecuritiesGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new HttpBasicTest("someUserId", "somePassword"); +); +securitySchemes.add( + new ApiKey("someApiKey"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .fakemultiplesecuritiesGetSecurityRequirementObject0SecurityIndex(FakemultiplesecuritiesGetSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakemultiplesecurities apiClient = new Fakemultiplesecurities(apiConfiguration, schemaConfiguration); + + +var request = new FakemultiplesecuritiesGet.GetRequestBuilder().build(); + +FakemultiplesecuritiesGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakemultiplesecuritiesGetResponses.EndpointFakemultiplesecuritiesGetCode200Response castResponse = (FakemultiplesecuritiesGetResponses.EndpointFakemultiplesecuritiesGetCode200Response) response; +FakemultiplesecuritiesGetCode200Response.ApplicationjsonResponseBody deserializedBody = (FakemultiplesecuritiesGetCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakeobjinquery.md b/samples/client/petstore/java/docs/apis/paths/Fakeobjinquery.md new file mode 100644 index 00000000000..a383f132b30 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakeobjinquery.md @@ -0,0 +1,99 @@ +# Fakeobjinquery + +public class Fakeobjinquery extends extends ApiClient implements +[FakeobjinqueryGet.GetOperation](../../paths/fakeobjinquery/FakeobjinqueryGet.md#getoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeobjinqueryGetResponses.EndpointResponse](../../paths/fakeobjinquery/get/FakeobjinqueryGetResponses.md#endpointresponse) | [get](#get)([FakeobjinqueryGet.GetRequest](../../paths/fakeobjinquery/FakeobjinqueryGet.md#getrequest) request) | + +## Method Detail + +### get +public [FakeobjinqueryGetResponses.EndpointResponse](../../paths/fakeobjinquery/get/FakeobjinqueryGetResponses.md#endpointresponse) get([FakeobjinqueryGet.GetRequest](../../paths/fakeobjinquery/FakeobjinqueryGet.md#getrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakeobjinquery.get.FakeobjinqueryGetQueryParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeobjinquery.get.responses.FakeobjinqueryGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakeobjinquery; +import org.openapijsonschematools.client.paths.fakeobjinquery.get.FakeobjinqueryGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakeobjinquery apiClient = new Fakeobjinquery(apiConfiguration, schemaConfiguration); + + +var request = new FakeobjinqueryGet.GetRequestBuilder().build(); + +FakeobjinqueryGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeobjinqueryGetResponses.EndpointFakeobjinqueryGetCode200Response castResponse = (FakeobjinqueryGetResponses.EndpointFakeobjinqueryGetCode200Response) response; +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakeparametercollisions1ababselfab.md b/samples/client/petstore/java/docs/apis/paths/Fakeparametercollisions1ababselfab.md new file mode 100644 index 00000000000..23806a2f0eb --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakeparametercollisions1ababselfab.md @@ -0,0 +1,125 @@ +# Fakeparametercollisions1ababselfab + +public class Fakeparametercollisions1ababselfab extends extends ApiClient implements +[Fakeparametercollisions1ababselfabPost.PostOperation](../../paths/fakeparametercollisions1ababselfab/Fakeparametercollisions1ababselfabPost.md#postoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostResponses.EndpointResponse](../../paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostResponses.md#endpointresponse) | [post](#post)([Fakeparametercollisions1ababselfabPost.PostRequest](../../paths/fakeparametercollisions1ababselfab/Fakeparametercollisions1ababselfabPost.md#postrequest) request) | + +## Method Detail + +### post +public [Fakeparametercollisions1ababselfabPostResponses.EndpointResponse](../../paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostResponses.md#endpointresponse) post([Fakeparametercollisions1ababselfabPost.PostRequest](../../paths/fakeparametercollisions1ababselfab/Fakeparametercollisions1ababselfabPost.md#postrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Fakeparametercollisions1ababselfabPostRequestBody; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Fakeparametercollisions1ababselfabPostHeaderParameters; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Fakeparametercollisions1ababselfabPostQueryParameters; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Fakeparametercollisions1ababselfabPostCookieParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Fakeparametercollisions1ababselfabPostPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.responses.Fakeparametercollisions1ababselfabPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakeparametercollisions1ababselfab; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Fakeparametercollisions1ababselfabPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakeparametercollisions1ababselfab apiClient = new Fakeparametercollisions1ababselfab(apiConfiguration, schemaConfiguration); + + +// Map validation +Fakeparametercollisions1ababselfabPostPathParameters.Fakeparametercollisions1ababselfabPostPathParametersMap pathParameters = + Fakeparametercollisions1ababselfabPostPathParameters.Fakeparametercollisions1ababselfabPostPathParameters1.validate( + new Fakeparametercollisions1ababselfabPostPathParameters.Fakeparametercollisions1ababselfabPostPathParametersMapBuilder() + .positive1("a") + + .aHyphenMinusB("a") + + .Ab("a") + + .aB("a") + + .self("a") + + .build(), + schemaConfiguration +); + +var request = new Fakeparametercollisions1ababselfabPost.PostRequestBuilder() + .pathParameters(pathParameters) + .build(); + +Fakeparametercollisions1ababselfabPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +Fakeparametercollisions1ababselfabPostResponses.EndpointFakeparametercollisions1ababselfabPostCode200Response castResponse = (Fakeparametercollisions1ababselfabPostResponses.EndpointFakeparametercollisions1ababselfabPostCode200Response) response; +Fakeparametercollisions1ababselfabPostCode200Response.ApplicationjsonResponseBody deserializedBody = (Fakeparametercollisions1ababselfabPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakepemcontenttype.md b/samples/client/petstore/java/docs/apis/paths/Fakepemcontenttype.md new file mode 100644 index 00000000000..18fce17f986 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakepemcontenttype.md @@ -0,0 +1,102 @@ +# Fakepemcontenttype + +public class Fakepemcontenttype extends extends ApiClient implements +[FakepemcontenttypeGet.GetOperation](../../paths/fakepemcontenttype/FakepemcontenttypeGet.md#getoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakepemcontenttypeGetResponses.EndpointResponse](../../paths/fakepemcontenttype/get/FakepemcontenttypeGetResponses.md#endpointresponse) | [get](#get)([FakepemcontenttypeGet.GetRequest](../../paths/fakepemcontenttype/FakepemcontenttypeGet.md#getrequest) request) | + +## Method Detail + +### get +public [FakepemcontenttypeGetResponses.EndpointResponse](../../paths/fakepemcontenttype/get/FakepemcontenttypeGetResponses.md#endpointresponse) get([FakepemcontenttypeGet.GetRequest](../../paths/fakepemcontenttype/FakepemcontenttypeGet.md#getrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakepemcontenttype.get.FakepemcontenttypeGetRequestBody; +import org.openapijsonschematools.client.paths.fakepemcontenttype.get.requestbody.content.applicationxpemfile.ApplicationxpemfileSchema; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakepemcontenttype.get.responses.FakepemcontenttypeGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakepemcontenttype; +import org.openapijsonschematools.client.paths.fakepemcontenttype.get.FakepemcontenttypeGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakepemcontenttype apiClient = new Fakepemcontenttype(apiConfiguration, schemaConfiguration); + + +var request = new FakepemcontenttypeGet.GetRequestBuilder().build(); + +FakepemcontenttypeGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakepemcontenttypeGetResponses.EndpointFakepemcontenttypeGetCode200Response castResponse = (FakepemcontenttypeGetResponses.EndpointFakepemcontenttypeGetCode200Response) response; +FakepemcontenttypeGetCode200Response.ApplicationxpemfileResponseBody deserializedBody = (FakepemcontenttypeGetCode200Response.ApplicationxpemfileResponseBody) castResponse.body; +// handle deserialized body here +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakepetiduploadimagewithrequiredfile.md b/samples/client/petstore/java/docs/apis/paths/Fakepetiduploadimagewithrequiredfile.md new file mode 100644 index 00000000000..3e3cf8a69ff --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakepetiduploadimagewithrequiredfile.md @@ -0,0 +1,125 @@ +# Fakepetiduploadimagewithrequiredfile + +public class Fakepetiduploadimagewithrequiredfile extends extends ApiClient implements +[FakepetiduploadimagewithrequiredfilePost.PostOperation](../../paths/fakepetiduploadimagewithrequiredfile/FakepetiduploadimagewithrequiredfilePost.md#postoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakepetiduploadimagewithrequiredfilePostResponses.EndpointResponse](../../paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostResponses.md#endpointresponse) | [post](#post)([FakepetiduploadimagewithrequiredfilePost.PostRequest](../../paths/fakepetiduploadimagewithrequiredfile/FakepetiduploadimagewithrequiredfilePost.md#postrequest) request)
| + +## Method Detail + +### post +public [FakepetiduploadimagewithrequiredfilePostResponses.EndpointResponse](../../paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostResponses.md#endpointresponse) post([FakepetiduploadimagewithrequiredfilePost.PostRequest](../../paths/fakepetiduploadimagewithrequiredfile/FakepetiduploadimagewithrequiredfilePost.md#postrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.FakepetiduploadimagewithrequiredfilePostRequestBody; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.FakepetiduploadimagewithrequiredfilePostSecurityInfo; +import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.FakepetiduploadimagewithrequiredfilePostPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; +import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.responses.FakepetiduploadimagewithrequiredfilePostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakepetiduploadimagewithrequiredfile; +import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.FakepetiduploadimagewithrequiredfilePostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .fakepetiduploadimagewithrequiredfilePostSecurityRequirementObject0SecurityIndex(FakepetiduploadimagewithrequiredfilePostSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakepetiduploadimagewithrequiredfile apiClient = new Fakepetiduploadimagewithrequiredfile(apiConfiguration, schemaConfiguration); + + +// Map validation +FakepetiduploadimagewithrequiredfilePostPathParameters.FakepetiduploadimagewithrequiredfilePostPathParametersMap pathParameters = + FakepetiduploadimagewithrequiredfilePostPathParameters.FakepetiduploadimagewithrequiredfilePostPathParameters1.validate( + new FakepetiduploadimagewithrequiredfilePostPathParameters.FakepetiduploadimagewithrequiredfilePostPathParametersMapBuilder() + .petId(1L) + + .build(), + schemaConfiguration +); + +var request = new FakepetiduploadimagewithrequiredfilePost.PostRequestBuilder() + .pathParameters(pathParameters) + .build(); + +FakepetiduploadimagewithrequiredfilePostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakepetiduploadimagewithrequiredfilePostResponses.EndpointFakepetiduploadimagewithrequiredfilePostCode200Response castResponse = (FakepetiduploadimagewithrequiredfilePostResponses.EndpointFakepetiduploadimagewithrequiredfilePostCode200Response) response; +FakepetiduploadimagewithrequiredfilePostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakepetiduploadimagewithrequiredfilePostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakequeryparamwithjsoncontenttype.md b/samples/client/petstore/java/docs/apis/paths/Fakequeryparamwithjsoncontenttype.md new file mode 100644 index 00000000000..048136b6176 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakequeryparamwithjsoncontenttype.md @@ -0,0 +1,111 @@ +# Fakequeryparamwithjsoncontenttype + +public class Fakequeryparamwithjsoncontenttype extends extends ApiClient implements +[FakequeryparamwithjsoncontenttypeGet.GetOperation](../../paths/fakequeryparamwithjsoncontenttype/FakequeryparamwithjsoncontenttypeGet.md#getoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakequeryparamwithjsoncontenttypeGetResponses.EndpointResponse](../../paths/fakequeryparamwithjsoncontenttype/get/FakequeryparamwithjsoncontenttypeGetResponses.md#endpointresponse) | [get](#get)([FakequeryparamwithjsoncontenttypeGet.GetRequest](../../paths/fakequeryparamwithjsoncontenttype/FakequeryparamwithjsoncontenttypeGet.md#getrequest) request) | + +## Method Detail + +### get +public [FakequeryparamwithjsoncontenttypeGetResponses.EndpointResponse](../../paths/fakequeryparamwithjsoncontenttype/get/FakequeryparamwithjsoncontenttypeGetResponses.md#endpointresponse) get([FakequeryparamwithjsoncontenttypeGet.GetRequest](../../paths/fakequeryparamwithjsoncontenttype/FakequeryparamwithjsoncontenttypeGet.md#getrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.FakequeryparamwithjsoncontenttypeGetQueryParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.responses.FakequeryparamwithjsoncontenttypeGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakequeryparamwithjsoncontenttype; +import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.FakequeryparamwithjsoncontenttypeGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakequeryparamwithjsoncontenttype apiClient = new Fakequeryparamwithjsoncontenttype(apiConfiguration, schemaConfiguration); + + +// Map validation +FakequeryparamwithjsoncontenttypeGetQueryParameters.FakequeryparamwithjsoncontenttypeGetQueryParametersMap queryParameters = + FakequeryparamwithjsoncontenttypeGetQueryParameters.FakequeryparamwithjsoncontenttypeGetQueryParameters1.validate( + new FakequeryparamwithjsoncontenttypeGetQueryParameters.FakequeryparamwithjsoncontenttypeGetQueryParametersMapBuilder() + .build(), + schemaConfiguration +); + +var request = new FakequeryparamwithjsoncontenttypeGet.GetRequestBuilder() + .queryParameters(queryParameters) + .build(); + +FakequeryparamwithjsoncontenttypeGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakequeryparamwithjsoncontenttypeGetResponses.EndpointFakequeryparamwithjsoncontenttypeGetCode200Response castResponse = (FakequeryparamwithjsoncontenttypeGetResponses.EndpointFakequeryparamwithjsoncontenttypeGetCode200Response) response; +FakequeryparamwithjsoncontenttypeGetCode200Response.ApplicationjsonResponseBody deserializedBody = (FakequeryparamwithjsoncontenttypeGetCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakeredirection.md b/samples/client/petstore/java/docs/apis/paths/Fakeredirection.md new file mode 100644 index 00000000000..1f29bd52cdc --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakeredirection.md @@ -0,0 +1,102 @@ +# Fakeredirection + +public class Fakeredirection extends extends ApiClient implements +[FakeredirectionGet.GetOperation](../../paths/fakeredirection/FakeredirectionGet.md#getoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeredirectionGetResponses.EndpointResponse](../../paths/fakeredirection/get/FakeredirectionGetResponses.md#endpointresponse) | [get](#get)([FakeredirectionGet.GetRequest](../../paths/fakeredirection/FakeredirectionGet.md#getrequest) request) | + +## Method Detail + +### get +public [FakeredirectionGetResponses.EndpointResponse](../../paths/fakeredirection/get/FakeredirectionGetResponses.md#endpointresponse) get([FakeredirectionGet.GetRequest](../../paths/fakeredirection/FakeredirectionGet.md#getrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeredirection.get.responses.FakeredirectionGetCode303Response; +import org.openapijsonschematools.client.paths.fakeredirection.get.responses.FakeredirectionGetCode3XXResponse; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakeredirection; +import org.openapijsonschematools.client.paths.fakeredirection.get.FakeredirectionGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakeredirection apiClient = new Fakeredirection(apiConfiguration, schemaConfiguration); + + +var request = new FakeredirectionGet.GetRequestBuilder().build(); + +FakeredirectionGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +if (response instanceof FakeredirectionGetResponses.EndpointFakeredirectionGetCode3XXResponse castResponse) { +} else { + FakeredirectionGetResponses.EndpointFakeredirectionGetCode303Response castResponse = (FakeredirectionGetResponses.EndpointFakeredirectionGetCode303Response) response; +} +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakerefobjinquery.md b/samples/client/petstore/java/docs/apis/paths/Fakerefobjinquery.md new file mode 100644 index 00000000000..94fd1062d39 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakerefobjinquery.md @@ -0,0 +1,99 @@ +# Fakerefobjinquery + +public class Fakerefobjinquery extends extends ApiClient implements +[FakerefobjinqueryGet.GetOperation](../../paths/fakerefobjinquery/FakerefobjinqueryGet.md#getoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefobjinqueryGetResponses.EndpointResponse](../../paths/fakerefobjinquery/get/FakerefobjinqueryGetResponses.md#endpointresponse) | [get](#get)([FakerefobjinqueryGet.GetRequest](../../paths/fakerefobjinquery/FakerefobjinqueryGet.md#getrequest) request) | + +## Method Detail + +### get +public [FakerefobjinqueryGetResponses.EndpointResponse](../../paths/fakerefobjinquery/get/FakerefobjinqueryGetResponses.md#endpointresponse) get([FakerefobjinqueryGet.GetRequest](../../paths/fakerefobjinquery/FakerefobjinqueryGet.md#getrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakerefobjinquery.get.FakerefobjinqueryGetQueryParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefobjinquery.get.responses.FakerefobjinqueryGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakerefobjinquery; +import org.openapijsonschematools.client.paths.fakerefobjinquery.get.FakerefobjinqueryGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakerefobjinquery apiClient = new Fakerefobjinquery(apiConfiguration, schemaConfiguration); + + +var request = new FakerefobjinqueryGet.GetRequestBuilder().build(); + +FakerefobjinqueryGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefobjinqueryGetResponses.EndpointFakerefobjinqueryGetCode200Response castResponse = (FakerefobjinqueryGetResponses.EndpointFakerefobjinqueryGetCode200Response) response; +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakerefsarraymodel.md b/samples/client/petstore/java/docs/apis/paths/Fakerefsarraymodel.md new file mode 100644 index 00000000000..4815ab1fcd6 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakerefsarraymodel.md @@ -0,0 +1,104 @@ +# Fakerefsarraymodel + +public class Fakerefsarraymodel extends extends ApiClient implements +[FakerefsarraymodelPost.PostOperation](../../paths/fakerefsarraymodel/FakerefsarraymodelPost.md#postoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefsarraymodelPostResponses.EndpointResponse](../../paths/fakerefsarraymodel/post/FakerefsarraymodelPostResponses.md#endpointresponse) | [post](#post)([FakerefsarraymodelPost.PostRequest](../../paths/fakerefsarraymodel/FakerefsarraymodelPost.md#postrequest) request)
Test serialization of ArrayModel | + +## Method Detail + +### post +public [FakerefsarraymodelPostResponses.EndpointResponse](../../paths/fakerefsarraymodel/post/FakerefsarraymodelPostResponses.md#endpointresponse) post([FakerefsarraymodelPost.PostRequest](../../paths/fakerefsarraymodel/FakerefsarraymodelPost.md#postrequest) request) + +Test serialization of ArrayModel + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakerefsarraymodel.post.FakerefsarraymodelPostRequestBody; +import org.openapijsonschematools.client.components.schemas.AnimalFarm; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefsarraymodel.post.responses.FakerefsarraymodelPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakerefsarraymodel; +import org.openapijsonschematools.client.paths.fakerefsarraymodel.post.FakerefsarraymodelPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakerefsarraymodel apiClient = new Fakerefsarraymodel(apiConfiguration, schemaConfiguration); + + +var request = new FakerefsarraymodelPost.PostRequestBuilder().build(); + +FakerefsarraymodelPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefsarraymodelPostResponses.EndpointFakerefsarraymodelPostCode200Response castResponse = (FakerefsarraymodelPostResponses.EndpointFakerefsarraymodelPostCode200Response) response; +FakerefsarraymodelPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakerefsarraymodelPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakerefsarrayofenums.md b/samples/client/petstore/java/docs/apis/paths/Fakerefsarrayofenums.md new file mode 100644 index 00000000000..fbc4673af87 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakerefsarrayofenums.md @@ -0,0 +1,102 @@ +# Fakerefsarrayofenums + +public class Fakerefsarrayofenums extends extends ApiClient implements +[FakerefsarrayofenumsPost.PostOperation](../../paths/fakerefsarrayofenums/FakerefsarrayofenumsPost.md#postoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefsarrayofenumsPostResponses.EndpointResponse](../../paths/fakerefsarrayofenums/post/FakerefsarrayofenumsPostResponses.md#endpointresponse) | [post](#post)([FakerefsarrayofenumsPost.PostRequest](../../paths/fakerefsarrayofenums/FakerefsarrayofenumsPost.md#postrequest) request) | + +## Method Detail + +### post +public [FakerefsarrayofenumsPostResponses.EndpointResponse](../../paths/fakerefsarrayofenums/post/FakerefsarrayofenumsPostResponses.md#endpointresponse) post([FakerefsarrayofenumsPost.PostRequest](../../paths/fakerefsarrayofenums/FakerefsarrayofenumsPost.md#postrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakerefsarrayofenums.post.FakerefsarrayofenumsPostRequestBody; +import org.openapijsonschematools.client.components.schemas.ArrayOfEnums; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefsarrayofenums.post.responses.FakerefsarrayofenumsPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakerefsarrayofenums; +import org.openapijsonschematools.client.paths.fakerefsarrayofenums.post.FakerefsarrayofenumsPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakerefsarrayofenums apiClient = new Fakerefsarrayofenums(apiConfiguration, schemaConfiguration); + + +var request = new FakerefsarrayofenumsPost.PostRequestBuilder().build(); + +FakerefsarrayofenumsPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefsarrayofenumsPostResponses.EndpointFakerefsarrayofenumsPostCode200Response castResponse = (FakerefsarrayofenumsPostResponses.EndpointFakerefsarrayofenumsPostCode200Response) response; +FakerefsarrayofenumsPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakerefsarrayofenumsPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakerefsboolean.md b/samples/client/petstore/java/docs/apis/paths/Fakerefsboolean.md new file mode 100644 index 00000000000..9e19a6b1aad --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakerefsboolean.md @@ -0,0 +1,104 @@ +# Fakerefsboolean + +public class Fakerefsboolean extends extends ApiClient implements +[FakerefsbooleanPost.PostOperation](../../paths/fakerefsboolean/FakerefsbooleanPost.md#postoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefsbooleanPostResponses.EndpointResponse](../../paths/fakerefsboolean/post/FakerefsbooleanPostResponses.md#endpointresponse) | [post](#post)([FakerefsbooleanPost.PostRequest](../../paths/fakerefsboolean/FakerefsbooleanPost.md#postrequest) request)
Test serialization of outer boolean types | + +## Method Detail + +### post +public [FakerefsbooleanPostResponses.EndpointResponse](../../paths/fakerefsboolean/post/FakerefsbooleanPostResponses.md#endpointresponse) post([FakerefsbooleanPost.PostRequest](../../paths/fakerefsboolean/FakerefsbooleanPost.md#postrequest) request) + +Test serialization of outer boolean types + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakerefsboolean.post.FakerefsbooleanPostRequestBody; +import org.openapijsonschematools.client.components.schemas.BooleanSchema; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefsboolean.post.responses.FakerefsbooleanPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakerefsboolean; +import org.openapijsonschematools.client.paths.fakerefsboolean.post.FakerefsbooleanPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakerefsboolean apiClient = new Fakerefsboolean(apiConfiguration, schemaConfiguration); + + +var request = new FakerefsbooleanPost.PostRequestBuilder().build(); + +FakerefsbooleanPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefsbooleanPostResponses.EndpointFakerefsbooleanPostCode200Response castResponse = (FakerefsbooleanPostResponses.EndpointFakerefsbooleanPostCode200Response) response; +FakerefsbooleanPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakerefsbooleanPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakerefscomposedoneofnumberwithvalidations.md b/samples/client/petstore/java/docs/apis/paths/Fakerefscomposedoneofnumberwithvalidations.md new file mode 100644 index 00000000000..69e82a51a44 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakerefscomposedoneofnumberwithvalidations.md @@ -0,0 +1,104 @@ +# Fakerefscomposedoneofnumberwithvalidations + +public class Fakerefscomposedoneofnumberwithvalidations extends extends ApiClient implements +[FakerefscomposedoneofnumberwithvalidationsPost.PostOperation](../../paths/fakerefscomposedoneofnumberwithvalidations/FakerefscomposedoneofnumberwithvalidationsPost.md#postoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefscomposedoneofnumberwithvalidationsPostResponses.EndpointResponse](../../paths/fakerefscomposedoneofnumberwithvalidations/post/FakerefscomposedoneofnumberwithvalidationsPostResponses.md#endpointresponse) | [post](#post)([FakerefscomposedoneofnumberwithvalidationsPost.PostRequest](../../paths/fakerefscomposedoneofnumberwithvalidations/FakerefscomposedoneofnumberwithvalidationsPost.md#postrequest) request)
Test serialization of object with $refed properties | + +## Method Detail + +### post +public [FakerefscomposedoneofnumberwithvalidationsPostResponses.EndpointResponse](../../paths/fakerefscomposedoneofnumberwithvalidations/post/FakerefscomposedoneofnumberwithvalidationsPostResponses.md#endpointresponse) post([FakerefscomposedoneofnumberwithvalidationsPost.PostRequest](../../paths/fakerefscomposedoneofnumberwithvalidations/FakerefscomposedoneofnumberwithvalidationsPost.md#postrequest) request) + +Test serialization of object with $refed properties + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post.FakerefscomposedoneofnumberwithvalidationsPostRequestBody; +import org.openapijsonschematools.client.components.schemas.ComposedOneOfDifferentTypes; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post.responses.FakerefscomposedoneofnumberwithvalidationsPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakerefscomposedoneofnumberwithvalidations; +import org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post.FakerefscomposedoneofnumberwithvalidationsPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakerefscomposedoneofnumberwithvalidations apiClient = new Fakerefscomposedoneofnumberwithvalidations(apiConfiguration, schemaConfiguration); + + +var request = new FakerefscomposedoneofnumberwithvalidationsPost.PostRequestBuilder().build(); + +FakerefscomposedoneofnumberwithvalidationsPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefscomposedoneofnumberwithvalidationsPostResponses.EndpointFakerefscomposedoneofnumberwithvalidationsPostCode200Response castResponse = (FakerefscomposedoneofnumberwithvalidationsPostResponses.EndpointFakerefscomposedoneofnumberwithvalidationsPostCode200Response) response; +FakerefscomposedoneofnumberwithvalidationsPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakerefscomposedoneofnumberwithvalidationsPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakerefsenum.md b/samples/client/petstore/java/docs/apis/paths/Fakerefsenum.md new file mode 100644 index 00000000000..10a341f972d --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakerefsenum.md @@ -0,0 +1,104 @@ +# Fakerefsenum + +public class Fakerefsenum extends extends ApiClient implements +[FakerefsenumPost.PostOperation](../../paths/fakerefsenum/FakerefsenumPost.md#postoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefsenumPostResponses.EndpointResponse](../../paths/fakerefsenum/post/FakerefsenumPostResponses.md#endpointresponse) | [post](#post)([FakerefsenumPost.PostRequest](../../paths/fakerefsenum/FakerefsenumPost.md#postrequest) request)
Test serialization of outer enum | + +## Method Detail + +### post +public [FakerefsenumPostResponses.EndpointResponse](../../paths/fakerefsenum/post/FakerefsenumPostResponses.md#endpointresponse) post([FakerefsenumPost.PostRequest](../../paths/fakerefsenum/FakerefsenumPost.md#postrequest) request) + +Test serialization of outer enum + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakerefsenum.post.FakerefsenumPostRequestBody; +import org.openapijsonschematools.client.components.schemas.StringEnum; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefsenum.post.responses.FakerefsenumPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakerefsenum; +import org.openapijsonschematools.client.paths.fakerefsenum.post.FakerefsenumPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakerefsenum apiClient = new Fakerefsenum(apiConfiguration, schemaConfiguration); + + +var request = new FakerefsenumPost.PostRequestBuilder().build(); + +FakerefsenumPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefsenumPostResponses.EndpointFakerefsenumPostCode200Response castResponse = (FakerefsenumPostResponses.EndpointFakerefsenumPostCode200Response) response; +FakerefsenumPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakerefsenumPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakerefsmammal.md b/samples/client/petstore/java/docs/apis/paths/Fakerefsmammal.md new file mode 100644 index 00000000000..94b62b69921 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakerefsmammal.md @@ -0,0 +1,107 @@ +# Fakerefsmammal + +public class Fakerefsmammal extends extends ApiClient implements +[FakerefsmammalPost.PostOperation](../../paths/fakerefsmammal/FakerefsmammalPost.md#postoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefsmammalPostResponses.EndpointResponse](../../paths/fakerefsmammal/post/FakerefsmammalPostResponses.md#endpointresponse) | [post](#post)([FakerefsmammalPost.PostRequest](../../paths/fakerefsmammal/FakerefsmammalPost.md#postrequest) request)
Test serialization of mammals | + +## Method Detail + +### post +public [FakerefsmammalPostResponses.EndpointResponse](../../paths/fakerefsmammal/post/FakerefsmammalPostResponses.md#endpointresponse) post([FakerefsmammalPost.PostRequest](../../paths/fakerefsmammal/FakerefsmammalPost.md#postrequest) request) + +Test serialization of mammals + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakerefsmammal.post.FakerefsmammalPostRequestBody; +import org.openapijsonschematools.client.components.schemas.Mammal; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefsmammal.post.responses.FakerefsmammalPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakerefsmammal; +import org.openapijsonschematools.client.paths.fakerefsmammal.post.FakerefsmammalPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakerefsmammal apiClient = new Fakerefsmammal(apiConfiguration, schemaConfiguration); + +FakerefsmammalPost.SealedRequestBody requestBody = new FakerefsmammalPost.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new FakerefsmammalPost.PostRequestBuilder() + .requestBody(requestBody) + .build(); + +FakerefsmammalPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefsmammalPostResponses.EndpointFakerefsmammalPostCode200Response castResponse = (FakerefsmammalPostResponses.EndpointFakerefsmammalPostCode200Response) response; +FakerefsmammalPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakerefsmammalPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakerefsnumber.md b/samples/client/petstore/java/docs/apis/paths/Fakerefsnumber.md new file mode 100644 index 00000000000..b593a13459a --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakerefsnumber.md @@ -0,0 +1,104 @@ +# Fakerefsnumber + +public class Fakerefsnumber extends extends ApiClient implements +[FakerefsnumberPost.PostOperation](../../paths/fakerefsnumber/FakerefsnumberPost.md#postoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefsnumberPostResponses.EndpointResponse](../../paths/fakerefsnumber/post/FakerefsnumberPostResponses.md#endpointresponse) | [post](#post)([FakerefsnumberPost.PostRequest](../../paths/fakerefsnumber/FakerefsnumberPost.md#postrequest) request)
Test serialization of outer number types | + +## Method Detail + +### post +public [FakerefsnumberPostResponses.EndpointResponse](../../paths/fakerefsnumber/post/FakerefsnumberPostResponses.md#endpointresponse) post([FakerefsnumberPost.PostRequest](../../paths/fakerefsnumber/FakerefsnumberPost.md#postrequest) request) + +Test serialization of outer number types + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakerefsnumber.post.FakerefsnumberPostRequestBody; +import org.openapijsonschematools.client.components.schemas.NumberWithValidations; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefsnumber.post.responses.FakerefsnumberPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakerefsnumber; +import org.openapijsonschematools.client.paths.fakerefsnumber.post.FakerefsnumberPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakerefsnumber apiClient = new Fakerefsnumber(apiConfiguration, schemaConfiguration); + + +var request = new FakerefsnumberPost.PostRequestBuilder().build(); + +FakerefsnumberPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefsnumberPostResponses.EndpointFakerefsnumberPostCode200Response castResponse = (FakerefsnumberPostResponses.EndpointFakerefsnumberPostCode200Response) response; +FakerefsnumberPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakerefsnumberPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakerefsobjectmodelwithrefprops.md b/samples/client/petstore/java/docs/apis/paths/Fakerefsobjectmodelwithrefprops.md new file mode 100644 index 00000000000..a988e195113 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakerefsobjectmodelwithrefprops.md @@ -0,0 +1,104 @@ +# Fakerefsobjectmodelwithrefprops + +public class Fakerefsobjectmodelwithrefprops extends extends ApiClient implements +[FakerefsobjectmodelwithrefpropsPost.PostOperation](../../paths/fakerefsobjectmodelwithrefprops/FakerefsobjectmodelwithrefpropsPost.md#postoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefsobjectmodelwithrefpropsPostResponses.EndpointResponse](../../paths/fakerefsobjectmodelwithrefprops/post/FakerefsobjectmodelwithrefpropsPostResponses.md#endpointresponse) | [post](#post)([FakerefsobjectmodelwithrefpropsPost.PostRequest](../../paths/fakerefsobjectmodelwithrefprops/FakerefsobjectmodelwithrefpropsPost.md#postrequest) request)
Test serialization of object with $refed properties | + +## Method Detail + +### post +public [FakerefsobjectmodelwithrefpropsPostResponses.EndpointResponse](../../paths/fakerefsobjectmodelwithrefprops/post/FakerefsobjectmodelwithrefpropsPostResponses.md#endpointresponse) post([FakerefsobjectmodelwithrefpropsPost.PostRequest](../../paths/fakerefsobjectmodelwithrefprops/FakerefsobjectmodelwithrefpropsPost.md#postrequest) request) + +Test serialization of object with $refed properties + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post.FakerefsobjectmodelwithrefpropsPostRequestBody; +import org.openapijsonschematools.client.components.schemas.ObjectModelWithRefProps; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post.responses.FakerefsobjectmodelwithrefpropsPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakerefsobjectmodelwithrefprops; +import org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post.FakerefsobjectmodelwithrefpropsPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakerefsobjectmodelwithrefprops apiClient = new Fakerefsobjectmodelwithrefprops(apiConfiguration, schemaConfiguration); + + +var request = new FakerefsobjectmodelwithrefpropsPost.PostRequestBuilder().build(); + +FakerefsobjectmodelwithrefpropsPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefsobjectmodelwithrefpropsPostResponses.EndpointFakerefsobjectmodelwithrefpropsPostCode200Response castResponse = (FakerefsobjectmodelwithrefpropsPostResponses.EndpointFakerefsobjectmodelwithrefpropsPostCode200Response) response; +FakerefsobjectmodelwithrefpropsPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakerefsobjectmodelwithrefpropsPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakerefsstring.md b/samples/client/petstore/java/docs/apis/paths/Fakerefsstring.md new file mode 100644 index 00000000000..a372887c2d2 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakerefsstring.md @@ -0,0 +1,104 @@ +# Fakerefsstring + +public class Fakerefsstring extends extends ApiClient implements +[FakerefsstringPost.PostOperation](../../paths/fakerefsstring/FakerefsstringPost.md#postoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefsstringPostResponses.EndpointResponse](../../paths/fakerefsstring/post/FakerefsstringPostResponses.md#endpointresponse) | [post](#post)([FakerefsstringPost.PostRequest](../../paths/fakerefsstring/FakerefsstringPost.md#postrequest) request)
Test serialization of outer string types | + +## Method Detail + +### post +public [FakerefsstringPostResponses.EndpointResponse](../../paths/fakerefsstring/post/FakerefsstringPostResponses.md#endpointresponse) post([FakerefsstringPost.PostRequest](../../paths/fakerefsstring/FakerefsstringPost.md#postrequest) request) + +Test serialization of outer string types + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakerefsstring.post.FakerefsstringPostRequestBody; +import org.openapijsonschematools.client.components.schemas.StringSchema; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefsstring.post.responses.FakerefsstringPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakerefsstring; +import org.openapijsonschematools.client.paths.fakerefsstring.post.FakerefsstringPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakerefsstring apiClient = new Fakerefsstring(apiConfiguration, schemaConfiguration); + + +var request = new FakerefsstringPost.PostRequestBuilder().build(); + +FakerefsstringPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefsstringPostResponses.EndpointFakerefsstringPostCode200Response castResponse = (FakerefsstringPostResponses.EndpointFakerefsstringPostCode200Response) response; +FakerefsstringPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakerefsstringPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakeresponsewithoutschema.md b/samples/client/petstore/java/docs/apis/paths/Fakeresponsewithoutschema.md new file mode 100644 index 00000000000..64239e7a307 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakeresponsewithoutschema.md @@ -0,0 +1,98 @@ +# Fakeresponsewithoutschema + +public class Fakeresponsewithoutschema extends extends ApiClient implements +[FakeresponsewithoutschemaGet.GetOperation](../../paths/fakeresponsewithoutschema/FakeresponsewithoutschemaGet.md#getoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeresponsewithoutschemaGetResponses.EndpointResponse](../../paths/fakeresponsewithoutschema/get/FakeresponsewithoutschemaGetResponses.md#endpointresponse) | [get](#get)([FakeresponsewithoutschemaGet.GetRequest](../../paths/fakeresponsewithoutschema/FakeresponsewithoutschemaGet.md#getrequest) request) | + +## Method Detail + +### get +public [FakeresponsewithoutschemaGetResponses.EndpointResponse](../../paths/fakeresponsewithoutschema/get/FakeresponsewithoutschemaGetResponses.md#endpointresponse) get([FakeresponsewithoutschemaGet.GetRequest](../../paths/fakeresponsewithoutschema/FakeresponsewithoutschemaGet.md#getrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeresponsewithoutschema.get.responses.FakeresponsewithoutschemaGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakeresponsewithoutschema; +import org.openapijsonschematools.client.paths.fakeresponsewithoutschema.get.FakeresponsewithoutschemaGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakeresponsewithoutschema apiClient = new Fakeresponsewithoutschema(apiConfiguration, schemaConfiguration); + + +var request = new FakeresponsewithoutschemaGet.GetRequestBuilder().build(); + +FakeresponsewithoutschemaGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeresponsewithoutschemaGetResponses.EndpointFakeresponsewithoutschemaGetCode200Response castResponse = (FakeresponsewithoutschemaGetResponses.EndpointFakeresponsewithoutschemaGetCode200Response) response; +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Faketestqueryparamters.md b/samples/client/petstore/java/docs/apis/paths/Faketestqueryparamters.md new file mode 100644 index 00000000000..157b2bb97fc --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Faketestqueryparamters.md @@ -0,0 +1,138 @@ +# Faketestqueryparamters + +public class Faketestqueryparamters extends extends ApiClient implements +[FaketestqueryparamtersPut.PutOperation](../../paths/faketestqueryparamters/FaketestqueryparamtersPut.md#putoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutResponses.EndpointResponse](../../paths/faketestqueryparamters/put/FaketestqueryparamtersPutResponses.md#endpointresponse) | [put](#put)([FaketestqueryparamtersPut.PutRequest](../../paths/faketestqueryparamters/FaketestqueryparamtersPut.md#putrequest) request)
To test the collection format in query parameters | + +## Method Detail + +### put +public [FaketestqueryparamtersPutResponses.EndpointResponse](../../paths/faketestqueryparamters/put/FaketestqueryparamtersPutResponses.md#endpointresponse) put([FaketestqueryparamtersPut.PutRequest](../../paths/faketestqueryparamters/FaketestqueryparamtersPut.md#putrequest) request) + +To test the collection format in query parameters + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.faketestqueryparamters.put.FaketestqueryparamtersPutQueryParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.faketestqueryparamters.put.responses.FaketestqueryparamtersPutCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Faketestqueryparamters; +import org.openapijsonschematools.client.paths.faketestqueryparamters.put.FaketestqueryparamtersPutResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Faketestqueryparamters apiClient = new Faketestqueryparamters(apiConfiguration, schemaConfiguration); + + +// Map validation +FaketestqueryparamtersPutQueryParameters.FaketestqueryparamtersPutQueryParametersMap queryParameters = + FaketestqueryparamtersPutQueryParameters.FaketestqueryparamtersPutQueryParameters1.validate( + new FaketestqueryparamtersPutQueryParameters.FaketestqueryparamtersPutQueryParametersMapBuilder() + .context( + Arrays.asList( + "a" + ) + ) + .http( + Arrays.asList( + "a" + ) + ) + .ioutil( + Arrays.asList( + "a" + ) + ) + .pipe( + Arrays.asList( + "a" + ) + ) + .refParam("a") + + .url( + Arrays.asList( + "a" + ) + ) + .build(), + schemaConfiguration +); + +var request = new FaketestqueryparamtersPut.PutRequestBuilder() + .queryParameters(queryParameters) + .build(); + +FaketestqueryparamtersPutResponses.EndpointResponse response; +try { + response = apiClient.put(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FaketestqueryparamtersPutResponses.EndpointFaketestqueryparamtersPutCode200Response castResponse = (FaketestqueryparamtersPutResponses.EndpointFaketestqueryparamtersPutCode200Response) response; +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakeuploaddownloadfile.md b/samples/client/petstore/java/docs/apis/paths/Fakeuploaddownloadfile.md new file mode 100644 index 00000000000..88ee0cac610 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakeuploaddownloadfile.md @@ -0,0 +1,112 @@ +# Fakeuploaddownloadfile + +public class Fakeuploaddownloadfile extends extends ApiClient implements +[FakeuploaddownloadfilePost.PostOperation](../../paths/fakeuploaddownloadfile/FakeuploaddownloadfilePost.md#postoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeuploaddownloadfilePostResponses.EndpointResponse](../../paths/fakeuploaddownloadfile/post/FakeuploaddownloadfilePostResponses.md#endpointresponse) | [post](#post)([FakeuploaddownloadfilePost.PostRequest](../../paths/fakeuploaddownloadfile/FakeuploaddownloadfilePost.md#postrequest) request)
| + +## Method Detail + +### post +public [FakeuploaddownloadfilePostResponses.EndpointResponse](../../paths/fakeuploaddownloadfile/post/FakeuploaddownloadfilePostResponses.md#endpointresponse) post([FakeuploaddownloadfilePost.PostRequest](../../paths/fakeuploaddownloadfile/FakeuploaddownloadfilePost.md#postrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.FakeuploaddownloadfilePostRequestBody; +import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.requestbody.content.applicationoctetstream.ApplicationoctetstreamSchema; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.responses.FakeuploaddownloadfilePostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakeuploaddownloadfile; +import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.FakeuploaddownloadfilePostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakeuploaddownloadfile apiClient = new Fakeuploaddownloadfile(apiConfiguration, schemaConfiguration); + + +ApplicationoctetstreamSchema1BoxedString requestBodyPayload = ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1.validateAndBox( + "a", + schemaConfiguration +); +FakeuploaddownloadfilePost.SealedRequestBody requestBody = new FakeuploaddownloadfilePost.ApplicationoctetstreamRequestBody(requestBodyPayload); + +var request = new FakeuploaddownloadfilePost.PostRequestBuilder() + .requestBody(requestBody) + .build(); + +FakeuploaddownloadfilePostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeuploaddownloadfilePostResponses.EndpointFakeuploaddownloadfilePostCode200Response castResponse = (FakeuploaddownloadfilePostResponses.EndpointFakeuploaddownloadfilePostCode200Response) response; +FakeuploaddownloadfilePostCode200Response.ApplicationoctetstreamResponseBody deserializedBody = (FakeuploaddownloadfilePostCode200Response.ApplicationoctetstreamResponseBody) castResponse.body; +// handle deserialized body here +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakeuploadfile.md b/samples/client/petstore/java/docs/apis/paths/Fakeuploadfile.md new file mode 100644 index 00000000000..828373121b2 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakeuploadfile.md @@ -0,0 +1,104 @@ +# Fakeuploadfile + +public class Fakeuploadfile extends extends ApiClient implements +[FakeuploadfilePost.PostOperation](../../paths/fakeuploadfile/FakeuploadfilePost.md#postoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeuploadfilePostResponses.EndpointResponse](../../paths/fakeuploadfile/post/FakeuploadfilePostResponses.md#endpointresponse) | [post](#post)([FakeuploadfilePost.PostRequest](../../paths/fakeuploadfile/FakeuploadfilePost.md#postrequest) request)
| + +## Method Detail + +### post +public [FakeuploadfilePostResponses.EndpointResponse](../../paths/fakeuploadfile/post/FakeuploadfilePostResponses.md#endpointresponse) post([FakeuploadfilePost.PostRequest](../../paths/fakeuploadfile/FakeuploadfilePost.md#postrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakeuploadfile.post.FakeuploadfilePostRequestBody; +import org.openapijsonschematools.client.paths.fakeuploadfile.post.requestbody.content.multipartformdata.MultipartformdataSchema; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeuploadfile.post.responses.FakeuploadfilePostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakeuploadfile; +import org.openapijsonschematools.client.paths.fakeuploadfile.post.FakeuploadfilePostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakeuploadfile apiClient = new Fakeuploadfile(apiConfiguration, schemaConfiguration); + + +var request = new FakeuploadfilePost.PostRequestBuilder().build(); + +FakeuploadfilePostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeuploadfilePostResponses.EndpointFakeuploadfilePostCode200Response castResponse = (FakeuploadfilePostResponses.EndpointFakeuploadfilePostCode200Response) response; +FakeuploadfilePostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakeuploadfilePostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakeuploadfiles.md b/samples/client/petstore/java/docs/apis/paths/Fakeuploadfiles.md new file mode 100644 index 00000000000..dbbd3854037 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakeuploadfiles.md @@ -0,0 +1,104 @@ +# Fakeuploadfiles + +public class Fakeuploadfiles extends extends ApiClient implements +[FakeuploadfilesPost.PostOperation](../../paths/fakeuploadfiles/FakeuploadfilesPost.md#postoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeuploadfilesPostResponses.EndpointResponse](../../paths/fakeuploadfiles/post/FakeuploadfilesPostResponses.md#endpointresponse) | [post](#post)([FakeuploadfilesPost.PostRequest](../../paths/fakeuploadfiles/FakeuploadfilesPost.md#postrequest) request)
| + +## Method Detail + +### post +public [FakeuploadfilesPostResponses.EndpointResponse](../../paths/fakeuploadfiles/post/FakeuploadfilesPostResponses.md#endpointresponse) post([FakeuploadfilesPost.PostRequest](../../paths/fakeuploadfiles/FakeuploadfilesPost.md#postrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakeuploadfiles.post.FakeuploadfilesPostRequestBody; +import org.openapijsonschematools.client.paths.fakeuploadfiles.post.requestbody.content.multipartformdata.MultipartformdataSchema; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeuploadfiles.post.responses.FakeuploadfilesPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakeuploadfiles; +import org.openapijsonschematools.client.paths.fakeuploadfiles.post.FakeuploadfilesPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakeuploadfiles apiClient = new Fakeuploadfiles(apiConfiguration, schemaConfiguration); + + +var request = new FakeuploadfilesPost.PostRequestBuilder().build(); + +FakeuploadfilesPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeuploadfilesPostResponses.EndpointFakeuploadfilesPostCode200Response castResponse = (FakeuploadfilesPostResponses.EndpointFakeuploadfilesPostCode200Response) response; +FakeuploadfilesPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakeuploadfilesPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Fakewildcardresponses.md b/samples/client/petstore/java/docs/apis/paths/Fakewildcardresponses.md new file mode 100644 index 00000000000..779ba58f357 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Fakewildcardresponses.md @@ -0,0 +1,119 @@ +# Fakewildcardresponses + +public class Fakewildcardresponses extends extends ApiClient implements +[FakewildcardresponsesGet.GetOperation](../../paths/fakewildcardresponses/FakewildcardresponsesGet.md#getoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakewildcardresponsesGetResponses.EndpointResponse](../../paths/fakewildcardresponses/get/FakewildcardresponsesGetResponses.md#endpointresponse) | [get](#get)([FakewildcardresponsesGet.GetRequest](../../paths/fakewildcardresponses/FakewildcardresponsesGet.md#getrequest) request) | + +## Method Detail + +### get +public [FakewildcardresponsesGetResponses.EndpointResponse](../../paths/fakewildcardresponses/get/FakewildcardresponsesGetResponses.md#endpointresponse) get([FakewildcardresponsesGet.GetRequest](../../paths/fakewildcardresponses/FakewildcardresponsesGet.md#getrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.FakewildcardresponsesGetCode1XXResponse; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.FakewildcardresponsesGetCode200Response; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.FakewildcardresponsesGetCode2XXResponse; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.FakewildcardresponsesGetCode3XXResponse; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.FakewildcardresponsesGetCode4XXResponse; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.FakewildcardresponsesGetCode5XXResponse; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Fakewildcardresponses; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.FakewildcardresponsesGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakewildcardresponses apiClient = new Fakewildcardresponses(apiConfiguration, schemaConfiguration); + + +var request = new FakewildcardresponsesGet.GetRequestBuilder().build(); + +FakewildcardresponsesGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (FakewildcardresponsesGetCode4XXResponse.ResponseApiException | FakewildcardresponsesGetCode5XXResponse.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +if (response instanceof FakewildcardresponsesGetResponses.EndpointFakewildcardresponsesGetCode1XXResponse castResponse) { +FakewildcardresponsesGetCode1XXResponse.ApplicationjsonResponseBody deserializedBody = (FakewildcardresponsesGetCode1XXResponse.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +} else if (response instanceof FakewildcardresponsesGetResponses.EndpointFakewildcardresponsesGetCode2XXResponse castResponse) { +FakewildcardresponsesGetCode2XXResponse.ApplicationjsonResponseBody deserializedBody = (FakewildcardresponsesGetCode2XXResponse.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +} else if (response instanceof FakewildcardresponsesGetResponses.EndpointFakewildcardresponsesGetCode200Response castResponse) { +FakewildcardresponsesGetCode200Response.ApplicationjsonResponseBody deserializedBody = (FakewildcardresponsesGetCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +} else { + FakewildcardresponsesGetResponses.EndpointFakewildcardresponsesGetCode3XXResponse castResponse = (FakewildcardresponsesGetResponses.EndpointFakewildcardresponsesGetCode3XXResponse) response; +FakewildcardresponsesGetCode3XXResponse.ApplicationjsonResponseBody deserializedBody = (FakewildcardresponsesGetCode3XXResponse.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +} +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Foo.md b/samples/client/petstore/java/docs/apis/paths/Foo.md new file mode 100644 index 00000000000..3186f6a9656 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Foo.md @@ -0,0 +1,99 @@ +# Foo + +public class Foo extends extends ApiClient implements +[FooGet.GetOperation](../../paths/foo/FooGet.md#getoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FooGetResponses.EndpointResponse](../../paths/foo/get/FooGetResponses.md#endpointresponse) | [get](#get)([FooGet.GetRequest](../../paths/foo/FooGet.md#getrequest) request) | + +## Method Detail + +### get +public [FooGetResponses.EndpointResponse](../../paths/foo/get/FooGetResponses.md#endpointresponse) get([FooGet.GetRequest](../../paths/foo/FooGet.md#getrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.foo.get.FooGetServerInfo; +import org.openapijsonschematools.client.paths.foo.get.servers.FooGetServer0; +import org.openapijsonschematools.client.paths.foo.get.servers.FooGetServer1; +import org.openapijsonschematools.client.paths.foo.get.responses.FooGetCodedefaultResponse; +import org.openapijsonschematools.client.paths.foo.get.FooGetServerInfo; +import org.openapijsonschematools.client.apis.paths.Foo; +import org.openapijsonschematools.client.paths.foo.get.FooGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .fooGetServerInfo( + new FooGetServerInfo.FooGetServerInfoBuilder() + .fooGetServer0(new FooGetServer0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .fooGetServerInfoServerIndex(FooGetServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Foo apiClient = new Foo(apiConfiguration, schemaConfiguration); + + +var request = new FooGet.GetRequestBuilder().build(); + +FooGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FooGetResponses.EndpointFooGetCodedefaultResponse castResponse = (FooGetResponses.EndpointFooGetCodedefaultResponse) response; +FooGetCodedefaultResponse.ApplicationjsonResponseBody deserializedBody = (FooGetCodedefaultResponse.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Pet.md b/samples/client/petstore/java/docs/apis/paths/Pet.md new file mode 100644 index 00000000000..a8ee4db231b --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Pet.md @@ -0,0 +1,309 @@ +# Pet + +public class Pet extends extends ApiClient implements +[PetPost.PostOperation](../../paths/pet/PetPost.md#postoperation), +[PetPut.PutOperation](../../paths/pet/PetPut.md#putoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetPostResponses.EndpointResponse](../../paths/pet/post/PetPostResponses.md#endpointresponse) | [post](#post)([PetPost.PostRequest](../../paths/pet/PetPost.md#postrequest) request)
Add a new pet to the store | +| Void | [put](#put)([PetPut.PutRequest](../../paths/pet/PetPut.md#putrequest) request)
| + +## Method Detail + +### post +public [PetPostResponses.EndpointResponse](../../paths/pet/post/PetPostResponses.md#endpointresponse) post([PetPost.PostRequest](../../paths/pet/PetPost.md#postrequest) request) + +Add a new pet to the store + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.pet.post.PetPostSecurityInfo; +import org.openapijsonschematools.client.paths.pet.post.PetPostRequestBody; +import org.openapijsonschematools.client.components.schemas.Pet; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.ApiKey; +import org.openapijsonschematools.client.components.securityschemes.HttpSignatureTest; +import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; +import org.openapijsonschematools.client.paths.pet.post.responses.PetPostCode200Response; +import org.openapijsonschematools.client.paths.pet.post.responses.PetPostCode405Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Pet; +import org.openapijsonschematools.client.paths.pet.post.PetPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new ApiKey("someApiKey"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .petPostSecurityRequirementObject0SecurityIndex(PetPostSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Pet apiClient = new Pet(apiConfiguration, schemaConfiguration); + + +Pet1BoxedMap requestBodyPayload = + Pet.Pet1.validateAndBox( + new Pet.PetMapBuilder() + .name("a") + + .photoUrls( + Arrays.asList( + "a" + ) + ) + .id(1L) + + .category( + MapUtils.makeMap( + new AbstractMap.SimpleEntry( + "name", + "a" + ), + new AbstractMap.SimpleEntry( + "id", + 1L + ) + ) + ) + .tags( + Arrays.asList( + MapUtils.makeMap( + new AbstractMap.SimpleEntry( + "name", + "a" + ) + ) + ) + ) + .status("available") + + .build(), + schemaConfiguration +); +PetPostRequestBody.SealedRequestBody requestBody = new PetPostRequestBody.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new PetPost.PostRequestBuilder() + .requestBody(requestBody) + .build(); + +PetPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (PetPostCode405Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +PetPostResponses.EndpointPetPostCode200Response castResponse = (PetPostResponses.EndpointPetPostCode200Response) response; +``` +### put +public Void put([PetPut.PutRequest](../../paths/pet/PetPut.md#putrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+nothing (Void) + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.pet.put.PetPutSecurityInfo; +import org.openapijsonschematools.client.paths.pet.put.PetPutRequestBody; +import org.openapijsonschematools.client.components.schemas.Pet; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.HttpSignatureTest; +import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; +import org.openapijsonschematools.client.paths.pet.put.responses.PetPutCode400Response; +import org.openapijsonschematools.client.paths.pet.put.responses.PetPutCode404Response; +import org.openapijsonschematools.client.paths.pet.put.responses.PetPutCode405Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Pet; +import org.openapijsonschematools.client.paths.pet.put.PetPutResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .petPutSecurityRequirementObject0SecurityIndex(PetPutSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Pet apiClient = new Pet(apiConfiguration, schemaConfiguration); + + +Pet1BoxedMap requestBodyPayload = + Pet.Pet1.validateAndBox( + new Pet.PetMapBuilder() + .name("a") + + .photoUrls( + Arrays.asList( + "a" + ) + ) + .id(1L) + + .category( + MapUtils.makeMap( + new AbstractMap.SimpleEntry( + "name", + "a" + ), + new AbstractMap.SimpleEntry( + "id", + 1L + ) + ) + ) + .tags( + Arrays.asList( + MapUtils.makeMap( + new AbstractMap.SimpleEntry( + "name", + "a" + ) + ) + ) + ) + .status("available") + + .build(), + schemaConfiguration +); +PetPutRequestBody.SealedRequestBody requestBody = new PetPutRequestBody.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new PetPut.PutRequestBuilder() + .requestBody(requestBody) + .build(); + +Void response; +try { + response = apiClient.put(request); +} catch (PetPutCode400Response.ResponseApiException | PetPutCode404Response.ResponseApiException | PetPutCode405Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Petfindbystatus.md b/samples/client/petstore/java/docs/apis/paths/Petfindbystatus.md new file mode 100644 index 00000000000..8ece1d1ae03 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Petfindbystatus.md @@ -0,0 +1,134 @@ +# Petfindbystatus + +public class Petfindbystatus extends extends ApiClient implements +[PetfindbystatusGet.GetOperation](../../paths/petfindbystatus/PetfindbystatusGet.md#getoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetfindbystatusGetResponses.EndpointResponse](../../paths/petfindbystatus/get/PetfindbystatusGetResponses.md#endpointresponse) | [get](#get)([PetfindbystatusGet.GetRequest](../../paths/petfindbystatus/PetfindbystatusGet.md#getrequest) request)
Multiple status values can be provided with comma separated strings | + +## Method Detail + +### get +public [PetfindbystatusGetResponses.EndpointResponse](../../paths/petfindbystatus/get/PetfindbystatusGetResponses.md#endpointresponse) get([PetfindbystatusGet.GetRequest](../../paths/petfindbystatus/PetfindbystatusGet.md#getrequest) request) + +Multiple status values can be provided with comma separated strings + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.petfindbystatus.PetfindbystatusServerInfo; +import org.openapijsonschematools.client.paths.petfindbystatus.get.PetfindbystatusGetSecurityInfo; +import org.openapijsonschematools.client.paths.petfindbystatus.get.PetfindbystatusGetQueryParameters; +import org.openapijsonschematools.client.paths.petfindbystatus.servers.PetfindbystatusServer0; +import org.openapijsonschematools.client.paths.petfindbystatus.servers.PetfindbystatusServer1; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.ApiKey; +import org.openapijsonschematools.client.components.securityschemes.HttpSignatureTest; +import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; +import org.openapijsonschematools.client.paths.petfindbystatus.get.responses.PetfindbystatusGetCode200Response; +import org.openapijsonschematools.client.paths.petfindbystatus.get.responses.PetfindbystatusGetCode400Response; +import org.openapijsonschematools.client.paths.petfindbystatus.PetfindbystatusServerInfo; +import org.openapijsonschematools.client.apis.paths.Petfindbystatus; +import org.openapijsonschematools.client.paths.petfindbystatus.get.PetfindbystatusGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .petfindbystatusServerInfo( + new PetfindbystatusServerInfo.PetfindbystatusServerInfoBuilder() + .petfindbystatusServer0(new PetfindbystatusServer0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .petfindbystatusServerInfoServerIndex(PetfindbystatusServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new ApiKey("someApiKey"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .petfindbystatusGetSecurityRequirementObject0SecurityIndex(PetfindbystatusGetSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Petfindbystatus apiClient = new Petfindbystatus(apiConfiguration, schemaConfiguration); + + +// Map validation +PetfindbystatusGetQueryParameters.PetfindbystatusGetQueryParametersMap queryParameters = + PetfindbystatusGetQueryParameters.PetfindbystatusGetQueryParameters1.validate( + new PetfindbystatusGetQueryParameters.PetfindbystatusGetQueryParametersMapBuilder() + .status( + Arrays.asList( + "available" + ) + ) + .build(), + schemaConfiguration +); + +var request = new PetfindbystatusGet.GetRequestBuilder() + .queryParameters(queryParameters) + .build(); + +PetfindbystatusGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (PetfindbystatusGetCode400Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +PetfindbystatusGetResponses.EndpointPetfindbystatusGetCode200Response castResponse = (PetfindbystatusGetResponses.EndpointPetfindbystatusGetCode200Response) response; +} +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Petfindbytags.md b/samples/client/petstore/java/docs/apis/paths/Petfindbytags.md new file mode 100644 index 00000000000..394bc51ed35 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Petfindbytags.md @@ -0,0 +1,131 @@ +# Petfindbytags + +public class Petfindbytags extends extends ApiClient implements +[PetfindbytagsGet.GetOperation](../../paths/petfindbytags/PetfindbytagsGet.md#getoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetfindbytagsGetResponses.EndpointResponse](../../paths/petfindbytags/get/PetfindbytagsGetResponses.md#endpointresponse) | [get](#get)([PetfindbytagsGet.GetRequest](../../paths/petfindbytags/PetfindbytagsGet.md#getrequest) request)
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. | + +## Method Detail + +### get +public [PetfindbytagsGetResponses.EndpointResponse](../../paths/petfindbytags/get/PetfindbytagsGetResponses.md#endpointresponse) get([PetfindbytagsGet.GetRequest](../../paths/petfindbytags/PetfindbytagsGet.md#getrequest) request) + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.petfindbytags.get.PetfindbytagsGetSecurityInfo; +import org.openapijsonschematools.client.paths.petfindbytags.get.PetfindbytagsGetQueryParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.HttpSignatureTest; +import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; +import org.openapijsonschematools.client.paths.petfindbytags.get.responses.PetfindbytagsGetCode200Response; +import org.openapijsonschematools.client.paths.petfindbytags.get.responses.PetfindbytagsGetCode400Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Petfindbytags; +import org.openapijsonschematools.client.paths.petfindbytags.get.PetfindbytagsGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .petfindbytagsGetSecurityRequirementObject0SecurityIndex(PetfindbytagsGetSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Petfindbytags apiClient = new Petfindbytags(apiConfiguration, schemaConfiguration); + + +// Map validation +PetfindbytagsGetQueryParameters.PetfindbytagsGetQueryParametersMap queryParameters = + PetfindbytagsGetQueryParameters.PetfindbytagsGetQueryParameters1.validate( + new PetfindbytagsGetQueryParameters.PetfindbytagsGetQueryParametersMapBuilder() + .tags( + Arrays.asList( + "a" + ) + ) + .build(), + schemaConfiguration +); + +var request = new PetfindbytagsGet.GetRequestBuilder() + .queryParameters(queryParameters) + .build(); + +PetfindbytagsGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (PetfindbytagsGetCode400Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +PetfindbytagsGetResponses.EndpointPetfindbytagsGetCode200Response castResponse = (PetfindbytagsGetResponses.EndpointPetfindbytagsGetCode200Response) response; +} +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Petpetid.md b/samples/client/petstore/java/docs/apis/paths/Petpetid.md new file mode 100644 index 00000000000..3d68365c59c --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Petpetid.md @@ -0,0 +1,368 @@ +# Petpetid + +public class Petpetid extends extends ApiClient implements +[PetpetidDelete.DeleteOperation](../../paths/petpetid/PetpetidDelete.md#deleteoperation), +[PetpetidGet.GetOperation](../../paths/petpetid/PetpetidGet.md#getoperation), +[PetpetidPost.PostOperation](../../paths/petpetid/PetpetidPost.md#postoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | [delete](#delete)([PetpetidDelete.DeleteRequest](../../paths/petpetid/PetpetidDelete.md#deleterequest) request)
| +| [PetpetidGetResponses.EndpointResponse](../../paths/petpetid/get/PetpetidGetResponses.md#endpointresponse) | [get](#get)([PetpetidGet.GetRequest](../../paths/petpetid/PetpetidGet.md#getrequest) request)
Returns a single pet | +| Void | [post](#post)([PetpetidPost.PostRequest](../../paths/petpetid/PetpetidPost.md#postrequest) request)
| + +## Method Detail + +### delete +public Void delete([PetpetidDelete.DeleteRequest](../../paths/petpetid/PetpetidDelete.md#deleterequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+nothing (Void) + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.petpetid.delete.PetpetidDeleteHeaderParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.petpetid.delete.PetpetidDeleteSecurityInfo; +import org.openapijsonschematools.client.paths.petpetid.delete.PetpetidDeletePathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.ApiKey; +import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; +import org.openapijsonschematools.client.paths.petpetid.delete.responses.PetpetidDeleteCode400Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Petpetid; +import org.openapijsonschematools.client.paths.petpetid.delete.PetpetidDeleteResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new ApiKey("someApiKey"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .petpetidDeleteSecurityRequirementObject0SecurityIndex(PetpetidDeleteSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Petpetid apiClient = new Petpetid(apiConfiguration, schemaConfiguration); + + +// Map validation +PetpetidDeletePathParameters.PetpetidDeletePathParametersMap pathParameters = + PetpetidDeletePathParameters.PetpetidDeletePathParameters1.validate( + new PetpetidDeletePathParameters.PetpetidDeletePathParametersMapBuilder() + .petId(1L) + + .build(), + schemaConfiguration +); + +var request = new PetpetidDelete.DeleteRequestBuilder() + .pathParameters(pathParameters) + .build(); + +Void response; +try { + response = apiClient.delete(request); +} catch (PetpetidDeleteCode400Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +``` +### get +public [PetpetidGetResponses.EndpointResponse](../../paths/petpetid/get/PetpetidGetResponses.md#endpointresponse) get([PetpetidGet.GetRequest](../../paths/petpetid/PetpetidGet.md#getrequest) request) + +Returns a single pet + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.petpetid.get.PetpetidGetSecurityInfo; +import org.openapijsonschematools.client.paths.petpetid.get.PetpetidGetPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.ApiKey; +import org.openapijsonschematools.client.paths.petpetid.get.responses.PetpetidGetCode200Response; +import org.openapijsonschematools.client.paths.petpetid.get.responses.PetpetidGetCode400Response; +import org.openapijsonschematools.client.paths.petpetid.get.responses.PetpetidGetCode404Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Petpetid; +import org.openapijsonschematools.client.paths.petpetid.get.PetpetidGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new ApiKey("someApiKey"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .petpetidGetSecurityRequirementObject0SecurityIndex(PetpetidGetSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Petpetid apiClient = new Petpetid(apiConfiguration, schemaConfiguration); + + +// Map validation +PetpetidGetPathParameters.PetpetidGetPathParametersMap pathParameters = + PetpetidGetPathParameters.PetpetidGetPathParameters1.validate( + new PetpetidGetPathParameters.PetpetidGetPathParametersMapBuilder() + .petId(1L) + + .build(), + schemaConfiguration +); + +var request = new PetpetidGet.GetRequestBuilder() + .pathParameters(pathParameters) + .build(); + +PetpetidGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (PetpetidGetCode400Response.ResponseApiException | PetpetidGetCode404Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +PetpetidGetResponses.EndpointPetpetidGetCode200Response castResponse = (PetpetidGetResponses.EndpointPetpetidGetCode200Response) response; +if (castResponse.body instanceof PetpetidGetCode200Response.ApplicationxmlResponseBody deserializedBody) { + // handle deserialized body here +} else { + PetpetidGetCode200Response.ApplicationjsonResponseBody deserializedBody = (PetpetidGetCode200Response.ApplicationjsonResponseBody) castResponse.body; + // handle deserialized body here +} +``` +### post +public Void post([PetpetidPost.PostRequest](../../paths/petpetid/PetpetidPost.md#postrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+nothing (Void) + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.petpetid.post.PetpetidPostRequestBody; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.petpetid.post.PetpetidPostSecurityInfo; +import org.openapijsonschematools.client.paths.petpetid.post.PetpetidPostPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.ApiKey; +import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; +import org.openapijsonschematools.client.paths.petpetid.post.responses.PetpetidPostCode405Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Petpetid; +import org.openapijsonschematools.client.paths.petpetid.post.PetpetidPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new ApiKey("someApiKey"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .petpetidPostSecurityRequirementObject0SecurityIndex(PetpetidPostSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Petpetid apiClient = new Petpetid(apiConfiguration, schemaConfiguration); + + +// Map validation +PetpetidPostPathParameters.PetpetidPostPathParametersMap pathParameters = + PetpetidPostPathParameters.PetpetidPostPathParameters1.validate( + new PetpetidPostPathParameters.PetpetidPostPathParametersMapBuilder() + .petId(1L) + + .build(), + schemaConfiguration +); + +var request = new PetpetidPost.PostRequestBuilder() + .pathParameters(pathParameters) + .build(); + +Void response; +try { + response = apiClient.post(request); +} catch (PetpetidPostCode405Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Petpetiduploadimage.md b/samples/client/petstore/java/docs/apis/paths/Petpetiduploadimage.md new file mode 100644 index 00000000000..4d6e11a51f4 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Petpetiduploadimage.md @@ -0,0 +1,125 @@ +# Petpetiduploadimage + +public class Petpetiduploadimage extends extends ApiClient implements +[PetpetiduploadimagePost.PostOperation](../../paths/petpetiduploadimage/PetpetiduploadimagePost.md#postoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetpetiduploadimagePostResponses.EndpointResponse](../../paths/petpetiduploadimage/post/PetpetiduploadimagePostResponses.md#endpointresponse) | [post](#post)([PetpetiduploadimagePost.PostRequest](../../paths/petpetiduploadimage/PetpetiduploadimagePost.md#postrequest) request)
| + +## Method Detail + +### post +public [PetpetiduploadimagePostResponses.EndpointResponse](../../paths/petpetiduploadimage/post/PetpetiduploadimagePostResponses.md#endpointresponse) post([PetpetiduploadimagePost.PostRequest](../../paths/petpetiduploadimage/PetpetiduploadimagePost.md#postrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.petpetiduploadimage.post.PetpetiduploadimagePostRequestBody; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.petpetiduploadimage.post.PetpetiduploadimagePostSecurityInfo; +import org.openapijsonschematools.client.paths.petpetiduploadimage.post.PetpetiduploadimagePostPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; +import org.openapijsonschematools.client.paths.petpetiduploadimage.post.responses.PetpetiduploadimagePostCode200Response; +import org.openapijsonschematools.client.components.responses.successwithjsonapiresponse.SuccessWithJsonApiResponseHeadersSchema; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Petpetiduploadimage; +import org.openapijsonschematools.client.paths.petpetiduploadimage.post.PetpetiduploadimagePostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .petpetiduploadimagePostSecurityRequirementObject0SecurityIndex(PetpetiduploadimagePostSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Petpetiduploadimage apiClient = new Petpetiduploadimage(apiConfiguration, schemaConfiguration); + + +// Map validation +PetpetiduploadimagePostPathParameters.PetpetiduploadimagePostPathParametersMap pathParameters = + PetpetiduploadimagePostPathParameters.PetpetiduploadimagePostPathParameters1.validate( + new PetpetiduploadimagePostPathParameters.PetpetiduploadimagePostPathParametersMapBuilder() + .petId(1L) + + .build(), + schemaConfiguration +); + +var request = new PetpetiduploadimagePost.PostRequestBuilder() + .pathParameters(pathParameters) + .build(); + +PetpetiduploadimagePostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +PetpetiduploadimagePostResponses.EndpointPetpetiduploadimagePostCode200Response castResponse = (PetpetiduploadimagePostResponses.EndpointPetpetiduploadimagePostCode200Response) response; +} +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Solidus.md b/samples/client/petstore/java/docs/apis/paths/Solidus.md new file mode 100644 index 00000000000..5f8a4970e89 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Solidus.md @@ -0,0 +1,98 @@ +# Solidus + +public class Solidus extends extends ApiClient implements +[SolidusGet.GetOperation](../../paths/solidus/SolidusGet.md#getoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [SolidusGetResponses.EndpointResponse](../../paths/solidus/get/SolidusGetResponses.md#endpointresponse) | [get](#get)([SolidusGet.GetRequest](../../paths/solidus/SolidusGet.md#getrequest) request) | + +## Method Detail + +### get +public [SolidusGetResponses.EndpointResponse](../../paths/solidus/get/SolidusGetResponses.md#endpointresponse) get([SolidusGet.GetRequest](../../paths/solidus/SolidusGet.md#getrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.solidus.get.responses.SolidusGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Solidus; +import org.openapijsonschematools.client.paths.solidus.get.SolidusGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Solidus apiClient = new Solidus(apiConfiguration, schemaConfiguration); + + +var request = new SolidusGet.GetRequestBuilder().build(); + +SolidusGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +SolidusGetResponses.EndpointSolidusGetCode200Response castResponse = (SolidusGetResponses.EndpointSolidusGetCode200Response) response; +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Storeinventory.md b/samples/client/petstore/java/docs/apis/paths/Storeinventory.md new file mode 100644 index 00000000000..ee9907299d6 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Storeinventory.md @@ -0,0 +1,114 @@ +# Storeinventory + +public class Storeinventory extends extends ApiClient implements +[StoreinventoryGet.GetOperation](../../paths/storeinventory/StoreinventoryGet.md#getoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [StoreinventoryGetResponses.EndpointResponse](../../paths/storeinventory/get/StoreinventoryGetResponses.md#endpointresponse) | [get](#get)([StoreinventoryGet.GetRequest](../../paths/storeinventory/StoreinventoryGet.md#getrequest) request)
Returns a map of status codes to quantities | + +## Method Detail + +### get +public [StoreinventoryGetResponses.EndpointResponse](../../paths/storeinventory/get/StoreinventoryGetResponses.md#endpointresponse) get([StoreinventoryGet.GetRequest](../../paths/storeinventory/StoreinventoryGet.md#getrequest) request) + +Returns a map of status codes to quantities + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.storeinventory.get.StoreinventoryGetSecurityInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.ApiKey; +import org.openapijsonschematools.client.paths.storeinventory.get.responses.StoreinventoryGetCode200Response; +import org.openapijsonschematools.client.components.responses.successinlinecontentandheader.SuccessInlineContentAndHeaderHeadersSchema; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Storeinventory; +import org.openapijsonschematools.client.paths.storeinventory.get.StoreinventoryGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new ApiKey("someApiKey"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .storeinventoryGetSecurityRequirementObject0SecurityIndex(StoreinventoryGetSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Storeinventory apiClient = new Storeinventory(apiConfiguration, schemaConfiguration); + + +var request = new StoreinventoryGet.GetRequestBuilder().build(); + +StoreinventoryGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +StoreinventoryGetResponses.EndpointStoreinventoryGetCode200Response castResponse = (StoreinventoryGetResponses.EndpointStoreinventoryGetCode200Response) response; +} +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Storeorder.md b/samples/client/petstore/java/docs/apis/paths/Storeorder.md new file mode 100644 index 00000000000..e092f790b67 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Storeorder.md @@ -0,0 +1,134 @@ +# Storeorder + +public class Storeorder extends extends ApiClient implements +[StoreorderPost.PostOperation](../../paths/storeorder/StoreorderPost.md#postoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [StoreorderPostResponses.EndpointResponse](../../paths/storeorder/post/StoreorderPostResponses.md#endpointresponse) | [post](#post)([StoreorderPost.PostRequest](../../paths/storeorder/StoreorderPost.md#postrequest) request)
| + +## Method Detail + +### post +public [StoreorderPostResponses.EndpointResponse](../../paths/storeorder/post/StoreorderPostResponses.md#endpointresponse) post([StoreorderPost.PostRequest](../../paths/storeorder/StoreorderPost.md#postrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.storeorder.post.StoreorderPostRequestBody; +import org.openapijsonschematools.client.components.schemas.Order; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.storeorder.post.responses.StoreorderPostCode200Response; +import org.openapijsonschematools.client.paths.storeorder.post.responses.StoreorderPostCode400Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Storeorder; +import org.openapijsonschematools.client.paths.storeorder.post.StoreorderPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Storeorder apiClient = new Storeorder(apiConfiguration, schemaConfiguration); + + +Order1BoxedMap requestBodyPayload = + Order.Order1.validateAndBox( + new Order.OrderMapBuilder() + .id(1L) + + .petId(1L) + + .quantity(1) + + .shipDate("1970-01-01T00:00:00.00Z") + + .status("placed") + + .complete(true) + + .build(), + schemaConfiguration +); +StoreorderPost.SealedRequestBody requestBody = new StoreorderPost.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new StoreorderPost.PostRequestBuilder() + .requestBody(requestBody) + .build(); + +StoreorderPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (StoreorderPostCode400Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +StoreorderPostResponses.EndpointStoreorderPostCode200Response castResponse = (StoreorderPostResponses.EndpointStoreorderPostCode200Response) response; +if (castResponse.body instanceof StoreorderPostCode200Response.ApplicationxmlResponseBody deserializedBody) { + // handle deserialized body here +} else { + StoreorderPostCode200Response.ApplicationjsonResponseBody deserializedBody = (StoreorderPostCode200Response.ApplicationjsonResponseBody) castResponse.body; + // handle deserialized body here +} +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Storeorderorderid.md b/samples/client/petstore/java/docs/apis/paths/Storeorderorderid.md new file mode 100644 index 00000000000..9f8f173efa3 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Storeorderorderid.md @@ -0,0 +1,227 @@ +# Storeorderorderid + +public class Storeorderorderid extends extends ApiClient implements +[StoreorderorderidDelete.DeleteOperation](../../paths/storeorderorderid/StoreorderorderidDelete.md#deleteoperation), +[StoreorderorderidGet.GetOperation](../../paths/storeorderorderid/StoreorderorderidGet.md#getoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | [delete](#delete)([StoreorderorderidDelete.DeleteRequest](../../paths/storeorderorderid/StoreorderorderidDelete.md#deleterequest) request)
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors | +| [StoreorderorderidGetResponses.EndpointResponse](../../paths/storeorderorderid/get/StoreorderorderidGetResponses.md#endpointresponse) | [get](#get)([StoreorderorderidGet.GetRequest](../../paths/storeorderorderid/StoreorderorderidGet.md#getrequest) request)
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions | + +## Method Detail + +### delete +public Void delete([StoreorderorderidDelete.DeleteRequest](../../paths/storeorderorderid/StoreorderorderidDelete.md#deleterequest) request) + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +**Parameters:**
+request - the input request + +**Returns:**
+nothing (Void) + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.storeorderorderid.delete.StoreorderorderidDeletePathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.storeorderorderid.delete.responses.StoreorderorderidDeleteCode400Response; +import org.openapijsonschematools.client.paths.storeorderorderid.delete.responses.StoreorderorderidDeleteCode404Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Storeorderorderid; +import org.openapijsonschematools.client.paths.storeorderorderid.delete.StoreorderorderidDeleteResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Storeorderorderid apiClient = new Storeorderorderid(apiConfiguration, schemaConfiguration); + + +// Map validation +StoreorderorderidDeletePathParameters.StoreorderorderidDeletePathParametersMap pathParameters = + StoreorderorderidDeletePathParameters.StoreorderorderidDeletePathParameters1.validate( + new StoreorderorderidDeletePathParameters.StoreorderorderidDeletePathParametersMapBuilder() + .order_id("a") + + .build(), + schemaConfiguration +); + +var request = new StoreorderorderidDelete.DeleteRequestBuilder() + .pathParameters(pathParameters) + .build(); + +Void response; +try { + response = apiClient.delete(request); +} catch (StoreorderorderidDeleteCode400Response.ResponseApiException | StoreorderorderidDeleteCode404Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +``` +### get +public [StoreorderorderidGetResponses.EndpointResponse](../../paths/storeorderorderid/get/StoreorderorderidGetResponses.md#endpointresponse) get([StoreorderorderidGet.GetRequest](../../paths/storeorderorderid/StoreorderorderidGet.md#getrequest) request) + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.storeorderorderid.get.StoreorderorderidGetPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.storeorderorderid.get.responses.StoreorderorderidGetCode200Response; +import org.openapijsonschematools.client.paths.storeorderorderid.get.responses.StoreorderorderidGetCode400Response; +import org.openapijsonschematools.client.paths.storeorderorderid.get.responses.StoreorderorderidGetCode404Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Storeorderorderid; +import org.openapijsonschematools.client.paths.storeorderorderid.get.StoreorderorderidGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Storeorderorderid apiClient = new Storeorderorderid(apiConfiguration, schemaConfiguration); + + +// Map validation +StoreorderorderidGetPathParameters.StoreorderorderidGetPathParametersMap pathParameters = + StoreorderorderidGetPathParameters.StoreorderorderidGetPathParameters1.validate( + new StoreorderorderidGetPathParameters.StoreorderorderidGetPathParametersMapBuilder() + .order_id(1L) + + .build(), + schemaConfiguration +); + +var request = new StoreorderorderidGet.GetRequestBuilder() + .pathParameters(pathParameters) + .build(); + +StoreorderorderidGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (StoreorderorderidGetCode400Response.ResponseApiException | StoreorderorderidGetCode404Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +StoreorderorderidGetResponses.EndpointStoreorderorderidGetCode200Response castResponse = (StoreorderorderidGetResponses.EndpointStoreorderorderidGetCode200Response) response; +if (castResponse.body instanceof StoreorderorderidGetCode200Response.ApplicationxmlResponseBody deserializedBody) { + // handle deserialized body here +} else { + StoreorderorderidGetCode200Response.ApplicationjsonResponseBody deserializedBody = (StoreorderorderidGetCode200Response.ApplicationjsonResponseBody) castResponse.body; + // handle deserialized body here +} +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/User.md b/samples/client/petstore/java/docs/apis/paths/User.md new file mode 100644 index 00000000000..f10ec4e7199 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/User.md @@ -0,0 +1,130 @@ +# User + +public class User extends extends ApiClient implements +[UserPost.PostOperation](../../paths/user/UserPost.md#postoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserPostResponses.EndpointResponse](../../paths/user/post/UserPostResponses.md#endpointresponse) | [post](#post)([UserPost.PostRequest](../../paths/user/UserPost.md#postrequest) request)
This can only be done by the logged in user. | + +## Method Detail + +### post +public [UserPostResponses.EndpointResponse](../../paths/user/post/UserPostResponses.md#endpointresponse) post([UserPost.PostRequest](../../paths/user/UserPost.md#postrequest) request) + +This can only be done by the logged in user. + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.user.post.UserPostRequestBody; +import org.openapijsonschematools.client.components.schemas.User; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.user.post.responses.UserPostCodedefaultResponse; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.User; +import org.openapijsonschematools.client.paths.user.post.UserPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +User apiClient = new User(apiConfiguration, schemaConfiguration); + + +User1BoxedMap requestBodyPayload = + User.User1.validateAndBox( + new User.UserMapBuilder() + .id(1L) + + .username("a") + + .firstName("a") + + .lastName("a") + + .email("a") + + .password("a") + + .phone("a") + + .userStatus(1) + + .objectWithNoDeclaredPropsNullable(null) + + .build(), + schemaConfiguration +); +UserPost.SealedRequestBody requestBody = new UserPost.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new UserPost.PostRequestBuilder() + .requestBody(requestBody) + .build(); + +UserPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +UserPostResponses.EndpointUserPostCodedefaultResponse castResponse = (UserPostResponses.EndpointUserPostCodedefaultResponse) response; +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Usercreatewitharray.md b/samples/client/petstore/java/docs/apis/paths/Usercreatewitharray.md new file mode 100644 index 00000000000..39776a1525c --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Usercreatewitharray.md @@ -0,0 +1,152 @@ +# Usercreatewitharray + +public class Usercreatewitharray extends extends ApiClient implements +[UsercreatewitharrayPost.PostOperation](../../paths/usercreatewitharray/UsercreatewitharrayPost.md#postoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UsercreatewitharrayPostResponses.EndpointResponse](../../paths/usercreatewitharray/post/UsercreatewitharrayPostResponses.md#endpointresponse) | [post](#post)([UsercreatewitharrayPost.PostRequest](../../paths/usercreatewitharray/UsercreatewitharrayPost.md#postrequest) request)
| + +## Method Detail + +### post +public [UsercreatewitharrayPostResponses.EndpointResponse](../../paths/usercreatewitharray/post/UsercreatewitharrayPostResponses.md#endpointresponse) post([UsercreatewitharrayPost.PostRequest](../../paths/usercreatewitharray/UsercreatewitharrayPost.md#postrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.usercreatewitharray.post.UsercreatewitharrayPostRequestBody; +import org.openapijsonschematools.client.components.requestbodies.userarray.content.applicationjson.ApplicationjsonSchema; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.usercreatewitharray.post.responses.UsercreatewitharrayPostCodedefaultResponse; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Usercreatewitharray; +import org.openapijsonschematools.client.paths.usercreatewitharray.post.UsercreatewitharrayPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Usercreatewitharray apiClient = new Usercreatewitharray(apiConfiguration, schemaConfiguration); + + +ApplicationjsonSchema1BoxedList requestBodyPayload = + ApplicationjsonSchema.ApplicationjsonSchema1.validateAndBox( + new ApplicationjsonSchema.ApplicationjsonSchemaListBuilder() + .add( + MapUtils.makeMap( + new AbstractMap.SimpleEntry( + "id", + 1L + ), + new AbstractMap.SimpleEntry( + "username", + "a" + ), + new AbstractMap.SimpleEntry( + "firstName", + "a" + ), + new AbstractMap.SimpleEntry( + "lastName", + "a" + ), + new AbstractMap.SimpleEntry( + "email", + "a" + ), + new AbstractMap.SimpleEntry( + "password", + "a" + ), + new AbstractMap.SimpleEntry( + "phone", + "a" + ), + new AbstractMap.SimpleEntry( + "userStatus", + 1 + ), + new AbstractMap.SimpleEntry( + "objectWithNoDeclaredPropsNullable", + null + ) + ) + ) + .build(), + schemaConfiguration +); +UsercreatewitharrayPostRequestBody.SealedRequestBody requestBody = new UsercreatewitharrayPostRequestBody.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new UsercreatewitharrayPost.PostRequestBuilder() + .requestBody(requestBody) + .build(); + +UsercreatewitharrayPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +UsercreatewitharrayPostResponses.EndpointUsercreatewitharrayPostCodedefaultResponse castResponse = (UsercreatewitharrayPostResponses.EndpointUsercreatewitharrayPostCodedefaultResponse) response; +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Usercreatewithlist.md b/samples/client/petstore/java/docs/apis/paths/Usercreatewithlist.md new file mode 100644 index 00000000000..17991d81c4d --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Usercreatewithlist.md @@ -0,0 +1,152 @@ +# Usercreatewithlist + +public class Usercreatewithlist extends extends ApiClient implements +[UsercreatewithlistPost.PostOperation](../../paths/usercreatewithlist/UsercreatewithlistPost.md#postoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UsercreatewithlistPostResponses.EndpointResponse](../../paths/usercreatewithlist/post/UsercreatewithlistPostResponses.md#endpointresponse) | [post](#post)([UsercreatewithlistPost.PostRequest](../../paths/usercreatewithlist/UsercreatewithlistPost.md#postrequest) request)
| + +## Method Detail + +### post +public [UsercreatewithlistPostResponses.EndpointResponse](../../paths/usercreatewithlist/post/UsercreatewithlistPostResponses.md#endpointresponse) post([UsercreatewithlistPost.PostRequest](../../paths/usercreatewithlist/UsercreatewithlistPost.md#postrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.usercreatewithlist.post.UsercreatewithlistPostRequestBody; +import org.openapijsonschematools.client.components.requestbodies.userarray.content.applicationjson.ApplicationjsonSchema; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.usercreatewithlist.post.responses.UsercreatewithlistPostCodedefaultResponse; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Usercreatewithlist; +import org.openapijsonschematools.client.paths.usercreatewithlist.post.UsercreatewithlistPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Usercreatewithlist apiClient = new Usercreatewithlist(apiConfiguration, schemaConfiguration); + + +ApplicationjsonSchema1BoxedList requestBodyPayload = + ApplicationjsonSchema.ApplicationjsonSchema1.validateAndBox( + new ApplicationjsonSchema.ApplicationjsonSchemaListBuilder() + .add( + MapUtils.makeMap( + new AbstractMap.SimpleEntry( + "id", + 1L + ), + new AbstractMap.SimpleEntry( + "username", + "a" + ), + new AbstractMap.SimpleEntry( + "firstName", + "a" + ), + new AbstractMap.SimpleEntry( + "lastName", + "a" + ), + new AbstractMap.SimpleEntry( + "email", + "a" + ), + new AbstractMap.SimpleEntry( + "password", + "a" + ), + new AbstractMap.SimpleEntry( + "phone", + "a" + ), + new AbstractMap.SimpleEntry( + "userStatus", + 1 + ), + new AbstractMap.SimpleEntry( + "objectWithNoDeclaredPropsNullable", + null + ) + ) + ) + .build(), + schemaConfiguration +); +UsercreatewithlistPostRequestBody.SealedRequestBody requestBody = new UsercreatewithlistPostRequestBody.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new UsercreatewithlistPost.PostRequestBuilder() + .requestBody(requestBody) + .build(); + +UsercreatewithlistPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +UsercreatewithlistPostResponses.EndpointUsercreatewithlistPostCodedefaultResponse castResponse = (UsercreatewithlistPostResponses.EndpointUsercreatewithlistPostCodedefaultResponse) response; +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Userlogin.md b/samples/client/petstore/java/docs/apis/paths/Userlogin.md new file mode 100644 index 00000000000..75f7296e1e0 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Userlogin.md @@ -0,0 +1,126 @@ +# Userlogin + +public class Userlogin extends extends ApiClient implements +[UserloginGet.GetOperation](../../paths/userlogin/UserloginGet.md#getoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserloginGetResponses.EndpointResponse](../../paths/userlogin/get/UserloginGetResponses.md#endpointresponse) | [get](#get)([UserloginGet.GetRequest](../../paths/userlogin/UserloginGet.md#getrequest) request)
| + +## Method Detail + +### get +public [UserloginGetResponses.EndpointResponse](../../paths/userlogin/get/UserloginGetResponses.md#endpointresponse) get([UserloginGet.GetRequest](../../paths/userlogin/UserloginGet.md#getrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.userlogin.get.UserloginGetQueryParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.userlogin.get.responses.UserloginGetCode200Response; +import org.openapijsonschematools.client.paths.userlogin.get.responses.code200response.UserloginGetCode200ResponseHeadersSchema; +import org.openapijsonschematools.client.paths.userlogin.get.responses.UserloginGetCode400Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Userlogin; +import org.openapijsonschematools.client.paths.userlogin.get.UserloginGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Userlogin apiClient = new Userlogin(apiConfiguration, schemaConfiguration); + + +// Map validation +UserloginGetQueryParameters.UserloginGetQueryParametersMap queryParameters = + UserloginGetQueryParameters.UserloginGetQueryParameters1.validate( + new UserloginGetQueryParameters.UserloginGetQueryParametersMapBuilder() + .password("a") + + .username("a") + + .build(), + schemaConfiguration +); + +var request = new UserloginGet.GetRequestBuilder() + .queryParameters(queryParameters) + .build(); + +UserloginGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (UserloginGetCode400Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +UserloginGetResponses.EndpointUserloginGetCode200Response castResponse = (UserloginGetResponses.EndpointUserloginGetCode200Response) response; +if (castResponse.body instanceof UserloginGetCode200Response.ApplicationxmlResponseBody deserializedBody) { + // handle deserialized body here +} else { + UserloginGetCode200Response.ApplicationjsonResponseBody deserializedBody = (UserloginGetCode200Response.ApplicationjsonResponseBody) castResponse.body; + // handle deserialized body here +} +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Userlogout.md b/samples/client/petstore/java/docs/apis/paths/Userlogout.md new file mode 100644 index 00000000000..6da74aaf369 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Userlogout.md @@ -0,0 +1,100 @@ +# Userlogout + +public class Userlogout extends extends ApiClient implements +[UserlogoutGet.GetOperation](../../paths/userlogout/UserlogoutGet.md#getoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserlogoutGetResponses.EndpointResponse](../../paths/userlogout/get/UserlogoutGetResponses.md#endpointresponse) | [get](#get)([UserlogoutGet.GetRequest](../../paths/userlogout/UserlogoutGet.md#getrequest) request)
| + +## Method Detail + +### get +public [UserlogoutGetResponses.EndpointResponse](../../paths/userlogout/get/UserlogoutGetResponses.md#endpointresponse) get([UserlogoutGet.GetRequest](../../paths/userlogout/UserlogoutGet.md#getrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.userlogout.get.responses.UserlogoutGetCodedefaultResponse; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Userlogout; +import org.openapijsonschematools.client.paths.userlogout.get.UserlogoutGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Userlogout apiClient = new Userlogout(apiConfiguration, schemaConfiguration); + + +var request = new UserlogoutGet.GetRequestBuilder().build(); + +UserlogoutGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +UserlogoutGetResponses.EndpointUserlogoutGetCodedefaultResponse castResponse = (UserlogoutGetResponses.EndpointUserlogoutGetCodedefaultResponse) response; +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/paths/Userusername.md b/samples/client/petstore/java/docs/apis/paths/Userusername.md new file mode 100644 index 00000000000..d5f9713dc06 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/paths/Userusername.md @@ -0,0 +1,360 @@ +# Userusername + +public class Userusername extends extends ApiClient implements +[UserusernameDelete.DeleteOperation](../../paths/userusername/UserusernameDelete.md#deleteoperation), +[UserusernameGet.GetOperation](../../paths/userusername/UserusernameGet.md#getoperation), +[UserusernamePut.PutOperation](../../paths/userusername/UserusernamePut.md#putoperation) + +an api client class which contains all the routes for path="" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserusernameDeleteResponses.EndpointResponse](../../paths/userusername/delete/UserusernameDeleteResponses.md#endpointresponse) | [delete](#delete)([UserusernameDelete.DeleteRequest](../../paths/userusername/UserusernameDelete.md#deleterequest) request)
This can only be done by the logged in user. | +| [UserusernameGetResponses.EndpointResponse](../../paths/userusername/get/UserusernameGetResponses.md#endpointresponse) | [get](#get)([UserusernameGet.GetRequest](../../paths/userusername/UserusernameGet.md#getrequest) request)
| +| Void | [put](#put)([UserusernamePut.PutRequest](../../paths/userusername/UserusernamePut.md#putrequest) request)
This can only be done by the logged in user. | + +## Method Detail + +### delete +public [UserusernameDeleteResponses.EndpointResponse](../../paths/userusername/delete/UserusernameDeleteResponses.md#endpointresponse) delete([UserusernameDelete.DeleteRequest](../../paths/userusername/UserusernameDelete.md#deleterequest) request) + +This can only be done by the logged in user. + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.userusername.delete.UserusernameDeletePathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.userusername.delete.responses.UserusernameDeleteCode200Response; +import org.openapijsonschematools.client.paths.userusername.delete.responses.UserusernameDeleteCode404Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Userusername; +import org.openapijsonschematools.client.paths.userusername.delete.UserusernameDeleteResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Userusername apiClient = new Userusername(apiConfiguration, schemaConfiguration); + + +// Map validation +UserusernameDeletePathParameters.UserusernameDeletePathParametersMap pathParameters = + UserusernameDeletePathParameters.UserusernameDeletePathParameters1.validate( + new UserusernameDeletePathParameters.UserusernameDeletePathParametersMapBuilder() + .username("a") + + .build(), + schemaConfiguration +); + +var request = new UserusernameDelete.DeleteRequestBuilder() + .pathParameters(pathParameters) + .build(); + +UserusernameDeleteResponses.EndpointResponse response; +try { + response = apiClient.delete(request); +} catch (UserusernameDeleteCode404Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +UserusernameDeleteResponses.EndpointUserusernameDeleteCode200Response castResponse = (UserusernameDeleteResponses.EndpointUserusernameDeleteCode200Response) response; +``` +### get +public [UserusernameGetResponses.EndpointResponse](../../paths/userusername/get/UserusernameGetResponses.md#endpointresponse) get([UserusernameGet.GetRequest](../../paths/userusername/UserusernameGet.md#getrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.userusername.get.UserusernameGetPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.userusername.get.responses.UserusernameGetCode200Response; +import org.openapijsonschematools.client.paths.userusername.get.responses.UserusernameGetCode400Response; +import org.openapijsonschematools.client.paths.userusername.get.responses.UserusernameGetCode404Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Userusername; +import org.openapijsonschematools.client.paths.userusername.get.UserusernameGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Userusername apiClient = new Userusername(apiConfiguration, schemaConfiguration); + + +// Map validation +UserusernameGetPathParameters.UserusernameGetPathParametersMap pathParameters = + UserusernameGetPathParameters.UserusernameGetPathParameters1.validate( + new UserusernameGetPathParameters.UserusernameGetPathParametersMapBuilder() + .username("a") + + .build(), + schemaConfiguration +); + +var request = new UserusernameGet.GetRequestBuilder() + .pathParameters(pathParameters) + .build(); + +UserusernameGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (UserusernameGetCode400Response.ResponseApiException | UserusernameGetCode404Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +UserusernameGetResponses.EndpointUserusernameGetCode200Response castResponse = (UserusernameGetResponses.EndpointUserusernameGetCode200Response) response; +if (castResponse.body instanceof UserusernameGetCode200Response.ApplicationxmlResponseBody deserializedBody) { + // handle deserialized body here +} else { + UserusernameGetCode200Response.ApplicationjsonResponseBody deserializedBody = (UserusernameGetCode200Response.ApplicationjsonResponseBody) castResponse.body; + // handle deserialized body here +} +``` +### put +public Void put([UserusernamePut.PutRequest](../../paths/userusername/UserusernamePut.md#putrequest) request) + +This can only be done by the logged in user. + +**Parameters:**
+request - the input request + +**Returns:**
+nothing (Void) + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.userusername.put.UserusernamePutRequestBody; +import org.openapijsonschematools.client.components.schemas.User; +import org.openapijsonschematools.client.paths.userusername.put.UserusernamePutPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.userusername.put.responses.UserusernamePutCode400Response; +import org.openapijsonschematools.client.paths.userusername.put.responses.UserusernamePutCode404Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.paths.Userusername; +import org.openapijsonschematools.client.paths.userusername.put.UserusernamePutResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Userusername apiClient = new Userusername(apiConfiguration, schemaConfiguration); + + +User1BoxedMap requestBodyPayload = + User.User1.validateAndBox( + new User.UserMapBuilder() + .id(1L) + + .username("a") + + .firstName("a") + + .lastName("a") + + .email("a") + + .password("a") + + .phone("a") + + .userStatus(1) + + .objectWithNoDeclaredPropsNullable(null) + + .build(), + schemaConfiguration +); +UserusernamePut.SealedRequestBody requestBody = new UserusernamePut.ApplicationjsonRequestBody(requestBodyPayload); + +// Map validation +UserusernamePutPathParameters.UserusernamePutPathParametersMap pathParameters = + UserusernamePutPathParameters.UserusernamePutPathParameters1.validate( + new UserusernamePutPathParameters.UserusernamePutPathParametersMapBuilder() + .username("a") + + .build(), + schemaConfiguration +); + +var request = new UserusernamePut.PutRequestBuilder() + .requestBody(requestBody) + .pathParameters(pathParameters) + .build(); + +Void response; +try { + response = apiClient.put(request); +} catch (UserusernamePutCode400Response.ResponseApiException | UserusernamePutCode404Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/tags/Anotherfake.md b/samples/client/petstore/java/docs/apis/tags/Anotherfake.md new file mode 100644 index 00000000000..98beb981514 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/tags/Anotherfake.md @@ -0,0 +1,116 @@ +# Anotherfake + +public class Anotherfake extends extends ApiClient implements +[AnotherfakedummyPatch.Model123TestSpecialTagsOperation](../../paths/anotherfakedummy/AnotherfakedummyPatch.md#model123testspecialtagsoperation) + +an api client class which contains all the routes for tag="$another-fake?" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [AnotherfakedummyPatchResponses.EndpointResponse](../../paths/anotherfakedummy/patch/AnotherfakedummyPatchResponses.md#endpointresponse) | [model123TestSpecialTags](#model123testspecialtags)([AnotherfakedummyPatch.PatchRequest](../../paths/anotherfakedummy/AnotherfakedummyPatch.md#patchrequest) request)
To test special tags and operation ID starting with number | + +## Method Detail + +### model123TestSpecialTags +public [AnotherfakedummyPatchResponses.EndpointResponse](../../paths/anotherfakedummy/patch/AnotherfakedummyPatchResponses.md#endpointresponse) model123TestSpecialTags([AnotherfakedummyPatch.PatchRequest](../../paths/anotherfakedummy/AnotherfakedummyPatch.md#patchrequest) request) + +To test special tags and operation ID starting with number + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.anotherfakedummy.patch.AnotherfakedummyPatchRequestBody; +import org.openapijsonschematools.client.components.schemas.Client; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.anotherfakedummy.patch.responses.AnotherfakedummyPatchCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Anotherfake; +import org.openapijsonschematools.client.paths.anotherfakedummy.patch.AnotherfakedummyPatchResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Anotherfake apiClient = new Anotherfake(apiConfiguration, schemaConfiguration); + + +Client1BoxedMap requestBodyPayload = + Client.Client1.validateAndBox( + new Client.ClientMapBuilder1() + .client("a") + + .build(), + schemaConfiguration +); +AnotherfakedummyPatchRequestBody.SealedRequestBody requestBody = new AnotherfakedummyPatchRequestBody.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new AnotherfakedummyPatch.PatchRequestBuilder() + .requestBody(requestBody) + .build(); + +AnotherfakedummyPatchResponses.EndpointResponse response; +try { + response = apiClient.patch(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +AnotherfakedummyPatchResponses.EndpointAnotherfakedummyPatchCode200Response castResponse = (AnotherfakedummyPatchResponses.EndpointAnotherfakedummyPatchCode200Response) response; +AnotherfakedummyPatchCode200Response.ApplicationjsonResponseBody deserializedBody = (AnotherfakedummyPatchCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/tags/Default.md b/samples/client/petstore/java/docs/apis/tags/Default.md new file mode 100644 index 00000000000..c39a91a4294 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/tags/Default.md @@ -0,0 +1,100 @@ +# Default + +public class Default extends extends ApiClient implements +[FooGet.FooGetOperation](../../paths/foo/FooGet.md#foogetoperation) + +an api client class which contains all the routes for tag="default" +operations that lack tags are assigned this default tag + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FooGetResponses.EndpointResponse](../../paths/foo/get/FooGetResponses.md#endpointresponse) | [fooGet](#fooget)([FooGet.GetRequest](../../paths/foo/FooGet.md#getrequest) request) | + +## Method Detail + +### fooGet +public [FooGetResponses.EndpointResponse](../../paths/foo/get/FooGetResponses.md#endpointresponse) fooGet([FooGet.GetRequest](../../paths/foo/FooGet.md#getrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.foo.get.FooGetServerInfo; +import org.openapijsonschematools.client.paths.foo.get.servers.FooGetServer0; +import org.openapijsonschematools.client.paths.foo.get.servers.FooGetServer1; +import org.openapijsonschematools.client.paths.foo.get.responses.FooGetCodedefaultResponse; +import org.openapijsonschematools.client.paths.foo.get.FooGetServerInfo; +import org.openapijsonschematools.client.apis.tags.Default; +import org.openapijsonschematools.client.paths.foo.get.FooGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .fooGetServerInfo( + new FooGetServerInfo.FooGetServerInfoBuilder() + .fooGetServer0(new FooGetServer0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .fooGetServerInfoServerIndex(FooGetServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Default apiClient = new Default(apiConfiguration, schemaConfiguration); + + +var request = new FooGet.GetRequestBuilder().build(); + +FooGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FooGetResponses.EndpointFooGetCodedefaultResponse castResponse = (FooGetResponses.EndpointFooGetCodedefaultResponse) response; +FooGetCodedefaultResponse.ApplicationjsonResponseBody deserializedBody = (FooGetCodedefaultResponse.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/tags/Fake.md b/samples/client/petstore/java/docs/apis/tags/Fake.md new file mode 100644 index 00000000000..8b8e520115f --- /dev/null +++ b/samples/client/petstore/java/docs/apis/tags/Fake.md @@ -0,0 +1,4175 @@ +# Fake + +public class Fake extends extends ApiClient implements +[FakejsonpatchPatch.JsonPatchOperation](../../paths/fakejsonpatch/FakejsonpatchPatch.md#jsonpatchoperation), +[FakerefsarrayofenumsPost.ArrayOfEnumsOperation](../../paths/fakerefsarrayofenums/FakerefsarrayofenumsPost.md#arrayofenumsoperation), +[CommonparamsubdirDelete.DeleteCommonParamOperation](../../paths/commonparamsubdir/CommonparamsubdirDelete.md#deletecommonparamoperation), +[CommonparamsubdirGet.GetCommonParamOperation](../../paths/commonparamsubdir/CommonparamsubdirGet.md#getcommonparamoperation), +[CommonparamsubdirPost.PostCommonParamOperation](../../paths/commonparamsubdir/CommonparamsubdirPost.md#postcommonparamoperation), +[FakecasesensitiveparamsPut.CaseSensitiveParamsOperation](../../paths/fakecasesensitiveparams/FakecasesensitiveparamsPut.md#casesensitiveparamsoperation), +[FakewildcardresponsesGet.WildCardResponsesOperation](../../paths/fakewildcardresponses/FakewildcardresponsesGet.md#wildcardresponsesoperation), +[FakebodywithqueryparamsPut.BodyWithQueryParamsOperation](../../paths/fakebodywithqueryparams/FakebodywithqueryparamsPut.md#bodywithqueryparamsoperation), +[FakejsonwithcharsetPost.JsonWithCharsetOperation](../../paths/fakejsonwithcharset/FakejsonwithcharsetPost.md#jsonwithcharsetoperation), +[FakerefsarraymodelPost.ArrayModelOperation](../../paths/fakerefsarraymodel/FakerefsarraymodelPost.md#arraymodeloperation), +[FakehealthGet.FakeHealthGetOperation](../../paths/fakehealth/FakehealthGet.md#fakehealthgetoperation), +[FakerefscomposedoneofnumberwithvalidationsPost.ComposedOneOfDifferentTypesOperation](../../paths/fakerefscomposedoneofnumberwithvalidations/FakerefscomposedoneofnumberwithvalidationsPost.md#composedoneofdifferenttypesoperation), +[FakerefobjinqueryGet.RefObjectInQueryOperation](../../paths/fakerefobjinquery/FakerefobjinqueryGet.md#refobjectinqueryoperation), +[FakebodywithfileschemaPut.BodyWithFileSchemaOperation](../../paths/fakebodywithfileschema/FakebodywithfileschemaPut.md#bodywithfileschemaoperation), +[FakerefsenumPost.StringEnumOperation](../../paths/fakerefsenum/FakerefsenumPost.md#stringenumoperation), +[FakeredirectionGet.RedirectionOperation](../../paths/fakeredirection/FakeredirectionGet.md#redirectionoperation), +[FakeuploadfilePost.UploadFileOperation](../../paths/fakeuploadfile/FakeuploadfilePost.md#uploadfileoperation), +[FakeinlinecompositionPost.InlineCompositionOperation](../../paths/fakeinlinecomposition/FakeinlinecompositionPost.md#inlinecompositionoperation), +[FakeDelete.GroupParametersOperation](../../paths/fake/FakeDelete.md#groupparametersoperation), +[FakeGet.EnumParametersOperation](../../paths/fake/FakeGet.md#enumparametersoperation), +[FakePatch.ClientModelOperation](../../paths/fake/FakePatch.md#clientmodeloperation), +[FakePost.EndpointParametersOperation](../../paths/fake/FakePost.md#endpointparametersoperation), +[FakerefsobjectmodelwithrefpropsPost.ObjectModelWithRefPropsOperation](../../paths/fakerefsobjectmodelwithrefprops/FakerefsobjectmodelwithrefpropsPost.md#objectmodelwithrefpropsoperation), +[FakepemcontenttypeGet.PemContentTypeOperation](../../paths/fakepemcontenttype/FakepemcontenttypeGet.md#pemcontenttypeoperation), +[FakerefsnumberPost.NumberWithValidationsOperation](../../paths/fakerefsnumber/FakerefsnumberPost.md#numberwithvalidationsoperation), +[FakerefsstringPost.ModelStringOperation](../../paths/fakerefsstring/FakerefsstringPost.md#modelstringoperation), +[FakeinlineadditionalpropertiesPost.InlineAdditionalPropertiesOperation](../../paths/fakeinlineadditionalproperties/FakeinlineadditionalpropertiesPost.md#inlineadditionalpropertiesoperation), +[FakerefsmammalPost.MammalOperation](../../paths/fakerefsmammal/FakerefsmammalPost.md#mammaloperation), +[SolidusGet.SlashRouteOperation](../../paths/solidus/SolidusGet.md#slashrouteoperation), +[FakerefsbooleanPost.ModelBooleanOperation](../../paths/fakerefsboolean/FakerefsbooleanPost.md#modelbooleanoperation), +[FakejsonformdataGet.JsonFormDataOperation](../../paths/fakejsonformdata/FakejsonformdataGet.md#jsonformdataoperation), +[Fakeparametercollisions1ababselfabPost.ParameterCollisionsOperation](../../paths/fakeparametercollisions1ababselfab/Fakeparametercollisions1ababselfabPost.md#parametercollisionsoperation), +[FakequeryparamwithjsoncontenttypeGet.QueryParamWithJsonContentTypeOperation](../../paths/fakequeryparamwithjsoncontenttype/FakequeryparamwithjsoncontenttypeGet.md#queryparamwithjsoncontenttypeoperation), +[FakeobjinqueryGet.ObjectInQueryOperation](../../paths/fakeobjinquery/FakeobjinqueryGet.md#objectinqueryoperation), +[FakemultiplesecuritiesGet.MultipleSecuritiesOperation](../../paths/fakemultiplesecurities/FakemultiplesecuritiesGet.md#multiplesecuritiesoperation), +[FaketestqueryparamtersPut.QueryParameterCollectionFormatOperation](../../paths/faketestqueryparamters/FaketestqueryparamtersPut.md#queryparametercollectionformatoperation), +[FakemultipleresponsebodiesGet.MultipleResponseBodiesOperation](../../paths/fakemultipleresponsebodies/FakemultipleresponsebodiesGet.md#multipleresponsebodiesoperation), +[FakeresponsewithoutschemaGet.ResponseWithoutSchemaOperation](../../paths/fakeresponsewithoutschema/FakeresponsewithoutschemaGet.md#responsewithoutschemaoperation), +[FakemultiplerequestbodycontenttypesPost.MultipleRequestBodyContentTypesOperation](../../paths/fakemultiplerequestbodycontenttypes/FakemultiplerequestbodycontenttypesPost.md#multiplerequestbodycontenttypesoperation), +[FakeuploaddownloadfilePost.UploadDownloadFileOperation](../../paths/fakeuploaddownloadfile/FakeuploaddownloadfilePost.md#uploaddownloadfileoperation), +[FakeuploadfilesPost.UploadFilesOperation](../../paths/fakeuploadfiles/FakeuploadfilesPost.md#uploadfilesoperation), +[FakeadditionalpropertieswitharrayofenumsGet.AdditionalPropertiesWithArrayOfEnumsOperation](../../paths/fakeadditionalpropertieswitharrayofenums/FakeadditionalpropertieswitharrayofenumsGet.md#additionalpropertieswitharrayofenumsoperation), +[FakedeletecoffeeidDelete.DeleteCoffeeOperation](../../paths/fakedeletecoffeeid/FakedeletecoffeeidDelete.md#deletecoffeeoperation) + +an api client class which contains all the routes for tag="fake" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakejsonpatchPatchResponses.EndpointResponse](../../paths/fakejsonpatch/patch/FakejsonpatchPatchResponses.md#endpointresponse) | [jsonPatch](#jsonpatch)([FakejsonpatchPatch.PatchRequest](../../paths/fakejsonpatch/FakejsonpatchPatch.md#patchrequest) request)
json patch route with a requestBody | +| [FakerefsarrayofenumsPostResponses.EndpointResponse](../../paths/fakerefsarrayofenums/post/FakerefsarrayofenumsPostResponses.md#endpointresponse) | [arrayOfEnums](#arrayofenums)([FakerefsarrayofenumsPost.PostRequest](../../paths/fakerefsarrayofenums/FakerefsarrayofenumsPost.md#postrequest) request) | +| [CommonparamsubdirDeleteResponses.EndpointResponse](../../paths/commonparamsubdir/delete/CommonparamsubdirDeleteResponses.md#endpointresponse) | [deleteCommonParam](#deletecommonparam)([CommonparamsubdirDelete.DeleteRequest](../../paths/commonparamsubdir/CommonparamsubdirDelete.md#deleterequest) request)
common param is overwritten | +| [CommonparamsubdirGetResponses.EndpointResponse](../../paths/commonparamsubdir/get/CommonparamsubdirGetResponses.md#endpointresponse) | [getCommonParam](#getcommonparam)([CommonparamsubdirGet.GetRequest](../../paths/commonparamsubdir/CommonparamsubdirGet.md#getrequest) request) | +| [CommonparamsubdirPostResponses.EndpointResponse](../../paths/commonparamsubdir/post/CommonparamsubdirPostResponses.md#endpointresponse) | [postCommonParam](#postcommonparam)([CommonparamsubdirPost.PostRequest](../../paths/commonparamsubdir/CommonparamsubdirPost.md#postrequest) request) | +| [FakecasesensitiveparamsPutResponses.EndpointResponse](../../paths/fakecasesensitiveparams/put/FakecasesensitiveparamsPutResponses.md#endpointresponse) | [caseSensitiveParams](#casesensitiveparams)([FakecasesensitiveparamsPut.PutRequest](../../paths/fakecasesensitiveparams/FakecasesensitiveparamsPut.md#putrequest) request)
Ensures that original naming is used in endpoint params, that way we don't have collisions | +| [FakewildcardresponsesGetResponses.EndpointResponse](../../paths/fakewildcardresponses/get/FakewildcardresponsesGetResponses.md#endpointresponse) | [wildCardResponses](#wildcardresponses)([FakewildcardresponsesGet.GetRequest](../../paths/fakewildcardresponses/FakewildcardresponsesGet.md#getrequest) request) | +| [FakebodywithqueryparamsPutResponses.EndpointResponse](../../paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutResponses.md#endpointresponse) | [bodyWithQueryParams](#bodywithqueryparams)([FakebodywithqueryparamsPut.PutRequest](../../paths/fakebodywithqueryparams/FakebodywithqueryparamsPut.md#putrequest) request) | +| [FakejsonwithcharsetPostResponses.EndpointResponse](../../paths/fakejsonwithcharset/post/FakejsonwithcharsetPostResponses.md#endpointresponse) | [jsonWithCharset](#jsonwithcharset)([FakejsonwithcharsetPost.PostRequest](../../paths/fakejsonwithcharset/FakejsonwithcharsetPost.md#postrequest) request) | +| [FakerefsarraymodelPostResponses.EndpointResponse](../../paths/fakerefsarraymodel/post/FakerefsarraymodelPostResponses.md#endpointresponse) | [arrayModel](#arraymodel)([FakerefsarraymodelPost.PostRequest](../../paths/fakerefsarraymodel/FakerefsarraymodelPost.md#postrequest) request)
Test serialization of ArrayModel | +| [FakehealthGetResponses.EndpointResponse](../../paths/fakehealth/get/FakehealthGetResponses.md#endpointresponse) | [fakeHealthGet](#fakehealthget)([FakehealthGet.GetRequest](../../paths/fakehealth/FakehealthGet.md#getrequest) request) | +| [FakerefscomposedoneofnumberwithvalidationsPostResponses.EndpointResponse](../../paths/fakerefscomposedoneofnumberwithvalidations/post/FakerefscomposedoneofnumberwithvalidationsPostResponses.md#endpointresponse) | [composedOneOfDifferentTypes](#composedoneofdifferenttypes)([FakerefscomposedoneofnumberwithvalidationsPost.PostRequest](../../paths/fakerefscomposedoneofnumberwithvalidations/FakerefscomposedoneofnumberwithvalidationsPost.md#postrequest) request)
Test serialization of object with $refed properties | +| [FakerefobjinqueryGetResponses.EndpointResponse](../../paths/fakerefobjinquery/get/FakerefobjinqueryGetResponses.md#endpointresponse) | [refObjectInQuery](#refobjectinquery)([FakerefobjinqueryGet.GetRequest](../../paths/fakerefobjinquery/FakerefobjinqueryGet.md#getrequest) request) | +| [FakebodywithfileschemaPutResponses.EndpointResponse](../../paths/fakebodywithfileschema/put/FakebodywithfileschemaPutResponses.md#endpointresponse) | [bodyWithFileSchema](#bodywithfileschema)([FakebodywithfileschemaPut.PutRequest](../../paths/fakebodywithfileschema/FakebodywithfileschemaPut.md#putrequest) request)
For this test, the body for this request much reference a schema named `File`. | +| [FakerefsenumPostResponses.EndpointResponse](../../paths/fakerefsenum/post/FakerefsenumPostResponses.md#endpointresponse) | [stringEnum](#stringenum)([FakerefsenumPost.PostRequest](../../paths/fakerefsenum/FakerefsenumPost.md#postrequest) request)
Test serialization of outer enum | +| [FakeredirectionGetResponses.EndpointResponse](../../paths/fakeredirection/get/FakeredirectionGetResponses.md#endpointresponse) | [redirection](#redirection)([FakeredirectionGet.GetRequest](../../paths/fakeredirection/FakeredirectionGet.md#getrequest) request) | +| [FakeuploadfilePostResponses.EndpointResponse](../../paths/fakeuploadfile/post/FakeuploadfilePostResponses.md#endpointresponse) | [uploadFile](#uploadfile)([FakeuploadfilePost.PostRequest](../../paths/fakeuploadfile/FakeuploadfilePost.md#postrequest) request)
| +| [FakeinlinecompositionPostResponses.EndpointResponse](../../paths/fakeinlinecomposition/post/FakeinlinecompositionPostResponses.md#endpointresponse) | [inlineComposition](#inlinecomposition)([FakeinlinecompositionPost.PostRequest](../../paths/fakeinlinecomposition/FakeinlinecompositionPost.md#postrequest) request)
composed schemas at inline locations + multiple requestBody content types | +| [FakeDeleteResponses.EndpointResponse](../../paths/fake/delete/FakeDeleteResponses.md#endpointresponse) | [groupParameters](#groupparameters)([FakeDelete.DeleteRequest](../../paths/fake/FakeDelete.md#deleterequest) request)
Fake endpoint to test group parameters (optional) | +| [FakeGetResponses.EndpointResponse](../../paths/fake/get/FakeGetResponses.md#endpointresponse) | [enumParameters](#enumparameters)([FakeGet.GetRequest](../../paths/fake/FakeGet.md#getrequest) request)
To test enum parameters | +| [FakePatchResponses.EndpointResponse](../../paths/fake/patch/FakePatchResponses.md#endpointresponse) | [clientModel](#clientmodel)([FakePatch.PatchRequest](../../paths/fake/FakePatch.md#patchrequest) request)
To test "client" model | +| [FakePostResponses.EndpointResponse](../../paths/fake/post/FakePostResponses.md#endpointresponse) | [endpointParameters](#endpointparameters)([FakePost.PostRequest](../../paths/fake/FakePost.md#postrequest) request)
Fake endpoint for testing various parameters
假端點
偽のエンドポイント
가짜 엔드 포인트
| +| [FakerefsobjectmodelwithrefpropsPostResponses.EndpointResponse](../../paths/fakerefsobjectmodelwithrefprops/post/FakerefsobjectmodelwithrefpropsPostResponses.md#endpointresponse) | [objectModelWithRefProps](#objectmodelwithrefprops)([FakerefsobjectmodelwithrefpropsPost.PostRequest](../../paths/fakerefsobjectmodelwithrefprops/FakerefsobjectmodelwithrefpropsPost.md#postrequest) request)
Test serialization of object with $refed properties | +| [FakepemcontenttypeGetResponses.EndpointResponse](../../paths/fakepemcontenttype/get/FakepemcontenttypeGetResponses.md#endpointresponse) | [pemContentType](#pemcontenttype)([FakepemcontenttypeGet.GetRequest](../../paths/fakepemcontenttype/FakepemcontenttypeGet.md#getrequest) request) | +| [FakerefsnumberPostResponses.EndpointResponse](../../paths/fakerefsnumber/post/FakerefsnumberPostResponses.md#endpointresponse) | [numberWithValidations](#numberwithvalidations)([FakerefsnumberPost.PostRequest](../../paths/fakerefsnumber/FakerefsnumberPost.md#postrequest) request)
Test serialization of outer number types | +| [FakerefsstringPostResponses.EndpointResponse](../../paths/fakerefsstring/post/FakerefsstringPostResponses.md#endpointresponse) | [modelString](#modelstring)([FakerefsstringPost.PostRequest](../../paths/fakerefsstring/FakerefsstringPost.md#postrequest) request)
Test serialization of outer string types | +| [FakeinlineadditionalpropertiesPostResponses.EndpointResponse](../../paths/fakeinlineadditionalproperties/post/FakeinlineadditionalpropertiesPostResponses.md#endpointresponse) | [inlineAdditionalProperties](#inlineadditionalproperties)([FakeinlineadditionalpropertiesPost.PostRequest](../../paths/fakeinlineadditionalproperties/FakeinlineadditionalpropertiesPost.md#postrequest) request)
| +| [FakerefsmammalPostResponses.EndpointResponse](../../paths/fakerefsmammal/post/FakerefsmammalPostResponses.md#endpointresponse) | [mammal](#mammal)([FakerefsmammalPost.PostRequest](../../paths/fakerefsmammal/FakerefsmammalPost.md#postrequest) request)
Test serialization of mammals | +| [SolidusGetResponses.EndpointResponse](../../paths/solidus/get/SolidusGetResponses.md#endpointresponse) | [slashRoute](#slashroute)([SolidusGet.GetRequest](../../paths/solidus/SolidusGet.md#getrequest) request) | +| [FakerefsbooleanPostResponses.EndpointResponse](../../paths/fakerefsboolean/post/FakerefsbooleanPostResponses.md#endpointresponse) | [modelBoolean](#modelboolean)([FakerefsbooleanPost.PostRequest](../../paths/fakerefsboolean/FakerefsbooleanPost.md#postrequest) request)
Test serialization of outer boolean types | +| [FakejsonformdataGetResponses.EndpointResponse](../../paths/fakejsonformdata/get/FakejsonformdataGetResponses.md#endpointresponse) | [jsonFormData](#jsonformdata)([FakejsonformdataGet.GetRequest](../../paths/fakejsonformdata/FakejsonformdataGet.md#getrequest) request)
| +| [Fakeparametercollisions1ababselfabPostResponses.EndpointResponse](../../paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostResponses.md#endpointresponse) | [parameterCollisions](#parametercollisions)([Fakeparametercollisions1ababselfabPost.PostRequest](../../paths/fakeparametercollisions1ababselfab/Fakeparametercollisions1ababselfabPost.md#postrequest) request) | +| [FakequeryparamwithjsoncontenttypeGetResponses.EndpointResponse](../../paths/fakequeryparamwithjsoncontenttype/get/FakequeryparamwithjsoncontenttypeGetResponses.md#endpointresponse) | [queryParamWithJsonContentType](#queryparamwithjsoncontenttype)([FakequeryparamwithjsoncontenttypeGet.GetRequest](../../paths/fakequeryparamwithjsoncontenttype/FakequeryparamwithjsoncontenttypeGet.md#getrequest) request) | +| [FakeobjinqueryGetResponses.EndpointResponse](../../paths/fakeobjinquery/get/FakeobjinqueryGetResponses.md#endpointresponse) | [objectInQuery](#objectinquery)([FakeobjinqueryGet.GetRequest](../../paths/fakeobjinquery/FakeobjinqueryGet.md#getrequest) request) | +| [FakemultiplesecuritiesGetResponses.EndpointResponse](../../paths/fakemultiplesecurities/get/FakemultiplesecuritiesGetResponses.md#endpointresponse) | [multipleSecurities](#multiplesecurities)([FakemultiplesecuritiesGet.GetRequest](../../paths/fakemultiplesecurities/FakemultiplesecuritiesGet.md#getrequest) request) | +| [FaketestqueryparamtersPutResponses.EndpointResponse](../../paths/faketestqueryparamters/put/FaketestqueryparamtersPutResponses.md#endpointresponse) | [queryParameterCollectionFormat](#queryparametercollectionformat)([FaketestqueryparamtersPut.PutRequest](../../paths/faketestqueryparamters/FaketestqueryparamtersPut.md#putrequest) request)
To test the collection format in query parameters | +| [FakemultipleresponsebodiesGetResponses.EndpointResponse](../../paths/fakemultipleresponsebodies/get/FakemultipleresponsebodiesGetResponses.md#endpointresponse) | [multipleResponseBodies](#multipleresponsebodies)([FakemultipleresponsebodiesGet.GetRequest](../../paths/fakemultipleresponsebodies/FakemultipleresponsebodiesGet.md#getrequest) request) | +| [FakeresponsewithoutschemaGetResponses.EndpointResponse](../../paths/fakeresponsewithoutschema/get/FakeresponsewithoutschemaGetResponses.md#endpointresponse) | [responseWithoutSchema](#responsewithoutschema)([FakeresponsewithoutschemaGet.GetRequest](../../paths/fakeresponsewithoutschema/FakeresponsewithoutschemaGet.md#getrequest) request) | +| [FakemultiplerequestbodycontenttypesPostResponses.EndpointResponse](../../paths/fakemultiplerequestbodycontenttypes/post/FakemultiplerequestbodycontenttypesPostResponses.md#endpointresponse) | [multipleRequestBodyContentTypes](#multiplerequestbodycontenttypes)([FakemultiplerequestbodycontenttypesPost.PostRequest](../../paths/fakemultiplerequestbodycontenttypes/FakemultiplerequestbodycontenttypesPost.md#postrequest) request)
composed schemas at inline locations + multiple requestBody content types | +| [FakeuploaddownloadfilePostResponses.EndpointResponse](../../paths/fakeuploaddownloadfile/post/FakeuploaddownloadfilePostResponses.md#endpointresponse) | [uploadDownloadFile](#uploaddownloadfile)([FakeuploaddownloadfilePost.PostRequest](../../paths/fakeuploaddownloadfile/FakeuploaddownloadfilePost.md#postrequest) request)
| +| [FakeuploadfilesPostResponses.EndpointResponse](../../paths/fakeuploadfiles/post/FakeuploadfilesPostResponses.md#endpointresponse) | [uploadFiles](#uploadfiles)([FakeuploadfilesPost.PostRequest](../../paths/fakeuploadfiles/FakeuploadfilesPost.md#postrequest) request)
| +| [FakeadditionalpropertieswitharrayofenumsGetResponses.EndpointResponse](../../paths/fakeadditionalpropertieswitharrayofenums/get/FakeadditionalpropertieswitharrayofenumsGetResponses.md#endpointresponse) | [additionalPropertiesWithArrayOfEnums](#additionalpropertieswitharrayofenums)([FakeadditionalpropertieswitharrayofenumsGet.GetRequest](../../paths/fakeadditionalpropertieswitharrayofenums/FakeadditionalpropertieswitharrayofenumsGet.md#getrequest) request) | +| [FakedeletecoffeeidDeleteResponses.EndpointResponse](../../paths/fakedeletecoffeeid/delete/FakedeletecoffeeidDeleteResponses.md#endpointresponse) | [deleteCoffee](#deletecoffee)([FakedeletecoffeeidDelete.DeleteRequest](../../paths/fakedeletecoffeeid/FakedeletecoffeeidDelete.md#deleterequest) request)
Delete the coffee identified by the given id, (delete without request body) | + +## Method Detail + +### jsonPatch +public [FakejsonpatchPatchResponses.EndpointResponse](../../paths/fakejsonpatch/patch/FakejsonpatchPatchResponses.md#endpointresponse) jsonPatch([FakejsonpatchPatch.PatchRequest](../../paths/fakejsonpatch/FakejsonpatchPatch.md#patchrequest) request) + +json patch route with a requestBody + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakejsonpatch.patch.FakejsonpatchPatchRequestBody; +import org.openapijsonschematools.client.components.schemas.JSONPatchRequest; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakejsonpatch.patch.responses.FakejsonpatchPatchCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakejsonpatch.patch.FakejsonpatchPatchResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new FakejsonpatchPatch.PatchRequestBuilder().build(); + +FakejsonpatchPatchResponses.EndpointResponse response; +try { + response = apiClient.patch(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakejsonpatchPatchResponses.EndpointFakejsonpatchPatchCode200Response castResponse = (FakejsonpatchPatchResponses.EndpointFakejsonpatchPatchCode200Response) response; +``` +### arrayOfEnums +public [FakerefsarrayofenumsPostResponses.EndpointResponse](../../paths/fakerefsarrayofenums/post/FakerefsarrayofenumsPostResponses.md#endpointresponse) arrayOfEnums([FakerefsarrayofenumsPost.PostRequest](../../paths/fakerefsarrayofenums/FakerefsarrayofenumsPost.md#postrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakerefsarrayofenums.post.FakerefsarrayofenumsPostRequestBody; +import org.openapijsonschematools.client.components.schemas.ArrayOfEnums; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefsarrayofenums.post.responses.FakerefsarrayofenumsPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakerefsarrayofenums.post.FakerefsarrayofenumsPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new FakerefsarrayofenumsPost.PostRequestBuilder().build(); + +FakerefsarrayofenumsPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefsarrayofenumsPostResponses.EndpointFakerefsarrayofenumsPostCode200Response castResponse = (FakerefsarrayofenumsPostResponses.EndpointFakerefsarrayofenumsPostCode200Response) response; +FakerefsarrayofenumsPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakerefsarrayofenumsPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### deleteCommonParam +public [CommonparamsubdirDeleteResponses.EndpointResponse](../../paths/commonparamsubdir/delete/CommonparamsubdirDeleteResponses.md#endpointresponse) deleteCommonParam([CommonparamsubdirDelete.DeleteRequest](../../paths/commonparamsubdir/CommonparamsubdirDelete.md#deleterequest) request) + +common param is overwritten + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.commonparamsubdir.delete.CommonparamsubdirDeleteHeaderParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.commonparamsubdir.delete.CommonparamsubdirDeletePathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.commonparamsubdir.delete.responses.CommonparamsubdirDeleteCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.commonparamsubdir.delete.CommonparamsubdirDeleteResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +// Map validation +CommonparamsubdirDeletePathParameters.CommonparamsubdirDeletePathParametersMap pathParameters = + CommonparamsubdirDeletePathParameters.CommonparamsubdirDeletePathParameters1.validate( + new CommonparamsubdirDeletePathParameters.CommonparamsubdirDeletePathParametersMapBuilder() + .subDir("c") + + .build(), + schemaConfiguration +); + +var request = new CommonparamsubdirDelete.DeleteRequestBuilder() + .pathParameters(pathParameters) + .build(); + +CommonparamsubdirDeleteResponses.EndpointResponse response; +try { + response = apiClient.delete(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +CommonparamsubdirDeleteResponses.EndpointCommonparamsubdirDeleteCode200Response castResponse = (CommonparamsubdirDeleteResponses.EndpointCommonparamsubdirDeleteCode200Response) response; +``` +### getCommonParam +public [CommonparamsubdirGetResponses.EndpointResponse](../../paths/commonparamsubdir/get/CommonparamsubdirGetResponses.md#endpointresponse) getCommonParam([CommonparamsubdirGet.GetRequest](../../paths/commonparamsubdir/CommonparamsubdirGet.md#getrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.commonparamsubdir.get.CommonparamsubdirGetQueryParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.commonparamsubdir.get.CommonparamsubdirGetPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.commonparamsubdir.get.responses.CommonparamsubdirGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.commonparamsubdir.get.CommonparamsubdirGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +// Map validation +CommonparamsubdirGetPathParameters.CommonparamsubdirGetPathParametersMap pathParameters = + CommonparamsubdirGetPathParameters.CommonparamsubdirGetPathParameters1.validate( + new CommonparamsubdirGetPathParameters.CommonparamsubdirGetPathParametersMapBuilder() + .subDir("a") + + .build(), + schemaConfiguration +); + +var request = new CommonparamsubdirGet.GetRequestBuilder() + .pathParameters(pathParameters) + .build(); + +CommonparamsubdirGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +CommonparamsubdirGetResponses.EndpointCommonparamsubdirGetCode200Response castResponse = (CommonparamsubdirGetResponses.EndpointCommonparamsubdirGetCode200Response) response; +``` +### postCommonParam +public [CommonparamsubdirPostResponses.EndpointResponse](../../paths/commonparamsubdir/post/CommonparamsubdirPostResponses.md#endpointresponse) postCommonParam([CommonparamsubdirPost.PostRequest](../../paths/commonparamsubdir/CommonparamsubdirPost.md#postrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.commonparamsubdir.post.CommonparamsubdirPostHeaderParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.commonparamsubdir.post.CommonparamsubdirPostPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.commonparamsubdir.post.responses.CommonparamsubdirPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.commonparamsubdir.post.CommonparamsubdirPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +// Map validation +CommonparamsubdirPostPathParameters.CommonparamsubdirPostPathParametersMap pathParameters = + CommonparamsubdirPostPathParameters.CommonparamsubdirPostPathParameters1.validate( + new CommonparamsubdirPostPathParameters.CommonparamsubdirPostPathParametersMapBuilder() + .subDir("a") + + .build(), + schemaConfiguration +); + +var request = new CommonparamsubdirPost.PostRequestBuilder() + .pathParameters(pathParameters) + .build(); + +CommonparamsubdirPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +CommonparamsubdirPostResponses.EndpointCommonparamsubdirPostCode200Response castResponse = (CommonparamsubdirPostResponses.EndpointCommonparamsubdirPostCode200Response) response; +``` +### caseSensitiveParams +public [FakecasesensitiveparamsPutResponses.EndpointResponse](../../paths/fakecasesensitiveparams/put/FakecasesensitiveparamsPutResponses.md#endpointresponse) caseSensitiveParams([FakecasesensitiveparamsPut.PutRequest](../../paths/fakecasesensitiveparams/FakecasesensitiveparamsPut.md#putrequest) request) + +Ensures that original naming is used in endpoint params, that way we don't have collisions + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.FakecasesensitiveparamsPutQueryParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.responses.FakecasesensitiveparamsPutCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.FakecasesensitiveparamsPutResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +// Map validation +FakecasesensitiveparamsPutQueryParameters.FakecasesensitiveparamsPutQueryParametersMap queryParameters = + FakecasesensitiveparamsPutQueryParameters.FakecasesensitiveparamsPutQueryParameters1.validate( + new FakecasesensitiveparamsPutQueryParameters.FakecasesensitiveparamsPutQueryParametersMapBuilder() + .SomeVar("a") + + .someVar("a") + + .some_var("a") + + .build(), + schemaConfiguration +); + +var request = new FakecasesensitiveparamsPut.PutRequestBuilder() + .queryParameters(queryParameters) + .build(); + +FakecasesensitiveparamsPutResponses.EndpointResponse response; +try { + response = apiClient.put(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakecasesensitiveparamsPutResponses.EndpointFakecasesensitiveparamsPutCode200Response castResponse = (FakecasesensitiveparamsPutResponses.EndpointFakecasesensitiveparamsPutCode200Response) response; +``` +### wildCardResponses +public [FakewildcardresponsesGetResponses.EndpointResponse](../../paths/fakewildcardresponses/get/FakewildcardresponsesGetResponses.md#endpointresponse) wildCardResponses([FakewildcardresponsesGet.GetRequest](../../paths/fakewildcardresponses/FakewildcardresponsesGet.md#getrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.FakewildcardresponsesGetCode1XXResponse; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.FakewildcardresponsesGetCode200Response; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.FakewildcardresponsesGetCode2XXResponse; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.FakewildcardresponsesGetCode3XXResponse; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.FakewildcardresponsesGetCode4XXResponse; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.FakewildcardresponsesGetCode5XXResponse; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.FakewildcardresponsesGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new FakewildcardresponsesGet.GetRequestBuilder().build(); + +FakewildcardresponsesGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (FakewildcardresponsesGetCode4XXResponse.ResponseApiException | FakewildcardresponsesGetCode5XXResponse.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +if (response instanceof FakewildcardresponsesGetResponses.EndpointFakewildcardresponsesGetCode1XXResponse castResponse) { +FakewildcardresponsesGetCode1XXResponse.ApplicationjsonResponseBody deserializedBody = (FakewildcardresponsesGetCode1XXResponse.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +} else if (response instanceof FakewildcardresponsesGetResponses.EndpointFakewildcardresponsesGetCode2XXResponse castResponse) { +FakewildcardresponsesGetCode2XXResponse.ApplicationjsonResponseBody deserializedBody = (FakewildcardresponsesGetCode2XXResponse.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +} else if (response instanceof FakewildcardresponsesGetResponses.EndpointFakewildcardresponsesGetCode200Response castResponse) { +FakewildcardresponsesGetCode200Response.ApplicationjsonResponseBody deserializedBody = (FakewildcardresponsesGetCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +} else { + FakewildcardresponsesGetResponses.EndpointFakewildcardresponsesGetCode3XXResponse castResponse = (FakewildcardresponsesGetResponses.EndpointFakewildcardresponsesGetCode3XXResponse) response; +FakewildcardresponsesGetCode3XXResponse.ApplicationjsonResponseBody deserializedBody = (FakewildcardresponsesGetCode3XXResponse.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +} +``` +### bodyWithQueryParams +public [FakebodywithqueryparamsPutResponses.EndpointResponse](../../paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutResponses.md#endpointresponse) bodyWithQueryParams([FakebodywithqueryparamsPut.PutRequest](../../paths/fakebodywithqueryparams/FakebodywithqueryparamsPut.md#putrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.FakebodywithqueryparamsPutRequestBody; +import org.openapijsonschematools.client.components.schemas.User; +import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.FakebodywithqueryparamsPutQueryParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.responses.FakebodywithqueryparamsPutCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.FakebodywithqueryparamsPutResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +User1BoxedMap requestBodyPayload = + User.User1.validateAndBox( + new User.UserMapBuilder() + .id(1L) + + .username("a") + + .firstName("a") + + .lastName("a") + + .email("a") + + .password("a") + + .phone("a") + + .userStatus(1) + + .objectWithNoDeclaredPropsNullable(null) + + .build(), + schemaConfiguration +); +FakebodywithqueryparamsPut.SealedRequestBody requestBody = new FakebodywithqueryparamsPut.ApplicationjsonRequestBody(requestBodyPayload); + +// Map validation +FakebodywithqueryparamsPutQueryParameters.FakebodywithqueryparamsPutQueryParametersMap queryParameters = + FakebodywithqueryparamsPutQueryParameters.FakebodywithqueryparamsPutQueryParameters1.validate( + new FakebodywithqueryparamsPutQueryParameters.FakebodywithqueryparamsPutQueryParametersMapBuilder() + .query("a") + + .build(), + schemaConfiguration +); + +var request = new FakebodywithqueryparamsPut.PutRequestBuilder() + .requestBody(requestBody) + .queryParameters(queryParameters) + .build(); + +FakebodywithqueryparamsPutResponses.EndpointResponse response; +try { + response = apiClient.put(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakebodywithqueryparamsPutResponses.EndpointFakebodywithqueryparamsPutCode200Response castResponse = (FakebodywithqueryparamsPutResponses.EndpointFakebodywithqueryparamsPutCode200Response) response; +``` +### jsonWithCharset +public [FakejsonwithcharsetPostResponses.EndpointResponse](../../paths/fakejsonwithcharset/post/FakejsonwithcharsetPostResponses.md#endpointresponse) jsonWithCharset([FakejsonwithcharsetPost.PostRequest](../../paths/fakejsonwithcharset/FakejsonwithcharsetPost.md#postrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakejsonwithcharset.post.FakejsonwithcharsetPostRequestBody; +import org.openapijsonschematools.client.paths.fakejsonwithcharset.post.requestbody.content.applicationjsoncharsetutf8.Applicationjsoncharsetutf8Schema; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakejsonwithcharset.post.responses.FakejsonwithcharsetPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakejsonwithcharset.post.FakejsonwithcharsetPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new FakejsonwithcharsetPost.PostRequestBuilder().build(); + +FakejsonwithcharsetPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakejsonwithcharsetPostResponses.EndpointFakejsonwithcharsetPostCode200Response castResponse = (FakejsonwithcharsetPostResponses.EndpointFakejsonwithcharsetPostCode200Response) response; +FakejsonwithcharsetPostCode200Response.Applicationjsoncharsetutf8ResponseBody deserializedBody = (FakejsonwithcharsetPostCode200Response.Applicationjsoncharsetutf8ResponseBody) castResponse.body; +// handle deserialized body here +``` +### arrayModel +public [FakerefsarraymodelPostResponses.EndpointResponse](../../paths/fakerefsarraymodel/post/FakerefsarraymodelPostResponses.md#endpointresponse) arrayModel([FakerefsarraymodelPost.PostRequest](../../paths/fakerefsarraymodel/FakerefsarraymodelPost.md#postrequest) request) + +Test serialization of ArrayModel + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakerefsarraymodel.post.FakerefsarraymodelPostRequestBody; +import org.openapijsonschematools.client.components.schemas.AnimalFarm; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefsarraymodel.post.responses.FakerefsarraymodelPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakerefsarraymodel.post.FakerefsarraymodelPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new FakerefsarraymodelPost.PostRequestBuilder().build(); + +FakerefsarraymodelPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefsarraymodelPostResponses.EndpointFakerefsarraymodelPostCode200Response castResponse = (FakerefsarraymodelPostResponses.EndpointFakerefsarraymodelPostCode200Response) response; +FakerefsarraymodelPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakerefsarraymodelPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### fakeHealthGet +public [FakehealthGetResponses.EndpointResponse](../../paths/fakehealth/get/FakehealthGetResponses.md#endpointresponse) fakeHealthGet([FakehealthGet.GetRequest](../../paths/fakehealth/FakehealthGet.md#getrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakehealth.get.responses.FakehealthGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakehealth.get.FakehealthGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new FakehealthGet.GetRequestBuilder().build(); + +FakehealthGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakehealthGetResponses.EndpointFakehealthGetCode200Response castResponse = (FakehealthGetResponses.EndpointFakehealthGetCode200Response) response; +FakehealthGetCode200Response.ApplicationjsonResponseBody deserializedBody = (FakehealthGetCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### composedOneOfDifferentTypes +public [FakerefscomposedoneofnumberwithvalidationsPostResponses.EndpointResponse](../../paths/fakerefscomposedoneofnumberwithvalidations/post/FakerefscomposedoneofnumberwithvalidationsPostResponses.md#endpointresponse) composedOneOfDifferentTypes([FakerefscomposedoneofnumberwithvalidationsPost.PostRequest](../../paths/fakerefscomposedoneofnumberwithvalidations/FakerefscomposedoneofnumberwithvalidationsPost.md#postrequest) request) + +Test serialization of object with $refed properties + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post.FakerefscomposedoneofnumberwithvalidationsPostRequestBody; +import org.openapijsonschematools.client.components.schemas.ComposedOneOfDifferentTypes; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post.responses.FakerefscomposedoneofnumberwithvalidationsPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post.FakerefscomposedoneofnumberwithvalidationsPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new FakerefscomposedoneofnumberwithvalidationsPost.PostRequestBuilder().build(); + +FakerefscomposedoneofnumberwithvalidationsPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefscomposedoneofnumberwithvalidationsPostResponses.EndpointFakerefscomposedoneofnumberwithvalidationsPostCode200Response castResponse = (FakerefscomposedoneofnumberwithvalidationsPostResponses.EndpointFakerefscomposedoneofnumberwithvalidationsPostCode200Response) response; +FakerefscomposedoneofnumberwithvalidationsPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakerefscomposedoneofnumberwithvalidationsPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### refObjectInQuery +public [FakerefobjinqueryGetResponses.EndpointResponse](../../paths/fakerefobjinquery/get/FakerefobjinqueryGetResponses.md#endpointresponse) refObjectInQuery([FakerefobjinqueryGet.GetRequest](../../paths/fakerefobjinquery/FakerefobjinqueryGet.md#getrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakerefobjinquery.get.FakerefobjinqueryGetQueryParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefobjinquery.get.responses.FakerefobjinqueryGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakerefobjinquery.get.FakerefobjinqueryGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new FakerefobjinqueryGet.GetRequestBuilder().build(); + +FakerefobjinqueryGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefobjinqueryGetResponses.EndpointFakerefobjinqueryGetCode200Response castResponse = (FakerefobjinqueryGetResponses.EndpointFakerefobjinqueryGetCode200Response) response; +``` +### bodyWithFileSchema +public [FakebodywithfileschemaPutResponses.EndpointResponse](../../paths/fakebodywithfileschema/put/FakebodywithfileschemaPutResponses.md#endpointresponse) bodyWithFileSchema([FakebodywithfileschemaPut.PutRequest](../../paths/fakebodywithfileschema/FakebodywithfileschemaPut.md#putrequest) request) + +For this test, the body for this request much reference a schema named `File`. + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakebodywithfileschema.put.FakebodywithfileschemaPutRequestBody; +import org.openapijsonschematools.client.components.schemas.FileSchemaTestClass; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakebodywithfileschema.put.responses.FakebodywithfileschemaPutCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakebodywithfileschema.put.FakebodywithfileschemaPutResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +FileSchemaTestClass1BoxedMap requestBodyPayload = + FileSchemaTestClass.FileSchemaTestClass1.validateAndBox( + new FileSchemaTestClass.FileSchemaTestClassMapBuilder() + .files( + Arrays.asList( + ) + ) + .build(), + schemaConfiguration +); +FakebodywithfileschemaPut.SealedRequestBody requestBody = new FakebodywithfileschemaPut.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new FakebodywithfileschemaPut.PutRequestBuilder() + .requestBody(requestBody) + .build(); + +FakebodywithfileschemaPutResponses.EndpointResponse response; +try { + response = apiClient.put(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakebodywithfileschemaPutResponses.EndpointFakebodywithfileschemaPutCode200Response castResponse = (FakebodywithfileschemaPutResponses.EndpointFakebodywithfileschemaPutCode200Response) response; +``` +### stringEnum +public [FakerefsenumPostResponses.EndpointResponse](../../paths/fakerefsenum/post/FakerefsenumPostResponses.md#endpointresponse) stringEnum([FakerefsenumPost.PostRequest](../../paths/fakerefsenum/FakerefsenumPost.md#postrequest) request) + +Test serialization of outer enum + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakerefsenum.post.FakerefsenumPostRequestBody; +import org.openapijsonschematools.client.components.schemas.StringEnum; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefsenum.post.responses.FakerefsenumPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakerefsenum.post.FakerefsenumPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new FakerefsenumPost.PostRequestBuilder().build(); + +FakerefsenumPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefsenumPostResponses.EndpointFakerefsenumPostCode200Response castResponse = (FakerefsenumPostResponses.EndpointFakerefsenumPostCode200Response) response; +FakerefsenumPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakerefsenumPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### redirection +public [FakeredirectionGetResponses.EndpointResponse](../../paths/fakeredirection/get/FakeredirectionGetResponses.md#endpointresponse) redirection([FakeredirectionGet.GetRequest](../../paths/fakeredirection/FakeredirectionGet.md#getrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeredirection.get.responses.FakeredirectionGetCode303Response; +import org.openapijsonschematools.client.paths.fakeredirection.get.responses.FakeredirectionGetCode3XXResponse; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakeredirection.get.FakeredirectionGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new FakeredirectionGet.GetRequestBuilder().build(); + +FakeredirectionGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +if (response instanceof FakeredirectionGetResponses.EndpointFakeredirectionGetCode3XXResponse castResponse) { +} else { + FakeredirectionGetResponses.EndpointFakeredirectionGetCode303Response castResponse = (FakeredirectionGetResponses.EndpointFakeredirectionGetCode303Response) response; +} +``` +### uploadFile +public [FakeuploadfilePostResponses.EndpointResponse](../../paths/fakeuploadfile/post/FakeuploadfilePostResponses.md#endpointresponse) uploadFile([FakeuploadfilePost.PostRequest](../../paths/fakeuploadfile/FakeuploadfilePost.md#postrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakeuploadfile.post.FakeuploadfilePostRequestBody; +import org.openapijsonschematools.client.paths.fakeuploadfile.post.requestbody.content.multipartformdata.MultipartformdataSchema; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeuploadfile.post.responses.FakeuploadfilePostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakeuploadfile.post.FakeuploadfilePostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new FakeuploadfilePost.PostRequestBuilder().build(); + +FakeuploadfilePostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeuploadfilePostResponses.EndpointFakeuploadfilePostCode200Response castResponse = (FakeuploadfilePostResponses.EndpointFakeuploadfilePostCode200Response) response; +FakeuploadfilePostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakeuploadfilePostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### inlineComposition +public [FakeinlinecompositionPostResponses.EndpointResponse](../../paths/fakeinlinecomposition/post/FakeinlinecompositionPostResponses.md#endpointresponse) inlineComposition([FakeinlinecompositionPost.PostRequest](../../paths/fakeinlinecomposition/FakeinlinecompositionPost.md#postrequest) request) + +composed schemas at inline locations + multiple requestBody content types + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.FakeinlinecompositionPostRequestBody; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.requestbody.content.applicationjson.ApplicationjsonSchema; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.FakeinlinecompositionPostQueryParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.responses.FakeinlinecompositionPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.FakeinlinecompositionPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new FakeinlinecompositionPost.PostRequestBuilder().build(); + +FakeinlinecompositionPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeinlinecompositionPostResponses.EndpointFakeinlinecompositionPostCode200Response castResponse = (FakeinlinecompositionPostResponses.EndpointFakeinlinecompositionPostCode200Response) response; +if (castResponse.body instanceof FakeinlinecompositionPostCode200Response.ApplicationjsonResponseBody deserializedBody) { + // handle deserialized body here +} else { + FakeinlinecompositionPostCode200Response.MultipartformdataResponseBody deserializedBody = (FakeinlinecompositionPostCode200Response.MultipartformdataResponseBody) castResponse.body; + // handle deserialized body here +} +``` +### groupParameters +public [FakeDeleteResponses.EndpointResponse](../../paths/fake/delete/FakeDeleteResponses.md#endpointresponse) groupParameters([FakeDelete.DeleteRequest](../../paths/fake/FakeDelete.md#deleterequest) request) + +Fake endpoint to test group parameters (optional) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fake.delete.FakeDeleteSecurityInfo; +import org.openapijsonschematools.client.paths.fake.delete.FakeDeleteHeaderParameters; +import org.openapijsonschematools.client.paths.fake.delete.FakeDeleteQueryParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.BearerTest; +import org.openapijsonschematools.client.paths.fake.delete.responses.FakeDeleteCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fake.delete.FakeDeleteResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new BearerTest("someAccessToken"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .fakeDeleteSecurityRequirementObject0SecurityIndex(FakeDeleteSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +// Map validation +FakeDeleteHeaderParameters.FakeDeleteHeaderParametersMap headerParameters = + FakeDeleteHeaderParameters.FakeDeleteHeaderParameters1.validate( + new FakeDeleteHeaderParameters.FakeDeleteHeaderParametersMapBuilder() + .required_boolean_group("true") + + .boolean_group("true") + + .build(), + schemaConfiguration +); + +// Map validation +FakeDeleteQueryParameters.FakeDeleteQueryParametersMap queryParameters = + FakeDeleteQueryParameters.FakeDeleteQueryParameters1.validate( + new FakeDeleteQueryParameters.FakeDeleteQueryParametersMapBuilder() + .required_int64_group(1L) + + .required_string_group("a") + + .int64_group(1L) + + .string_group("a") + + .build(), + schemaConfiguration +); + +var request = new FakeDelete.DeleteRequestBuilder() + .headerParameters(headerParameters) + .queryParameters(queryParameters) + .build(); + +FakeDeleteResponses.EndpointResponse response; +try { + response = apiClient.delete(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeDeleteResponses.EndpointFakeDeleteCode200Response castResponse = (FakeDeleteResponses.EndpointFakeDeleteCode200Response) response; +``` +### enumParameters +public [FakeGetResponses.EndpointResponse](../../paths/fake/get/FakeGetResponses.md#endpointresponse) enumParameters([FakeGet.GetRequest](../../paths/fake/FakeGet.md#getrequest) request) + +To test enum parameters + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fake.get.FakeGetRequestBody; +import org.openapijsonschematools.client.paths.fake.get.requestbody.content.applicationxwwwformurlencoded.ApplicationxwwwformurlencodedSchema; +import org.openapijsonschematools.client.paths.fake.get.FakeGetHeaderParameters; +import org.openapijsonschematools.client.paths.fake.get.FakeGetQueryParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fake.get.responses.FakeGetCode200Response; +import org.openapijsonschematools.client.paths.fake.get.responses.FakeGetCode404Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fake.get.FakeGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new FakeGet.GetRequestBuilder().build(); + +FakeGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (FakeGetCode404Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeGetResponses.EndpointFakeGetCode200Response castResponse = (FakeGetResponses.EndpointFakeGetCode200Response) response; +``` +### clientModel +public [FakePatchResponses.EndpointResponse](../../paths/fake/patch/FakePatchResponses.md#endpointresponse) clientModel([FakePatch.PatchRequest](../../paths/fake/FakePatch.md#patchrequest) request) + +To test "client" model + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fake.patch.FakePatchRequestBody; +import org.openapijsonschematools.client.components.schemas.Client; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fake.patch.responses.FakePatchCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fake.patch.FakePatchResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +Client1BoxedMap requestBodyPayload = + Client.Client1.validateAndBox( + new Client.ClientMapBuilder1() + .client("a") + + .build(), + schemaConfiguration +); +FakePatchRequestBody.SealedRequestBody requestBody = new FakePatchRequestBody.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new FakePatch.PatchRequestBuilder() + .requestBody(requestBody) + .build(); + +FakePatchResponses.EndpointResponse response; +try { + response = apiClient.patch(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakePatchResponses.EndpointFakePatchCode200Response castResponse = (FakePatchResponses.EndpointFakePatchCode200Response) response; +FakePatchCode200Response.ApplicationjsonResponseBody deserializedBody = (FakePatchCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### endpointParameters +public [FakePostResponses.EndpointResponse](../../paths/fake/post/FakePostResponses.md#endpointresponse) endpointParameters([FakePost.PostRequest](../../paths/fake/FakePost.md#postrequest) request) + +Fake endpoint for testing various parameters
假端點
偽のエンドポイント
가짜 엔드 포인트
+ +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fake.post.FakePostRequestBody; +import org.openapijsonschematools.client.paths.fake.post.requestbody.content.applicationxwwwformurlencoded.ApplicationxwwwformurlencodedSchema; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fake.post.FakePostSecurityInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.HttpBasicTest; +import org.openapijsonschematools.client.paths.fake.post.responses.FakePostCode200Response; +import org.openapijsonschematools.client.paths.fake.post.responses.FakePostCode404Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fake.post.FakePostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new HttpBasicTest("someUserId", "somePassword"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .fakePostSecurityRequirementObject0SecurityIndex(FakePostSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new FakePost.PostRequestBuilder().build(); + +FakePostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (FakePostCode404Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakePostResponses.EndpointFakePostCode200Response castResponse = (FakePostResponses.EndpointFakePostCode200Response) response; +``` +### objectModelWithRefProps +public [FakerefsobjectmodelwithrefpropsPostResponses.EndpointResponse](../../paths/fakerefsobjectmodelwithrefprops/post/FakerefsobjectmodelwithrefpropsPostResponses.md#endpointresponse) objectModelWithRefProps([FakerefsobjectmodelwithrefpropsPost.PostRequest](../../paths/fakerefsobjectmodelwithrefprops/FakerefsobjectmodelwithrefpropsPost.md#postrequest) request) + +Test serialization of object with $refed properties + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post.FakerefsobjectmodelwithrefpropsPostRequestBody; +import org.openapijsonschematools.client.components.schemas.ObjectModelWithRefProps; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post.responses.FakerefsobjectmodelwithrefpropsPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post.FakerefsobjectmodelwithrefpropsPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new FakerefsobjectmodelwithrefpropsPost.PostRequestBuilder().build(); + +FakerefsobjectmodelwithrefpropsPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefsobjectmodelwithrefpropsPostResponses.EndpointFakerefsobjectmodelwithrefpropsPostCode200Response castResponse = (FakerefsobjectmodelwithrefpropsPostResponses.EndpointFakerefsobjectmodelwithrefpropsPostCode200Response) response; +FakerefsobjectmodelwithrefpropsPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakerefsobjectmodelwithrefpropsPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### pemContentType +public [FakepemcontenttypeGetResponses.EndpointResponse](../../paths/fakepemcontenttype/get/FakepemcontenttypeGetResponses.md#endpointresponse) pemContentType([FakepemcontenttypeGet.GetRequest](../../paths/fakepemcontenttype/FakepemcontenttypeGet.md#getrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakepemcontenttype.get.FakepemcontenttypeGetRequestBody; +import org.openapijsonschematools.client.paths.fakepemcontenttype.get.requestbody.content.applicationxpemfile.ApplicationxpemfileSchema; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakepemcontenttype.get.responses.FakepemcontenttypeGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakepemcontenttype.get.FakepemcontenttypeGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new FakepemcontenttypeGet.GetRequestBuilder().build(); + +FakepemcontenttypeGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakepemcontenttypeGetResponses.EndpointFakepemcontenttypeGetCode200Response castResponse = (FakepemcontenttypeGetResponses.EndpointFakepemcontenttypeGetCode200Response) response; +FakepemcontenttypeGetCode200Response.ApplicationxpemfileResponseBody deserializedBody = (FakepemcontenttypeGetCode200Response.ApplicationxpemfileResponseBody) castResponse.body; +// handle deserialized body here +``` +### numberWithValidations +public [FakerefsnumberPostResponses.EndpointResponse](../../paths/fakerefsnumber/post/FakerefsnumberPostResponses.md#endpointresponse) numberWithValidations([FakerefsnumberPost.PostRequest](../../paths/fakerefsnumber/FakerefsnumberPost.md#postrequest) request) + +Test serialization of outer number types + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakerefsnumber.post.FakerefsnumberPostRequestBody; +import org.openapijsonschematools.client.components.schemas.NumberWithValidations; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefsnumber.post.responses.FakerefsnumberPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakerefsnumber.post.FakerefsnumberPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new FakerefsnumberPost.PostRequestBuilder().build(); + +FakerefsnumberPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefsnumberPostResponses.EndpointFakerefsnumberPostCode200Response castResponse = (FakerefsnumberPostResponses.EndpointFakerefsnumberPostCode200Response) response; +FakerefsnumberPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakerefsnumberPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### modelString +public [FakerefsstringPostResponses.EndpointResponse](../../paths/fakerefsstring/post/FakerefsstringPostResponses.md#endpointresponse) modelString([FakerefsstringPost.PostRequest](../../paths/fakerefsstring/FakerefsstringPost.md#postrequest) request) + +Test serialization of outer string types + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakerefsstring.post.FakerefsstringPostRequestBody; +import org.openapijsonschematools.client.components.schemas.StringSchema; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefsstring.post.responses.FakerefsstringPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakerefsstring.post.FakerefsstringPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new FakerefsstringPost.PostRequestBuilder().build(); + +FakerefsstringPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefsstringPostResponses.EndpointFakerefsstringPostCode200Response castResponse = (FakerefsstringPostResponses.EndpointFakerefsstringPostCode200Response) response; +FakerefsstringPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakerefsstringPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### inlineAdditionalProperties +public [FakeinlineadditionalpropertiesPostResponses.EndpointResponse](../../paths/fakeinlineadditionalproperties/post/FakeinlineadditionalpropertiesPostResponses.md#endpointresponse) inlineAdditionalProperties([FakeinlineadditionalpropertiesPost.PostRequest](../../paths/fakeinlineadditionalproperties/FakeinlineadditionalpropertiesPost.md#postrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post.FakeinlineadditionalpropertiesPostRequestBody; +import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post.requestbody.content.applicationjson.ApplicationjsonSchema; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post.responses.FakeinlineadditionalpropertiesPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post.FakeinlineadditionalpropertiesPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +ApplicationjsonSchema1BoxedMap requestBodyPayload = + ApplicationjsonSchema.ApplicationjsonSchema1.validateAndBox( + new ApplicationjsonSchema.ApplicationjsonSchemaMapBuilder() + .additionalProperty("someAdditionalProperty", "a") + + .build(), + schemaConfiguration +); +FakeinlineadditionalpropertiesPost.SealedRequestBody requestBody = new FakeinlineadditionalpropertiesPost.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new FakeinlineadditionalpropertiesPost.PostRequestBuilder() + .requestBody(requestBody) + .build(); + +FakeinlineadditionalpropertiesPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeinlineadditionalpropertiesPostResponses.EndpointFakeinlineadditionalpropertiesPostCode200Response castResponse = (FakeinlineadditionalpropertiesPostResponses.EndpointFakeinlineadditionalpropertiesPostCode200Response) response; +``` +### mammal +public [FakerefsmammalPostResponses.EndpointResponse](../../paths/fakerefsmammal/post/FakerefsmammalPostResponses.md#endpointresponse) mammal([FakerefsmammalPost.PostRequest](../../paths/fakerefsmammal/FakerefsmammalPost.md#postrequest) request) + +Test serialization of mammals + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakerefsmammal.post.FakerefsmammalPostRequestBody; +import org.openapijsonschematools.client.components.schemas.Mammal; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefsmammal.post.responses.FakerefsmammalPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakerefsmammal.post.FakerefsmammalPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + +FakerefsmammalPost.SealedRequestBody requestBody = new FakerefsmammalPost.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new FakerefsmammalPost.PostRequestBuilder() + .requestBody(requestBody) + .build(); + +FakerefsmammalPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefsmammalPostResponses.EndpointFakerefsmammalPostCode200Response castResponse = (FakerefsmammalPostResponses.EndpointFakerefsmammalPostCode200Response) response; +FakerefsmammalPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakerefsmammalPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### slashRoute +public [SolidusGetResponses.EndpointResponse](../../paths/solidus/get/SolidusGetResponses.md#endpointresponse) slashRoute([SolidusGet.GetRequest](../../paths/solidus/SolidusGet.md#getrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.solidus.get.responses.SolidusGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.solidus.get.SolidusGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new SolidusGet.GetRequestBuilder().build(); + +SolidusGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +SolidusGetResponses.EndpointSolidusGetCode200Response castResponse = (SolidusGetResponses.EndpointSolidusGetCode200Response) response; +``` +### modelBoolean +public [FakerefsbooleanPostResponses.EndpointResponse](../../paths/fakerefsboolean/post/FakerefsbooleanPostResponses.md#endpointresponse) modelBoolean([FakerefsbooleanPost.PostRequest](../../paths/fakerefsboolean/FakerefsbooleanPost.md#postrequest) request) + +Test serialization of outer boolean types + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakerefsboolean.post.FakerefsbooleanPostRequestBody; +import org.openapijsonschematools.client.components.schemas.BooleanSchema; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefsboolean.post.responses.FakerefsbooleanPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakerefsboolean.post.FakerefsbooleanPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new FakerefsbooleanPost.PostRequestBuilder().build(); + +FakerefsbooleanPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefsbooleanPostResponses.EndpointFakerefsbooleanPostCode200Response castResponse = (FakerefsbooleanPostResponses.EndpointFakerefsbooleanPostCode200Response) response; +FakerefsbooleanPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakerefsbooleanPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### jsonFormData +public [FakejsonformdataGetResponses.EndpointResponse](../../paths/fakejsonformdata/get/FakejsonformdataGetResponses.md#endpointresponse) jsonFormData([FakejsonformdataGet.GetRequest](../../paths/fakejsonformdata/FakejsonformdataGet.md#getrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakejsonformdata.get.FakejsonformdataGetRequestBody; +import org.openapijsonschematools.client.paths.fakejsonformdata.get.requestbody.content.applicationxwwwformurlencoded.ApplicationxwwwformurlencodedSchema; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakejsonformdata.get.responses.FakejsonformdataGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakejsonformdata.get.FakejsonformdataGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new FakejsonformdataGet.GetRequestBuilder().build(); + +FakejsonformdataGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakejsonformdataGetResponses.EndpointFakejsonformdataGetCode200Response castResponse = (FakejsonformdataGetResponses.EndpointFakejsonformdataGetCode200Response) response; +``` +### parameterCollisions +public [Fakeparametercollisions1ababselfabPostResponses.EndpointResponse](../../paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostResponses.md#endpointresponse) parameterCollisions([Fakeparametercollisions1ababselfabPost.PostRequest](../../paths/fakeparametercollisions1ababselfab/Fakeparametercollisions1ababselfabPost.md#postrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Fakeparametercollisions1ababselfabPostRequestBody; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Fakeparametercollisions1ababselfabPostHeaderParameters; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Fakeparametercollisions1ababselfabPostQueryParameters; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Fakeparametercollisions1ababselfabPostCookieParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Fakeparametercollisions1ababselfabPostPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.responses.Fakeparametercollisions1ababselfabPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Fakeparametercollisions1ababselfabPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +// Map validation +Fakeparametercollisions1ababselfabPostPathParameters.Fakeparametercollisions1ababselfabPostPathParametersMap pathParameters = + Fakeparametercollisions1ababselfabPostPathParameters.Fakeparametercollisions1ababselfabPostPathParameters1.validate( + new Fakeparametercollisions1ababselfabPostPathParameters.Fakeparametercollisions1ababselfabPostPathParametersMapBuilder() + .positive1("a") + + .aHyphenMinusB("a") + + .Ab("a") + + .aB("a") + + .self("a") + + .build(), + schemaConfiguration +); + +var request = new Fakeparametercollisions1ababselfabPost.PostRequestBuilder() + .pathParameters(pathParameters) + .build(); + +Fakeparametercollisions1ababselfabPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +Fakeparametercollisions1ababselfabPostResponses.EndpointFakeparametercollisions1ababselfabPostCode200Response castResponse = (Fakeparametercollisions1ababselfabPostResponses.EndpointFakeparametercollisions1ababselfabPostCode200Response) response; +Fakeparametercollisions1ababselfabPostCode200Response.ApplicationjsonResponseBody deserializedBody = (Fakeparametercollisions1ababselfabPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### queryParamWithJsonContentType +public [FakequeryparamwithjsoncontenttypeGetResponses.EndpointResponse](../../paths/fakequeryparamwithjsoncontenttype/get/FakequeryparamwithjsoncontenttypeGetResponses.md#endpointresponse) queryParamWithJsonContentType([FakequeryparamwithjsoncontenttypeGet.GetRequest](../../paths/fakequeryparamwithjsoncontenttype/FakequeryparamwithjsoncontenttypeGet.md#getrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.FakequeryparamwithjsoncontenttypeGetQueryParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.responses.FakequeryparamwithjsoncontenttypeGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.FakequeryparamwithjsoncontenttypeGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +// Map validation +FakequeryparamwithjsoncontenttypeGetQueryParameters.FakequeryparamwithjsoncontenttypeGetQueryParametersMap queryParameters = + FakequeryparamwithjsoncontenttypeGetQueryParameters.FakequeryparamwithjsoncontenttypeGetQueryParameters1.validate( + new FakequeryparamwithjsoncontenttypeGetQueryParameters.FakequeryparamwithjsoncontenttypeGetQueryParametersMapBuilder() + .build(), + schemaConfiguration +); + +var request = new FakequeryparamwithjsoncontenttypeGet.GetRequestBuilder() + .queryParameters(queryParameters) + .build(); + +FakequeryparamwithjsoncontenttypeGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakequeryparamwithjsoncontenttypeGetResponses.EndpointFakequeryparamwithjsoncontenttypeGetCode200Response castResponse = (FakequeryparamwithjsoncontenttypeGetResponses.EndpointFakequeryparamwithjsoncontenttypeGetCode200Response) response; +FakequeryparamwithjsoncontenttypeGetCode200Response.ApplicationjsonResponseBody deserializedBody = (FakequeryparamwithjsoncontenttypeGetCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### objectInQuery +public [FakeobjinqueryGetResponses.EndpointResponse](../../paths/fakeobjinquery/get/FakeobjinqueryGetResponses.md#endpointresponse) objectInQuery([FakeobjinqueryGet.GetRequest](../../paths/fakeobjinquery/FakeobjinqueryGet.md#getrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakeobjinquery.get.FakeobjinqueryGetQueryParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeobjinquery.get.responses.FakeobjinqueryGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakeobjinquery.get.FakeobjinqueryGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new FakeobjinqueryGet.GetRequestBuilder().build(); + +FakeobjinqueryGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeobjinqueryGetResponses.EndpointFakeobjinqueryGetCode200Response castResponse = (FakeobjinqueryGetResponses.EndpointFakeobjinqueryGetCode200Response) response; +``` +### multipleSecurities +public [FakemultiplesecuritiesGetResponses.EndpointResponse](../../paths/fakemultiplesecurities/get/FakemultiplesecuritiesGetResponses.md#endpointresponse) multipleSecurities([FakemultiplesecuritiesGet.GetRequest](../../paths/fakemultiplesecurities/FakemultiplesecuritiesGet.md#getrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakemultiplesecurities.get.FakemultiplesecuritiesGetSecurityInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.HttpBasicTest; +import org.openapijsonschematools.client.components.securityschemes.ApiKey; +import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; +import org.openapijsonschematools.client.paths.fakemultiplesecurities.get.responses.FakemultiplesecuritiesGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakemultiplesecurities.get.FakemultiplesecuritiesGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new HttpBasicTest("someUserId", "somePassword"); +); +securitySchemes.add( + new ApiKey("someApiKey"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .fakemultiplesecuritiesGetSecurityRequirementObject0SecurityIndex(FakemultiplesecuritiesGetSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new FakemultiplesecuritiesGet.GetRequestBuilder().build(); + +FakemultiplesecuritiesGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakemultiplesecuritiesGetResponses.EndpointFakemultiplesecuritiesGetCode200Response castResponse = (FakemultiplesecuritiesGetResponses.EndpointFakemultiplesecuritiesGetCode200Response) response; +FakemultiplesecuritiesGetCode200Response.ApplicationjsonResponseBody deserializedBody = (FakemultiplesecuritiesGetCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### queryParameterCollectionFormat +public [FaketestqueryparamtersPutResponses.EndpointResponse](../../paths/faketestqueryparamters/put/FaketestqueryparamtersPutResponses.md#endpointresponse) queryParameterCollectionFormat([FaketestqueryparamtersPut.PutRequest](../../paths/faketestqueryparamters/FaketestqueryparamtersPut.md#putrequest) request) + +To test the collection format in query parameters + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.faketestqueryparamters.put.FaketestqueryparamtersPutQueryParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.faketestqueryparamters.put.responses.FaketestqueryparamtersPutCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.faketestqueryparamters.put.FaketestqueryparamtersPutResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +// Map validation +FaketestqueryparamtersPutQueryParameters.FaketestqueryparamtersPutQueryParametersMap queryParameters = + FaketestqueryparamtersPutQueryParameters.FaketestqueryparamtersPutQueryParameters1.validate( + new FaketestqueryparamtersPutQueryParameters.FaketestqueryparamtersPutQueryParametersMapBuilder() + .context( + Arrays.asList( + "a" + ) + ) + .http( + Arrays.asList( + "a" + ) + ) + .ioutil( + Arrays.asList( + "a" + ) + ) + .pipe( + Arrays.asList( + "a" + ) + ) + .refParam("a") + + .url( + Arrays.asList( + "a" + ) + ) + .build(), + schemaConfiguration +); + +var request = new FaketestqueryparamtersPut.PutRequestBuilder() + .queryParameters(queryParameters) + .build(); + +FaketestqueryparamtersPutResponses.EndpointResponse response; +try { + response = apiClient.put(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FaketestqueryparamtersPutResponses.EndpointFaketestqueryparamtersPutCode200Response castResponse = (FaketestqueryparamtersPutResponses.EndpointFaketestqueryparamtersPutCode200Response) response; +``` +### multipleResponseBodies +public [FakemultipleresponsebodiesGetResponses.EndpointResponse](../../paths/fakemultipleresponsebodies/get/FakemultipleresponsebodiesGetResponses.md#endpointresponse) multipleResponseBodies([FakemultipleresponsebodiesGet.GetRequest](../../paths/fakemultipleresponsebodies/FakemultipleresponsebodiesGet.md#getrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.responses.FakemultipleresponsebodiesGetCode200Response; +import org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.responses.FakemultipleresponsebodiesGetCode202Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.FakemultipleresponsebodiesGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new FakemultipleresponsebodiesGet.GetRequestBuilder().build(); + +FakemultipleresponsebodiesGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +if (response instanceof FakemultipleresponsebodiesGetResponses.EndpointFakemultipleresponsebodiesGetCode200Response castResponse) { +FakemultipleresponsebodiesGetCode200Response.ApplicationjsonResponseBody deserializedBody = (FakemultipleresponsebodiesGetCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +} else { + FakemultipleresponsebodiesGetResponses.EndpointFakemultipleresponsebodiesGetCode202Response castResponse = (FakemultipleresponsebodiesGetResponses.EndpointFakemultipleresponsebodiesGetCode202Response) response; +FakemultipleresponsebodiesGetCode202Response.ApplicationjsonResponseBody deserializedBody = (FakemultipleresponsebodiesGetCode202Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +} +``` +### responseWithoutSchema +public [FakeresponsewithoutschemaGetResponses.EndpointResponse](../../paths/fakeresponsewithoutschema/get/FakeresponsewithoutschemaGetResponses.md#endpointresponse) responseWithoutSchema([FakeresponsewithoutschemaGet.GetRequest](../../paths/fakeresponsewithoutschema/FakeresponsewithoutschemaGet.md#getrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeresponsewithoutschema.get.responses.FakeresponsewithoutschemaGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakeresponsewithoutschema.get.FakeresponsewithoutschemaGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new FakeresponsewithoutschemaGet.GetRequestBuilder().build(); + +FakeresponsewithoutschemaGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeresponsewithoutschemaGetResponses.EndpointFakeresponsewithoutschemaGetCode200Response castResponse = (FakeresponsewithoutschemaGetResponses.EndpointFakeresponsewithoutschemaGetCode200Response) response; +``` +### multipleRequestBodyContentTypes +public [FakemultiplerequestbodycontenttypesPostResponses.EndpointResponse](../../paths/fakemultiplerequestbodycontenttypes/post/FakemultiplerequestbodycontenttypesPostResponses.md#endpointresponse) multipleRequestBodyContentTypes([FakemultiplerequestbodycontenttypesPost.PostRequest](../../paths/fakemultiplerequestbodycontenttypes/FakemultiplerequestbodycontenttypesPost.md#postrequest) request) + +composed schemas at inline locations + multiple requestBody content types + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.FakemultiplerequestbodycontenttypesPostRequestBody; +import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.requestbody.content.applicationjson.ApplicationjsonSchema; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.responses.FakemultiplerequestbodycontenttypesPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.FakemultiplerequestbodycontenttypesPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new FakemultiplerequestbodycontenttypesPost.PostRequestBuilder().build(); + +FakemultiplerequestbodycontenttypesPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakemultiplerequestbodycontenttypesPostResponses.EndpointFakemultiplerequestbodycontenttypesPostCode200Response castResponse = (FakemultiplerequestbodycontenttypesPostResponses.EndpointFakemultiplerequestbodycontenttypesPostCode200Response) response; +FakemultiplerequestbodycontenttypesPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakemultiplerequestbodycontenttypesPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### uploadDownloadFile +public [FakeuploaddownloadfilePostResponses.EndpointResponse](../../paths/fakeuploaddownloadfile/post/FakeuploaddownloadfilePostResponses.md#endpointresponse) uploadDownloadFile([FakeuploaddownloadfilePost.PostRequest](../../paths/fakeuploaddownloadfile/FakeuploaddownloadfilePost.md#postrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.FakeuploaddownloadfilePostRequestBody; +import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.requestbody.content.applicationoctetstream.ApplicationoctetstreamSchema; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.responses.FakeuploaddownloadfilePostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.FakeuploaddownloadfilePostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +ApplicationoctetstreamSchema1BoxedString requestBodyPayload = ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1.validateAndBox( + "a", + schemaConfiguration +); +FakeuploaddownloadfilePost.SealedRequestBody requestBody = new FakeuploaddownloadfilePost.ApplicationoctetstreamRequestBody(requestBodyPayload); + +var request = new FakeuploaddownloadfilePost.PostRequestBuilder() + .requestBody(requestBody) + .build(); + +FakeuploaddownloadfilePostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeuploaddownloadfilePostResponses.EndpointFakeuploaddownloadfilePostCode200Response castResponse = (FakeuploaddownloadfilePostResponses.EndpointFakeuploaddownloadfilePostCode200Response) response; +FakeuploaddownloadfilePostCode200Response.ApplicationoctetstreamResponseBody deserializedBody = (FakeuploaddownloadfilePostCode200Response.ApplicationoctetstreamResponseBody) castResponse.body; +// handle deserialized body here +``` +### uploadFiles +public [FakeuploadfilesPostResponses.EndpointResponse](../../paths/fakeuploadfiles/post/FakeuploadfilesPostResponses.md#endpointresponse) uploadFiles([FakeuploadfilesPost.PostRequest](../../paths/fakeuploadfiles/FakeuploadfilesPost.md#postrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakeuploadfiles.post.FakeuploadfilesPostRequestBody; +import org.openapijsonschematools.client.paths.fakeuploadfiles.post.requestbody.content.multipartformdata.MultipartformdataSchema; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeuploadfiles.post.responses.FakeuploadfilesPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakeuploadfiles.post.FakeuploadfilesPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new FakeuploadfilesPost.PostRequestBuilder().build(); + +FakeuploadfilesPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeuploadfilesPostResponses.EndpointFakeuploadfilesPostCode200Response castResponse = (FakeuploadfilesPostResponses.EndpointFakeuploadfilesPostCode200Response) response; +FakeuploadfilesPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakeuploadfilesPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### additionalPropertiesWithArrayOfEnums +public [FakeadditionalpropertieswitharrayofenumsGetResponses.EndpointResponse](../../paths/fakeadditionalpropertieswitharrayofenums/get/FakeadditionalpropertieswitharrayofenumsGetResponses.md#endpointresponse) additionalPropertiesWithArrayOfEnums([FakeadditionalpropertieswitharrayofenumsGet.GetRequest](../../paths/fakeadditionalpropertieswitharrayofenums/FakeadditionalpropertieswitharrayofenumsGet.md#getrequest) request) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get.FakeadditionalpropertieswitharrayofenumsGetRequestBody; +import org.openapijsonschematools.client.components.schemas.AdditionalPropertiesWithArrayOfEnums; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get.responses.FakeadditionalpropertieswitharrayofenumsGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get.FakeadditionalpropertieswitharrayofenumsGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +var request = new FakeadditionalpropertieswitharrayofenumsGet.GetRequestBuilder().build(); + +FakeadditionalpropertieswitharrayofenumsGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeadditionalpropertieswitharrayofenumsGetResponses.EndpointFakeadditionalpropertieswitharrayofenumsGetCode200Response castResponse = (FakeadditionalpropertieswitharrayofenumsGetResponses.EndpointFakeadditionalpropertieswitharrayofenumsGetCode200Response) response; +FakeadditionalpropertieswitharrayofenumsGetCode200Response.ApplicationjsonResponseBody deserializedBody = (FakeadditionalpropertieswitharrayofenumsGetCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### deleteCoffee +public [FakedeletecoffeeidDeleteResponses.EndpointResponse](../../paths/fakedeletecoffeeid/delete/FakedeletecoffeeidDeleteResponses.md#endpointresponse) deleteCoffee([FakedeletecoffeeidDelete.DeleteRequest](../../paths/fakedeletecoffeeid/FakedeletecoffeeidDelete.md#deleterequest) request) + +Delete the coffee identified by the given id, (delete without request body) + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.FakedeletecoffeeidDeletePathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.responses.FakedeletecoffeeidDeleteCode200Response; +import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.responses.FakedeletecoffeeidDeleteCodedefaultResponse; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fake; +import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.FakedeletecoffeeidDeleteResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fake apiClient = new Fake(apiConfiguration, schemaConfiguration); + + +// Map validation +FakedeletecoffeeidDeletePathParameters.FakedeletecoffeeidDeletePathParametersMap pathParameters = + FakedeletecoffeeidDeletePathParameters.FakedeletecoffeeidDeletePathParameters1.validate( + new FakedeletecoffeeidDeletePathParameters.FakedeletecoffeeidDeletePathParametersMapBuilder() + .id("a") + + .build(), + schemaConfiguration +); + +var request = new FakedeletecoffeeidDelete.DeleteRequestBuilder() + .pathParameters(pathParameters) + .build(); + +FakedeletecoffeeidDeleteResponses.EndpointResponse response; +try { + response = apiClient.delete(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +if (response instanceof FakedeletecoffeeidDeleteResponses.EndpointFakedeletecoffeeidDeleteCode200Response castResponse) { +} else { + FakedeletecoffeeidDeleteResponses.EndpointFakedeletecoffeeidDeleteCodedefaultResponse castResponse = (FakedeletecoffeeidDeleteResponses.EndpointFakedeletecoffeeidDeleteCodedefaultResponse) response; +} +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/tags/Fakeclassnametags123.md b/samples/client/petstore/java/docs/apis/tags/Fakeclassnametags123.md new file mode 100644 index 00000000000..43eb1ca2f5b --- /dev/null +++ b/samples/client/petstore/java/docs/apis/tags/Fakeclassnametags123.md @@ -0,0 +1,128 @@ +# Fakeclassnametags123 + +public class Fakeclassnametags123 extends extends ApiClient implements +[FakeclassnametestPatch.ClassnameOperation](../../paths/fakeclassnametest/FakeclassnametestPatch.md#classnameoperation) + +an api client class which contains all the routes for tag="fake_classname_tags 123#$%^" + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeclassnametestPatchResponses.EndpointResponse](../../paths/fakeclassnametest/patch/FakeclassnametestPatchResponses.md#endpointresponse) | [classname](#classname)([FakeclassnametestPatch.PatchRequest](../../paths/fakeclassnametest/FakeclassnametestPatch.md#patchrequest) request)
To test class name in snake case | + +## Method Detail + +### classname +public [FakeclassnametestPatchResponses.EndpointResponse](../../paths/fakeclassnametest/patch/FakeclassnametestPatchResponses.md#endpointresponse) classname([FakeclassnametestPatch.PatchRequest](../../paths/fakeclassnametest/FakeclassnametestPatch.md#patchrequest) request) + +To test class name in snake case + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeclassnametest.patch.FakeclassnametestPatchSecurityInfo; +import org.openapijsonschematools.client.paths.fakeclassnametest.patch.FakeclassnametestPatchRequestBody; +import org.openapijsonschematools.client.components.schemas.Client; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.ApiKeyQuery; +import org.openapijsonschematools.client.paths.fakeclassnametest.patch.responses.FakeclassnametestPatchCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Fakeclassnametags123; +import org.openapijsonschematools.client.paths.fakeclassnametest.patch.FakeclassnametestPatchResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new ApiKeyQuery("someApiKey"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .fakeclassnametestPatchSecurityRequirementObject0SecurityIndex(FakeclassnametestPatchSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakeclassnametags123 apiClient = new Fakeclassnametags123(apiConfiguration, schemaConfiguration); + + +Client1BoxedMap requestBodyPayload = + Client.Client1.validateAndBox( + new Client.ClientMapBuilder1() + .client("a") + + .build(), + schemaConfiguration +); +FakeclassnametestPatchRequestBody.SealedRequestBody requestBody = new FakeclassnametestPatchRequestBody.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new FakeclassnametestPatch.PatchRequestBuilder() + .requestBody(requestBody) + .build(); + +FakeclassnametestPatchResponses.EndpointResponse response; +try { + response = apiClient.patch(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeclassnametestPatchResponses.EndpointFakeclassnametestPatchCode200Response castResponse = (FakeclassnametestPatchResponses.EndpointFakeclassnametestPatchCode200Response) response; +FakeclassnametestPatchCode200Response.ApplicationjsonResponseBody deserializedBody = (FakeclassnametestPatchCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/tags/Pet.md b/samples/client/petstore/java/docs/apis/tags/Pet.md new file mode 100644 index 00000000000..4a56dfedbef --- /dev/null +++ b/samples/client/petstore/java/docs/apis/tags/Pet.md @@ -0,0 +1,1128 @@ +# Pet + +public class Pet extends extends ApiClient implements +[FakepetiduploadimagewithrequiredfilePost.UploadFileWithRequiredFileOperation](../../paths/fakepetiduploadimagewithrequiredfile/FakepetiduploadimagewithrequiredfilePost.md#uploadfilewithrequiredfileoperation), +[PetPost.AddPetOperation](../../paths/pet/PetPost.md#addpetoperation), +[PetPut.UpdatePetOperation](../../paths/pet/PetPut.md#updatepetoperation), +[PetfindbytagsGet.FindPetsByTagsOperation](../../paths/petfindbytags/PetfindbytagsGet.md#findpetsbytagsoperation), +[PetfindbystatusGet.FindPetsByStatusOperation](../../paths/petfindbystatus/PetfindbystatusGet.md#findpetsbystatusoperation), +[PetpetiduploadimagePost.UploadImageOperation](../../paths/petpetiduploadimage/PetpetiduploadimagePost.md#uploadimageoperation), +[PetpetidDelete.DeletePetOperation](../../paths/petpetid/PetpetidDelete.md#deletepetoperation), +[PetpetidGet.GetPetByIdOperation](../../paths/petpetid/PetpetidGet.md#getpetbyidoperation), +[PetpetidPost.UpdatePetWithFormOperation](../../paths/petpetid/PetpetidPost.md#updatepetwithformoperation) + +an api client class which contains all the routes for tag="pet" +Everything about your Pets + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakepetiduploadimagewithrequiredfilePostResponses.EndpointResponse](../../paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostResponses.md#endpointresponse) | [uploadFileWithRequiredFile](#uploadfilewithrequiredfile)([FakepetiduploadimagewithrequiredfilePost.PostRequest](../../paths/fakepetiduploadimagewithrequiredfile/FakepetiduploadimagewithrequiredfilePost.md#postrequest) request)
| +| [PetPostResponses.EndpointResponse](../../paths/pet/post/PetPostResponses.md#endpointresponse) | [addPet](#addpet)([PetPost.PostRequest](../../paths/pet/PetPost.md#postrequest) request)
Add a new pet to the store | +| Void | [updatePet](#updatepet)([PetPut.PutRequest](../../paths/pet/PetPut.md#putrequest) request)
| +| [PetfindbytagsGetResponses.EndpointResponse](../../paths/petfindbytags/get/PetfindbytagsGetResponses.md#endpointresponse) | [findPetsByTags](#findpetsbytags)([PetfindbytagsGet.GetRequest](../../paths/petfindbytags/PetfindbytagsGet.md#getrequest) request)
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. | +| [PetfindbystatusGetResponses.EndpointResponse](../../paths/petfindbystatus/get/PetfindbystatusGetResponses.md#endpointresponse) | [findPetsByStatus](#findpetsbystatus)([PetfindbystatusGet.GetRequest](../../paths/petfindbystatus/PetfindbystatusGet.md#getrequest) request)
Multiple status values can be provided with comma separated strings | +| [PetpetiduploadimagePostResponses.EndpointResponse](../../paths/petpetiduploadimage/post/PetpetiduploadimagePostResponses.md#endpointresponse) | [uploadImage](#uploadimage)([PetpetiduploadimagePost.PostRequest](../../paths/petpetiduploadimage/PetpetiduploadimagePost.md#postrequest) request)
| +| Void | [deletePet](#deletepet)([PetpetidDelete.DeleteRequest](../../paths/petpetid/PetpetidDelete.md#deleterequest) request)
| +| [PetpetidGetResponses.EndpointResponse](../../paths/petpetid/get/PetpetidGetResponses.md#endpointresponse) | [getPetById](#getpetbyid)([PetpetidGet.GetRequest](../../paths/petpetid/PetpetidGet.md#getrequest) request)
Returns a single pet | +| Void | [updatePetWithForm](#updatepetwithform)([PetpetidPost.PostRequest](../../paths/petpetid/PetpetidPost.md#postrequest) request)
| + +## Method Detail + +### uploadFileWithRequiredFile +public [FakepetiduploadimagewithrequiredfilePostResponses.EndpointResponse](../../paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostResponses.md#endpointresponse) uploadFileWithRequiredFile([FakepetiduploadimagewithrequiredfilePost.PostRequest](../../paths/fakepetiduploadimagewithrequiredfile/FakepetiduploadimagewithrequiredfilePost.md#postrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.FakepetiduploadimagewithrequiredfilePostRequestBody; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.FakepetiduploadimagewithrequiredfilePostSecurityInfo; +import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.FakepetiduploadimagewithrequiredfilePostPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; +import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.responses.FakepetiduploadimagewithrequiredfilePostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Pet; +import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.FakepetiduploadimagewithrequiredfilePostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .fakepetiduploadimagewithrequiredfilePostSecurityRequirementObject0SecurityIndex(FakepetiduploadimagewithrequiredfilePostSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Pet apiClient = new Pet(apiConfiguration, schemaConfiguration); + + +// Map validation +FakepetiduploadimagewithrequiredfilePostPathParameters.FakepetiduploadimagewithrequiredfilePostPathParametersMap pathParameters = + FakepetiduploadimagewithrequiredfilePostPathParameters.FakepetiduploadimagewithrequiredfilePostPathParameters1.validate( + new FakepetiduploadimagewithrequiredfilePostPathParameters.FakepetiduploadimagewithrequiredfilePostPathParametersMapBuilder() + .petId(1L) + + .build(), + schemaConfiguration +); + +var request = new FakepetiduploadimagewithrequiredfilePost.PostRequestBuilder() + .pathParameters(pathParameters) + .build(); + +FakepetiduploadimagewithrequiredfilePostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakepetiduploadimagewithrequiredfilePostResponses.EndpointFakepetiduploadimagewithrequiredfilePostCode200Response castResponse = (FakepetiduploadimagewithrequiredfilePostResponses.EndpointFakepetiduploadimagewithrequiredfilePostCode200Response) response; +FakepetiduploadimagewithrequiredfilePostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakepetiduploadimagewithrequiredfilePostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### addPet +public [PetPostResponses.EndpointResponse](../../paths/pet/post/PetPostResponses.md#endpointresponse) addPet([PetPost.PostRequest](../../paths/pet/PetPost.md#postrequest) request) + +Add a new pet to the store + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.pet.post.PetPostSecurityInfo; +import org.openapijsonschematools.client.paths.pet.post.PetPostRequestBody; +import org.openapijsonschematools.client.components.schemas.Pet; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.ApiKey; +import org.openapijsonschematools.client.components.securityschemes.HttpSignatureTest; +import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; +import org.openapijsonschematools.client.paths.pet.post.responses.PetPostCode200Response; +import org.openapijsonschematools.client.paths.pet.post.responses.PetPostCode405Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Pet; +import org.openapijsonschematools.client.paths.pet.post.PetPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new ApiKey("someApiKey"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .petPostSecurityRequirementObject0SecurityIndex(PetPostSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Pet apiClient = new Pet(apiConfiguration, schemaConfiguration); + + +Pet1BoxedMap requestBodyPayload = + Pet.Pet1.validateAndBox( + new Pet.PetMapBuilder() + .name("a") + + .photoUrls( + Arrays.asList( + "a" + ) + ) + .id(1L) + + .category( + MapUtils.makeMap( + new AbstractMap.SimpleEntry( + "name", + "a" + ), + new AbstractMap.SimpleEntry( + "id", + 1L + ) + ) + ) + .tags( + Arrays.asList( + MapUtils.makeMap( + new AbstractMap.SimpleEntry( + "name", + "a" + ) + ) + ) + ) + .status("available") + + .build(), + schemaConfiguration +); +PetPostRequestBody.SealedRequestBody requestBody = new PetPostRequestBody.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new PetPost.PostRequestBuilder() + .requestBody(requestBody) + .build(); + +PetPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (PetPostCode405Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +PetPostResponses.EndpointPetPostCode200Response castResponse = (PetPostResponses.EndpointPetPostCode200Response) response; +``` +### updatePet +public Void updatePet([PetPut.PutRequest](../../paths/pet/PetPut.md#putrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+nothing (Void) + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.pet.put.PetPutSecurityInfo; +import org.openapijsonschematools.client.paths.pet.put.PetPutRequestBody; +import org.openapijsonschematools.client.components.schemas.Pet; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.HttpSignatureTest; +import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; +import org.openapijsonschematools.client.paths.pet.put.responses.PetPutCode400Response; +import org.openapijsonschematools.client.paths.pet.put.responses.PetPutCode404Response; +import org.openapijsonschematools.client.paths.pet.put.responses.PetPutCode405Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Pet; +import org.openapijsonschematools.client.paths.pet.put.PetPutResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .petPutSecurityRequirementObject0SecurityIndex(PetPutSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Pet apiClient = new Pet(apiConfiguration, schemaConfiguration); + + +Pet1BoxedMap requestBodyPayload = + Pet.Pet1.validateAndBox( + new Pet.PetMapBuilder() + .name("a") + + .photoUrls( + Arrays.asList( + "a" + ) + ) + .id(1L) + + .category( + MapUtils.makeMap( + new AbstractMap.SimpleEntry( + "name", + "a" + ), + new AbstractMap.SimpleEntry( + "id", + 1L + ) + ) + ) + .tags( + Arrays.asList( + MapUtils.makeMap( + new AbstractMap.SimpleEntry( + "name", + "a" + ) + ) + ) + ) + .status("available") + + .build(), + schemaConfiguration +); +PetPutRequestBody.SealedRequestBody requestBody = new PetPutRequestBody.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new PetPut.PutRequestBuilder() + .requestBody(requestBody) + .build(); + +Void response; +try { + response = apiClient.put(request); +} catch (PetPutCode400Response.ResponseApiException | PetPutCode404Response.ResponseApiException | PetPutCode405Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +``` +### findPetsByTags +public [PetfindbytagsGetResponses.EndpointResponse](../../paths/petfindbytags/get/PetfindbytagsGetResponses.md#endpointresponse) findPetsByTags([PetfindbytagsGet.GetRequest](../../paths/petfindbytags/PetfindbytagsGet.md#getrequest) request) + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.petfindbytags.get.PetfindbytagsGetSecurityInfo; +import org.openapijsonschematools.client.paths.petfindbytags.get.PetfindbytagsGetQueryParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.HttpSignatureTest; +import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; +import org.openapijsonschematools.client.paths.petfindbytags.get.responses.PetfindbytagsGetCode200Response; +import org.openapijsonschematools.client.paths.petfindbytags.get.responses.PetfindbytagsGetCode400Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Pet; +import org.openapijsonschematools.client.paths.petfindbytags.get.PetfindbytagsGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .petfindbytagsGetSecurityRequirementObject0SecurityIndex(PetfindbytagsGetSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Pet apiClient = new Pet(apiConfiguration, schemaConfiguration); + + +// Map validation +PetfindbytagsGetQueryParameters.PetfindbytagsGetQueryParametersMap queryParameters = + PetfindbytagsGetQueryParameters.PetfindbytagsGetQueryParameters1.validate( + new PetfindbytagsGetQueryParameters.PetfindbytagsGetQueryParametersMapBuilder() + .tags( + Arrays.asList( + "a" + ) + ) + .build(), + schemaConfiguration +); + +var request = new PetfindbytagsGet.GetRequestBuilder() + .queryParameters(queryParameters) + .build(); + +PetfindbytagsGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (PetfindbytagsGetCode400Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +PetfindbytagsGetResponses.EndpointPetfindbytagsGetCode200Response castResponse = (PetfindbytagsGetResponses.EndpointPetfindbytagsGetCode200Response) response; +} +``` +### findPetsByStatus +public [PetfindbystatusGetResponses.EndpointResponse](../../paths/petfindbystatus/get/PetfindbystatusGetResponses.md#endpointresponse) findPetsByStatus([PetfindbystatusGet.GetRequest](../../paths/petfindbystatus/PetfindbystatusGet.md#getrequest) request) + +Multiple status values can be provided with comma separated strings + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.petfindbystatus.PetfindbystatusServerInfo; +import org.openapijsonschematools.client.paths.petfindbystatus.get.PetfindbystatusGetSecurityInfo; +import org.openapijsonschematools.client.paths.petfindbystatus.get.PetfindbystatusGetQueryParameters; +import org.openapijsonschematools.client.paths.petfindbystatus.servers.PetfindbystatusServer0; +import org.openapijsonschematools.client.paths.petfindbystatus.servers.PetfindbystatusServer1; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.ApiKey; +import org.openapijsonschematools.client.components.securityschemes.HttpSignatureTest; +import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; +import org.openapijsonschematools.client.paths.petfindbystatus.get.responses.PetfindbystatusGetCode200Response; +import org.openapijsonschematools.client.paths.petfindbystatus.get.responses.PetfindbystatusGetCode400Response; +import org.openapijsonschematools.client.paths.petfindbystatus.PetfindbystatusServerInfo; +import org.openapijsonschematools.client.apis.tags.Pet; +import org.openapijsonschematools.client.paths.petfindbystatus.get.PetfindbystatusGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .petfindbystatusServerInfo( + new PetfindbystatusServerInfo.PetfindbystatusServerInfoBuilder() + .petfindbystatusServer0(new PetfindbystatusServer0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .petfindbystatusServerInfoServerIndex(PetfindbystatusServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new ApiKey("someApiKey"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .petfindbystatusGetSecurityRequirementObject0SecurityIndex(PetfindbystatusGetSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Pet apiClient = new Pet(apiConfiguration, schemaConfiguration); + + +// Map validation +PetfindbystatusGetQueryParameters.PetfindbystatusGetQueryParametersMap queryParameters = + PetfindbystatusGetQueryParameters.PetfindbystatusGetQueryParameters1.validate( + new PetfindbystatusGetQueryParameters.PetfindbystatusGetQueryParametersMapBuilder() + .status( + Arrays.asList( + "available" + ) + ) + .build(), + schemaConfiguration +); + +var request = new PetfindbystatusGet.GetRequestBuilder() + .queryParameters(queryParameters) + .build(); + +PetfindbystatusGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (PetfindbystatusGetCode400Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +PetfindbystatusGetResponses.EndpointPetfindbystatusGetCode200Response castResponse = (PetfindbystatusGetResponses.EndpointPetfindbystatusGetCode200Response) response; +} +``` +### uploadImage +public [PetpetiduploadimagePostResponses.EndpointResponse](../../paths/petpetiduploadimage/post/PetpetiduploadimagePostResponses.md#endpointresponse) uploadImage([PetpetiduploadimagePost.PostRequest](../../paths/petpetiduploadimage/PetpetiduploadimagePost.md#postrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.petpetiduploadimage.post.PetpetiduploadimagePostRequestBody; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.petpetiduploadimage.post.PetpetiduploadimagePostSecurityInfo; +import org.openapijsonschematools.client.paths.petpetiduploadimage.post.PetpetiduploadimagePostPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; +import org.openapijsonschematools.client.paths.petpetiduploadimage.post.responses.PetpetiduploadimagePostCode200Response; +import org.openapijsonschematools.client.components.responses.successwithjsonapiresponse.SuccessWithJsonApiResponseHeadersSchema; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Pet; +import org.openapijsonschematools.client.paths.petpetiduploadimage.post.PetpetiduploadimagePostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .petpetiduploadimagePostSecurityRequirementObject0SecurityIndex(PetpetiduploadimagePostSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Pet apiClient = new Pet(apiConfiguration, schemaConfiguration); + + +// Map validation +PetpetiduploadimagePostPathParameters.PetpetiduploadimagePostPathParametersMap pathParameters = + PetpetiduploadimagePostPathParameters.PetpetiduploadimagePostPathParameters1.validate( + new PetpetiduploadimagePostPathParameters.PetpetiduploadimagePostPathParametersMapBuilder() + .petId(1L) + + .build(), + schemaConfiguration +); + +var request = new PetpetiduploadimagePost.PostRequestBuilder() + .pathParameters(pathParameters) + .build(); + +PetpetiduploadimagePostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +PetpetiduploadimagePostResponses.EndpointPetpetiduploadimagePostCode200Response castResponse = (PetpetiduploadimagePostResponses.EndpointPetpetiduploadimagePostCode200Response) response; +} +``` +### deletePet +public Void deletePet([PetpetidDelete.DeleteRequest](../../paths/petpetid/PetpetidDelete.md#deleterequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+nothing (Void) + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.petpetid.delete.PetpetidDeleteHeaderParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.petpetid.delete.PetpetidDeleteSecurityInfo; +import org.openapijsonschematools.client.paths.petpetid.delete.PetpetidDeletePathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.ApiKey; +import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; +import org.openapijsonschematools.client.paths.petpetid.delete.responses.PetpetidDeleteCode400Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Pet; +import org.openapijsonschematools.client.paths.petpetid.delete.PetpetidDeleteResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new ApiKey("someApiKey"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .petpetidDeleteSecurityRequirementObject0SecurityIndex(PetpetidDeleteSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Pet apiClient = new Pet(apiConfiguration, schemaConfiguration); + + +// Map validation +PetpetidDeletePathParameters.PetpetidDeletePathParametersMap pathParameters = + PetpetidDeletePathParameters.PetpetidDeletePathParameters1.validate( + new PetpetidDeletePathParameters.PetpetidDeletePathParametersMapBuilder() + .petId(1L) + + .build(), + schemaConfiguration +); + +var request = new PetpetidDelete.DeleteRequestBuilder() + .pathParameters(pathParameters) + .build(); + +Void response; +try { + response = apiClient.delete(request); +} catch (PetpetidDeleteCode400Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +``` +### getPetById +public [PetpetidGetResponses.EndpointResponse](../../paths/petpetid/get/PetpetidGetResponses.md#endpointresponse) getPetById([PetpetidGet.GetRequest](../../paths/petpetid/PetpetidGet.md#getrequest) request) + +Returns a single pet + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.petpetid.get.PetpetidGetSecurityInfo; +import org.openapijsonschematools.client.paths.petpetid.get.PetpetidGetPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.ApiKey; +import org.openapijsonschematools.client.paths.petpetid.get.responses.PetpetidGetCode200Response; +import org.openapijsonschematools.client.paths.petpetid.get.responses.PetpetidGetCode400Response; +import org.openapijsonschematools.client.paths.petpetid.get.responses.PetpetidGetCode404Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Pet; +import org.openapijsonschematools.client.paths.petpetid.get.PetpetidGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new ApiKey("someApiKey"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .petpetidGetSecurityRequirementObject0SecurityIndex(PetpetidGetSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Pet apiClient = new Pet(apiConfiguration, schemaConfiguration); + + +// Map validation +PetpetidGetPathParameters.PetpetidGetPathParametersMap pathParameters = + PetpetidGetPathParameters.PetpetidGetPathParameters1.validate( + new PetpetidGetPathParameters.PetpetidGetPathParametersMapBuilder() + .petId(1L) + + .build(), + schemaConfiguration +); + +var request = new PetpetidGet.GetRequestBuilder() + .pathParameters(pathParameters) + .build(); + +PetpetidGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (PetpetidGetCode400Response.ResponseApiException | PetpetidGetCode404Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +PetpetidGetResponses.EndpointPetpetidGetCode200Response castResponse = (PetpetidGetResponses.EndpointPetpetidGetCode200Response) response; +if (castResponse.body instanceof PetpetidGetCode200Response.ApplicationxmlResponseBody deserializedBody) { + // handle deserialized body here +} else { + PetpetidGetCode200Response.ApplicationjsonResponseBody deserializedBody = (PetpetidGetCode200Response.ApplicationjsonResponseBody) castResponse.body; + // handle deserialized body here +} +``` +### updatePetWithForm +public Void updatePetWithForm([PetpetidPost.PostRequest](../../paths/petpetid/PetpetidPost.md#postrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+nothing (Void) + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.petpetid.post.PetpetidPostRequestBody; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.petpetid.post.PetpetidPostSecurityInfo; +import org.openapijsonschematools.client.paths.petpetid.post.PetpetidPostPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.ApiKey; +import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; +import org.openapijsonschematools.client.paths.petpetid.post.responses.PetpetidPostCode405Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Pet; +import org.openapijsonschematools.client.paths.petpetid.post.PetpetidPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new ApiKey("someApiKey"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .petpetidPostSecurityRequirementObject0SecurityIndex(PetpetidPostSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Pet apiClient = new Pet(apiConfiguration, schemaConfiguration); + + +// Map validation +PetpetidPostPathParameters.PetpetidPostPathParametersMap pathParameters = + PetpetidPostPathParameters.PetpetidPostPathParameters1.validate( + new PetpetidPostPathParameters.PetpetidPostPathParametersMapBuilder() + .petId(1L) + + .build(), + schemaConfiguration +); + +var request = new PetpetidPost.PostRequestBuilder() + .pathParameters(pathParameters) + .build(); + +Void response; +try { + response = apiClient.post(request); +} catch (PetpetidPostCode405Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/tags/Store.md b/samples/client/petstore/java/docs/apis/tags/Store.md new file mode 100644 index 00000000000..e4bc0147ebc --- /dev/null +++ b/samples/client/petstore/java/docs/apis/tags/Store.md @@ -0,0 +1,450 @@ +# Store + +public class Store extends extends ApiClient implements +[StoreinventoryGet.GetInventoryOperation](../../paths/storeinventory/StoreinventoryGet.md#getinventoryoperation), +[StoreorderorderidDelete.DeleteOrderOperation](../../paths/storeorderorderid/StoreorderorderidDelete.md#deleteorderoperation), +[StoreorderorderidGet.GetOrderByIdOperation](../../paths/storeorderorderid/StoreorderorderidGet.md#getorderbyidoperation), +[StoreorderPost.PlaceOrderOperation](../../paths/storeorder/StoreorderPost.md#placeorderoperation) + +an api client class which contains all the routes for tag="store" +Access to Petstore orders + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [StoreinventoryGetResponses.EndpointResponse](../../paths/storeinventory/get/StoreinventoryGetResponses.md#endpointresponse) | [getInventory](#getinventory)([StoreinventoryGet.GetRequest](../../paths/storeinventory/StoreinventoryGet.md#getrequest) request)
Returns a map of status codes to quantities | +| Void | [deleteOrder](#deleteorder)([StoreorderorderidDelete.DeleteRequest](../../paths/storeorderorderid/StoreorderorderidDelete.md#deleterequest) request)
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors | +| [StoreorderorderidGetResponses.EndpointResponse](../../paths/storeorderorderid/get/StoreorderorderidGetResponses.md#endpointresponse) | [getOrderById](#getorderbyid)([StoreorderorderidGet.GetRequest](../../paths/storeorderorderid/StoreorderorderidGet.md#getrequest) request)
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions | +| [StoreorderPostResponses.EndpointResponse](../../paths/storeorder/post/StoreorderPostResponses.md#endpointresponse) | [placeOrder](#placeorder)([StoreorderPost.PostRequest](../../paths/storeorder/StoreorderPost.md#postrequest) request)
| + +## Method Detail + +### getInventory +public [StoreinventoryGetResponses.EndpointResponse](../../paths/storeinventory/get/StoreinventoryGetResponses.md#endpointresponse) getInventory([StoreinventoryGet.GetRequest](../../paths/storeinventory/StoreinventoryGet.md#getrequest) request) + +Returns a map of status codes to quantities + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.storeinventory.get.StoreinventoryGetSecurityInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.ApiKey; +import org.openapijsonschematools.client.paths.storeinventory.get.responses.StoreinventoryGetCode200Response; +import org.openapijsonschematools.client.components.responses.successinlinecontentandheader.SuccessInlineContentAndHeaderHeadersSchema; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Store; +import org.openapijsonschematools.client.paths.storeinventory.get.StoreinventoryGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new ApiKey("someApiKey"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .storeinventoryGetSecurityRequirementObject0SecurityIndex(StoreinventoryGetSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Store apiClient = new Store(apiConfiguration, schemaConfiguration); + + +var request = new StoreinventoryGet.GetRequestBuilder().build(); + +StoreinventoryGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +StoreinventoryGetResponses.EndpointStoreinventoryGetCode200Response castResponse = (StoreinventoryGetResponses.EndpointStoreinventoryGetCode200Response) response; +} +``` +### deleteOrder +public Void deleteOrder([StoreorderorderidDelete.DeleteRequest](../../paths/storeorderorderid/StoreorderorderidDelete.md#deleterequest) request) + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +**Parameters:**
+request - the input request + +**Returns:**
+nothing (Void) + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.storeorderorderid.delete.StoreorderorderidDeletePathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.storeorderorderid.delete.responses.StoreorderorderidDeleteCode400Response; +import org.openapijsonschematools.client.paths.storeorderorderid.delete.responses.StoreorderorderidDeleteCode404Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Store; +import org.openapijsonschematools.client.paths.storeorderorderid.delete.StoreorderorderidDeleteResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Store apiClient = new Store(apiConfiguration, schemaConfiguration); + + +// Map validation +StoreorderorderidDeletePathParameters.StoreorderorderidDeletePathParametersMap pathParameters = + StoreorderorderidDeletePathParameters.StoreorderorderidDeletePathParameters1.validate( + new StoreorderorderidDeletePathParameters.StoreorderorderidDeletePathParametersMapBuilder() + .order_id("a") + + .build(), + schemaConfiguration +); + +var request = new StoreorderorderidDelete.DeleteRequestBuilder() + .pathParameters(pathParameters) + .build(); + +Void response; +try { + response = apiClient.delete(request); +} catch (StoreorderorderidDeleteCode400Response.ResponseApiException | StoreorderorderidDeleteCode404Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +``` +### getOrderById +public [StoreorderorderidGetResponses.EndpointResponse](../../paths/storeorderorderid/get/StoreorderorderidGetResponses.md#endpointresponse) getOrderById([StoreorderorderidGet.GetRequest](../../paths/storeorderorderid/StoreorderorderidGet.md#getrequest) request) + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.storeorderorderid.get.StoreorderorderidGetPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.storeorderorderid.get.responses.StoreorderorderidGetCode200Response; +import org.openapijsonschematools.client.paths.storeorderorderid.get.responses.StoreorderorderidGetCode400Response; +import org.openapijsonschematools.client.paths.storeorderorderid.get.responses.StoreorderorderidGetCode404Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Store; +import org.openapijsonschematools.client.paths.storeorderorderid.get.StoreorderorderidGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Store apiClient = new Store(apiConfiguration, schemaConfiguration); + + +// Map validation +StoreorderorderidGetPathParameters.StoreorderorderidGetPathParametersMap pathParameters = + StoreorderorderidGetPathParameters.StoreorderorderidGetPathParameters1.validate( + new StoreorderorderidGetPathParameters.StoreorderorderidGetPathParametersMapBuilder() + .order_id(1L) + + .build(), + schemaConfiguration +); + +var request = new StoreorderorderidGet.GetRequestBuilder() + .pathParameters(pathParameters) + .build(); + +StoreorderorderidGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (StoreorderorderidGetCode400Response.ResponseApiException | StoreorderorderidGetCode404Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +StoreorderorderidGetResponses.EndpointStoreorderorderidGetCode200Response castResponse = (StoreorderorderidGetResponses.EndpointStoreorderorderidGetCode200Response) response; +if (castResponse.body instanceof StoreorderorderidGetCode200Response.ApplicationxmlResponseBody deserializedBody) { + // handle deserialized body here +} else { + StoreorderorderidGetCode200Response.ApplicationjsonResponseBody deserializedBody = (StoreorderorderidGetCode200Response.ApplicationjsonResponseBody) castResponse.body; + // handle deserialized body here +} +``` +### placeOrder +public [StoreorderPostResponses.EndpointResponse](../../paths/storeorder/post/StoreorderPostResponses.md#endpointresponse) placeOrder([StoreorderPost.PostRequest](../../paths/storeorder/StoreorderPost.md#postrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.storeorder.post.StoreorderPostRequestBody; +import org.openapijsonschematools.client.components.schemas.Order; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.storeorder.post.responses.StoreorderPostCode200Response; +import org.openapijsonschematools.client.paths.storeorder.post.responses.StoreorderPostCode400Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.Store; +import org.openapijsonschematools.client.paths.storeorder.post.StoreorderPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Store apiClient = new Store(apiConfiguration, schemaConfiguration); + + +Order1BoxedMap requestBodyPayload = + Order.Order1.validateAndBox( + new Order.OrderMapBuilder() + .id(1L) + + .petId(1L) + + .quantity(1) + + .shipDate("1970-01-01T00:00:00.00Z") + + .status("placed") + + .complete(true) + + .build(), + schemaConfiguration +); +StoreorderPost.SealedRequestBody requestBody = new StoreorderPost.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new StoreorderPost.PostRequestBuilder() + .requestBody(requestBody) + .build(); + +StoreorderPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (StoreorderPostCode400Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +StoreorderPostResponses.EndpointStoreorderPostCode200Response castResponse = (StoreorderPostResponses.EndpointStoreorderPostCode200Response) response; +if (castResponse.body instanceof StoreorderPostCode200Response.ApplicationxmlResponseBody deserializedBody) { + // handle deserialized body here +} else { + StoreorderPostCode200Response.ApplicationjsonResponseBody deserializedBody = (StoreorderPostCode200Response.ApplicationjsonResponseBody) castResponse.body; + // handle deserialized body here +} +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/apis/tags/User.md b/samples/client/petstore/java/docs/apis/tags/User.md new file mode 100644 index 00000000000..abcb64e7358 --- /dev/null +++ b/samples/client/petstore/java/docs/apis/tags/User.md @@ -0,0 +1,956 @@ +# User + +public class User extends extends ApiClient implements +[UserlogoutGet.LogoutUserOperation](../../paths/userlogout/UserlogoutGet.md#logoutuseroperation), +[UsercreatewitharrayPost.CreateUsersWithArrayInputOperation](../../paths/usercreatewitharray/UsercreatewitharrayPost.md#createuserswitharrayinputoperation), +[UserPost.CreateUserOperation](../../paths/user/UserPost.md#createuseroperation), +[UserloginGet.LoginUserOperation](../../paths/userlogin/UserloginGet.md#loginuseroperation), +[UserusernameDelete.DeleteUserOperation](../../paths/userusername/UserusernameDelete.md#deleteuseroperation), +[UserusernameGet.GetUserByNameOperation](../../paths/userusername/UserusernameGet.md#getuserbynameoperation), +[UserusernamePut.UpdateUserOperation](../../paths/userusername/UserusernamePut.md#updateuseroperation), +[UsercreatewithlistPost.CreateUsersWithListInputOperation](../../paths/usercreatewithlist/UsercreatewithlistPost.md#createuserswithlistinputoperation) + +an api client class which contains all the routes for tag="user" +Operations about user + +## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserlogoutGetResponses.EndpointResponse](../../paths/userlogout/get/UserlogoutGetResponses.md#endpointresponse) | [logoutUser](#logoutuser)([UserlogoutGet.GetRequest](../../paths/userlogout/UserlogoutGet.md#getrequest) request)
| +| [UsercreatewitharrayPostResponses.EndpointResponse](../../paths/usercreatewitharray/post/UsercreatewitharrayPostResponses.md#endpointresponse) | [createUsersWithArrayInput](#createuserswitharrayinput)([UsercreatewitharrayPost.PostRequest](../../paths/usercreatewitharray/UsercreatewitharrayPost.md#postrequest) request)
| +| [UserPostResponses.EndpointResponse](../../paths/user/post/UserPostResponses.md#endpointresponse) | [createUser](#createuser)([UserPost.PostRequest](../../paths/user/UserPost.md#postrequest) request)
This can only be done by the logged in user. | +| [UserloginGetResponses.EndpointResponse](../../paths/userlogin/get/UserloginGetResponses.md#endpointresponse) | [loginUser](#loginuser)([UserloginGet.GetRequest](../../paths/userlogin/UserloginGet.md#getrequest) request)
| +| [UserusernameDeleteResponses.EndpointResponse](../../paths/userusername/delete/UserusernameDeleteResponses.md#endpointresponse) | [deleteUser](#deleteuser)([UserusernameDelete.DeleteRequest](../../paths/userusername/UserusernameDelete.md#deleterequest) request)
This can only be done by the logged in user. | +| [UserusernameGetResponses.EndpointResponse](../../paths/userusername/get/UserusernameGetResponses.md#endpointresponse) | [getUserByName](#getuserbyname)([UserusernameGet.GetRequest](../../paths/userusername/UserusernameGet.md#getrequest) request)
| +| Void | [updateUser](#updateuser)([UserusernamePut.PutRequest](../../paths/userusername/UserusernamePut.md#putrequest) request)
This can only be done by the logged in user. | +| [UsercreatewithlistPostResponses.EndpointResponse](../../paths/usercreatewithlist/post/UsercreatewithlistPostResponses.md#endpointresponse) | [createUsersWithListInput](#createuserswithlistinput)([UsercreatewithlistPost.PostRequest](../../paths/usercreatewithlist/UsercreatewithlistPost.md#postrequest) request)
| + +## Method Detail + +### logoutUser +public [UserlogoutGetResponses.EndpointResponse](../../paths/userlogout/get/UserlogoutGetResponses.md#endpointresponse) logoutUser([UserlogoutGet.GetRequest](../../paths/userlogout/UserlogoutGet.md#getrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.userlogout.get.responses.UserlogoutGetCodedefaultResponse; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.User; +import org.openapijsonschematools.client.paths.userlogout.get.UserlogoutGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +User apiClient = new User(apiConfiguration, schemaConfiguration); + + +var request = new UserlogoutGet.GetRequestBuilder().build(); + +UserlogoutGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +UserlogoutGetResponses.EndpointUserlogoutGetCodedefaultResponse castResponse = (UserlogoutGetResponses.EndpointUserlogoutGetCodedefaultResponse) response; +``` +### createUsersWithArrayInput +public [UsercreatewitharrayPostResponses.EndpointResponse](../../paths/usercreatewitharray/post/UsercreatewitharrayPostResponses.md#endpointresponse) createUsersWithArrayInput([UsercreatewitharrayPost.PostRequest](../../paths/usercreatewitharray/UsercreatewitharrayPost.md#postrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.usercreatewitharray.post.UsercreatewitharrayPostRequestBody; +import org.openapijsonschematools.client.components.requestbodies.userarray.content.applicationjson.ApplicationjsonSchema; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.usercreatewitharray.post.responses.UsercreatewitharrayPostCodedefaultResponse; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.User; +import org.openapijsonschematools.client.paths.usercreatewitharray.post.UsercreatewitharrayPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +User apiClient = new User(apiConfiguration, schemaConfiguration); + + +ApplicationjsonSchema1BoxedList requestBodyPayload = + ApplicationjsonSchema.ApplicationjsonSchema1.validateAndBox( + new ApplicationjsonSchema.ApplicationjsonSchemaListBuilder() + .add( + MapUtils.makeMap( + new AbstractMap.SimpleEntry( + "id", + 1L + ), + new AbstractMap.SimpleEntry( + "username", + "a" + ), + new AbstractMap.SimpleEntry( + "firstName", + "a" + ), + new AbstractMap.SimpleEntry( + "lastName", + "a" + ), + new AbstractMap.SimpleEntry( + "email", + "a" + ), + new AbstractMap.SimpleEntry( + "password", + "a" + ), + new AbstractMap.SimpleEntry( + "phone", + "a" + ), + new AbstractMap.SimpleEntry( + "userStatus", + 1 + ), + new AbstractMap.SimpleEntry( + "objectWithNoDeclaredPropsNullable", + null + ) + ) + ) + .build(), + schemaConfiguration +); +UsercreatewitharrayPostRequestBody.SealedRequestBody requestBody = new UsercreatewitharrayPostRequestBody.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new UsercreatewitharrayPost.PostRequestBuilder() + .requestBody(requestBody) + .build(); + +UsercreatewitharrayPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +UsercreatewitharrayPostResponses.EndpointUsercreatewitharrayPostCodedefaultResponse castResponse = (UsercreatewitharrayPostResponses.EndpointUsercreatewitharrayPostCodedefaultResponse) response; +``` +### createUser +public [UserPostResponses.EndpointResponse](../../paths/user/post/UserPostResponses.md#endpointresponse) createUser([UserPost.PostRequest](../../paths/user/UserPost.md#postrequest) request) + +This can only be done by the logged in user. + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.user.post.UserPostRequestBody; +import org.openapijsonschematools.client.components.schemas.User; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.user.post.responses.UserPostCodedefaultResponse; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.User; +import org.openapijsonschematools.client.paths.user.post.UserPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +User apiClient = new User(apiConfiguration, schemaConfiguration); + + +User1BoxedMap requestBodyPayload = + User.User1.validateAndBox( + new User.UserMapBuilder() + .id(1L) + + .username("a") + + .firstName("a") + + .lastName("a") + + .email("a") + + .password("a") + + .phone("a") + + .userStatus(1) + + .objectWithNoDeclaredPropsNullable(null) + + .build(), + schemaConfiguration +); +UserPost.SealedRequestBody requestBody = new UserPost.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new UserPost.PostRequestBuilder() + .requestBody(requestBody) + .build(); + +UserPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +UserPostResponses.EndpointUserPostCodedefaultResponse castResponse = (UserPostResponses.EndpointUserPostCodedefaultResponse) response; +``` +### loginUser +public [UserloginGetResponses.EndpointResponse](../../paths/userlogin/get/UserloginGetResponses.md#endpointresponse) loginUser([UserloginGet.GetRequest](../../paths/userlogin/UserloginGet.md#getrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.userlogin.get.UserloginGetQueryParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.userlogin.get.responses.UserloginGetCode200Response; +import org.openapijsonschematools.client.paths.userlogin.get.responses.code200response.UserloginGetCode200ResponseHeadersSchema; +import org.openapijsonschematools.client.paths.userlogin.get.responses.UserloginGetCode400Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.User; +import org.openapijsonschematools.client.paths.userlogin.get.UserloginGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +User apiClient = new User(apiConfiguration, schemaConfiguration); + + +// Map validation +UserloginGetQueryParameters.UserloginGetQueryParametersMap queryParameters = + UserloginGetQueryParameters.UserloginGetQueryParameters1.validate( + new UserloginGetQueryParameters.UserloginGetQueryParametersMapBuilder() + .password("a") + + .username("a") + + .build(), + schemaConfiguration +); + +var request = new UserloginGet.GetRequestBuilder() + .queryParameters(queryParameters) + .build(); + +UserloginGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (UserloginGetCode400Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +UserloginGetResponses.EndpointUserloginGetCode200Response castResponse = (UserloginGetResponses.EndpointUserloginGetCode200Response) response; +if (castResponse.body instanceof UserloginGetCode200Response.ApplicationxmlResponseBody deserializedBody) { + // handle deserialized body here +} else { + UserloginGetCode200Response.ApplicationjsonResponseBody deserializedBody = (UserloginGetCode200Response.ApplicationjsonResponseBody) castResponse.body; + // handle deserialized body here +} +``` +### deleteUser +public [UserusernameDeleteResponses.EndpointResponse](../../paths/userusername/delete/UserusernameDeleteResponses.md#endpointresponse) deleteUser([UserusernameDelete.DeleteRequest](../../paths/userusername/UserusernameDelete.md#deleterequest) request) + +This can only be done by the logged in user. + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.userusername.delete.UserusernameDeletePathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.userusername.delete.responses.UserusernameDeleteCode200Response; +import org.openapijsonschematools.client.paths.userusername.delete.responses.UserusernameDeleteCode404Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.User; +import org.openapijsonschematools.client.paths.userusername.delete.UserusernameDeleteResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +User apiClient = new User(apiConfiguration, schemaConfiguration); + + +// Map validation +UserusernameDeletePathParameters.UserusernameDeletePathParametersMap pathParameters = + UserusernameDeletePathParameters.UserusernameDeletePathParameters1.validate( + new UserusernameDeletePathParameters.UserusernameDeletePathParametersMapBuilder() + .username("a") + + .build(), + schemaConfiguration +); + +var request = new UserusernameDelete.DeleteRequestBuilder() + .pathParameters(pathParameters) + .build(); + +UserusernameDeleteResponses.EndpointResponse response; +try { + response = apiClient.delete(request); +} catch (UserusernameDeleteCode404Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +UserusernameDeleteResponses.EndpointUserusernameDeleteCode200Response castResponse = (UserusernameDeleteResponses.EndpointUserusernameDeleteCode200Response) response; +``` +### getUserByName +public [UserusernameGetResponses.EndpointResponse](../../paths/userusername/get/UserusernameGetResponses.md#endpointresponse) getUserByName([UserusernameGet.GetRequest](../../paths/userusername/UserusernameGet.md#getrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.userusername.get.UserusernameGetPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.userusername.get.responses.UserusernameGetCode200Response; +import org.openapijsonschematools.client.paths.userusername.get.responses.UserusernameGetCode400Response; +import org.openapijsonschematools.client.paths.userusername.get.responses.UserusernameGetCode404Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.User; +import org.openapijsonschematools.client.paths.userusername.get.UserusernameGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +User apiClient = new User(apiConfiguration, schemaConfiguration); + + +// Map validation +UserusernameGetPathParameters.UserusernameGetPathParametersMap pathParameters = + UserusernameGetPathParameters.UserusernameGetPathParameters1.validate( + new UserusernameGetPathParameters.UserusernameGetPathParametersMapBuilder() + .username("a") + + .build(), + schemaConfiguration +); + +var request = new UserusernameGet.GetRequestBuilder() + .pathParameters(pathParameters) + .build(); + +UserusernameGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (UserusernameGetCode400Response.ResponseApiException | UserusernameGetCode404Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +UserusernameGetResponses.EndpointUserusernameGetCode200Response castResponse = (UserusernameGetResponses.EndpointUserusernameGetCode200Response) response; +if (castResponse.body instanceof UserusernameGetCode200Response.ApplicationxmlResponseBody deserializedBody) { + // handle deserialized body here +} else { + UserusernameGetCode200Response.ApplicationjsonResponseBody deserializedBody = (UserusernameGetCode200Response.ApplicationjsonResponseBody) castResponse.body; + // handle deserialized body here +} +``` +### updateUser +public Void updateUser([UserusernamePut.PutRequest](../../paths/userusername/UserusernamePut.md#putrequest) request) + +This can only be done by the logged in user. + +**Parameters:**
+request - the input request + +**Returns:**
+nothing (Void) + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.userusername.put.UserusernamePutRequestBody; +import org.openapijsonschematools.client.components.schemas.User; +import org.openapijsonschematools.client.paths.userusername.put.UserusernamePutPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.userusername.put.responses.UserusernamePutCode400Response; +import org.openapijsonschematools.client.paths.userusername.put.responses.UserusernamePutCode404Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.User; +import org.openapijsonschematools.client.paths.userusername.put.UserusernamePutResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +User apiClient = new User(apiConfiguration, schemaConfiguration); + + +User1BoxedMap requestBodyPayload = + User.User1.validateAndBox( + new User.UserMapBuilder() + .id(1L) + + .username("a") + + .firstName("a") + + .lastName("a") + + .email("a") + + .password("a") + + .phone("a") + + .userStatus(1) + + .objectWithNoDeclaredPropsNullable(null) + + .build(), + schemaConfiguration +); +UserusernamePut.SealedRequestBody requestBody = new UserusernamePut.ApplicationjsonRequestBody(requestBodyPayload); + +// Map validation +UserusernamePutPathParameters.UserusernamePutPathParametersMap pathParameters = + UserusernamePutPathParameters.UserusernamePutPathParameters1.validate( + new UserusernamePutPathParameters.UserusernamePutPathParametersMapBuilder() + .username("a") + + .build(), + schemaConfiguration +); + +var request = new UserusernamePut.PutRequestBuilder() + .requestBody(requestBody) + .pathParameters(pathParameters) + .build(); + +Void response; +try { + response = apiClient.put(request); +} catch (UserusernamePutCode400Response.ResponseApiException | UserusernamePutCode404Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +``` +### createUsersWithListInput +public [UsercreatewithlistPostResponses.EndpointResponse](../../paths/usercreatewithlist/post/UsercreatewithlistPostResponses.md#endpointresponse) createUsersWithListInput([UsercreatewithlistPost.PostRequest](../../paths/usercreatewithlist/UsercreatewithlistPost.md#postrequest) request) + + + +**Parameters:**
+request - the input request + +**Returns:**
+the deserialized response + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +#### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.usercreatewithlist.post.UsercreatewithlistPostRequestBody; +import org.openapijsonschematools.client.components.requestbodies.userarray.content.applicationjson.ApplicationjsonSchema; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.usercreatewithlist.post.responses.UsercreatewithlistPostCodedefaultResponse; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.apis.tags.User; +import org.openapijsonschematools.client.paths.usercreatewithlist.post.UsercreatewithlistPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +User apiClient = new User(apiConfiguration, schemaConfiguration); + + +ApplicationjsonSchema1BoxedList requestBodyPayload = + ApplicationjsonSchema.ApplicationjsonSchema1.validateAndBox( + new ApplicationjsonSchema.ApplicationjsonSchemaListBuilder() + .add( + MapUtils.makeMap( + new AbstractMap.SimpleEntry( + "id", + 1L + ), + new AbstractMap.SimpleEntry( + "username", + "a" + ), + new AbstractMap.SimpleEntry( + "firstName", + "a" + ), + new AbstractMap.SimpleEntry( + "lastName", + "a" + ), + new AbstractMap.SimpleEntry( + "email", + "a" + ), + new AbstractMap.SimpleEntry( + "password", + "a" + ), + new AbstractMap.SimpleEntry( + "phone", + "a" + ), + new AbstractMap.SimpleEntry( + "userStatus", + 1 + ), + new AbstractMap.SimpleEntry( + "objectWithNoDeclaredPropsNullable", + null + ) + ) + ) + .build(), + schemaConfiguration +); +UsercreatewithlistPostRequestBody.SealedRequestBody requestBody = new UsercreatewithlistPostRequestBody.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new UsercreatewithlistPost.PostRequestBuilder() + .requestBody(requestBody) + .build(); + +UsercreatewithlistPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +UsercreatewithlistPostResponses.EndpointUsercreatewithlistPostCodedefaultResponse castResponse = (UsercreatewithlistPostResponses.EndpointUsercreatewithlistPostCodedefaultResponse) response; +``` +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/anotherfakedummy/AnotherfakedummyPatch.md b/samples/client/petstore/java/docs/paths/anotherfakedummy/AnotherfakedummyPatch.md new file mode 100644 index 00000000000..04da4972d6c --- /dev/null +++ b/samples/client/petstore/java/docs/paths/anotherfakedummy/AnotherfakedummyPatch.md @@ -0,0 +1,185 @@ +# AnotherfakedummyPatch + +public class AnotherfakedummyPatch + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Patch](#patch)
The class that has a patch method to call the endpoint | +| interface | [Model123TestSpecialTagsOperation](#model123testspecialtagsoperation)
The interface that has a model123TestSpecialTags method to call the endpoint | +| static class | [PatchRequest](#patchrequest)
The final request inputs class | +| static class | [PatchNullableRequest](#patchnullablerequest)
The initial request inputs class | +| static class | [Patch0RequestBuilder](#patch0requestbuilder)
A builder for the request input class | +| static class | [PatchRequestBuilder](#patchrequestbuilder)
A builder for the request input class | + +## Patch +public static class Patch extends ApiClient.ApiClient1 implements PatchOperation
+ +a class that allows one to call the endpoint using a method named patch + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.anotherfakedummy.patch.AnotherfakedummyPatchRequestBody; +import org.openapijsonschematools.client.components.schemas.Client; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.anotherfakedummy.patch.responses.AnotherfakedummyPatchCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.anotherfakedummy.AnotherfakedummyPatch; +import org.openapijsonschematools.client.paths.anotherfakedummy.patch.AnotherfakedummyPatchResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +AnotherfakedummyPatch.Patch apiClient = new AnotherfakedummyPatch.Patch(apiConfiguration, schemaConfiguration); + + +Client1BoxedMap requestBodyPayload = + Client.Client1.validateAndBox( + new Client.ClientMapBuilder1() + .client("a") + + .build(), + schemaConfiguration +); +AnotherfakedummyPatchRequestBody.SealedRequestBody requestBody = new AnotherfakedummyPatchRequestBody.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new AnotherfakedummyPatch.PatchRequestBuilder() + .requestBody(requestBody) + .build(); + +AnotherfakedummyPatchResponses.EndpointResponse response; +try { + response = apiClient.patch(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +AnotherfakedummyPatchResponses.EndpointAnotherfakedummyPatchCode200Response castResponse = (AnotherfakedummyPatchResponses.EndpointAnotherfakedummyPatchCode200Response) response; +AnotherfakedummyPatchCode200Response.ApplicationjsonResponseBody deserializedBody = (AnotherfakedummyPatchCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Patch(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [AnotherfakedummyPatchResponses.EndpointResponse](../../paths/anotherfakedummy/patch/AnotherfakedummyPatchResponses.md#endpointresponse) | patch([PatchRequest](#patchrequest) request) | + +## Model123TestSpecialTagsOperation +public interface Model123TestSpecialTagsOperation
+ +an interface that allows one to call the endpoint using a method named model123TestSpecialTags by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [AnotherfakedummyPatchResponses.EndpointResponse](../../paths/anotherfakedummy/patch/AnotherfakedummyPatchResponses.md#endpointresponse) | model123TestSpecialTags([PatchRequest](#patchrequest) request) | + +## PatchRequest +public static class PatchRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [AnotherfakedummyPatchRequestBody.SealedRequestBody](../../paths/anotherfakedummy/patch/AnotherfakedummyPatchRequestBody.md#sealedrequestbody) | requestBody | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PatchNullableRequest +public static class PatchNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [AnotherfakedummyPatchRequestBody.@Nullable SealedRequestBody](../../paths/anotherfakedummy/patch/AnotherfakedummyPatchRequestBody.md#sealedrequestbody) | requestBody | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| @Nullable Duration | timeout | + +## Patch0RequestBuilder +public static class Patch0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Patch0RequestBuilder(Patch0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PatchRequest](#patchrequest) | build()
Returns the request input used to call an endpoint method | +| [Patch0RequestBuilder](#patch0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Patch0RequestBuilder](#patch0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## PatchRequestBuilder +public static class PatchRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PatchRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Patch0RequestBuilder](#patch0requestbuilder) | requestBody([AnotherfakedummyPatchRequestBody.SealedRequestBody](../../paths/anotherfakedummy/patch/AnotherfakedummyPatchRequestBody.md#sealedrequestbody) requestBody)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/anotherfakedummy/Patch.md b/samples/client/petstore/java/docs/paths/anotherfakedummy/Patch.md deleted file mode 100644 index d191146247d..00000000000 --- a/samples/client/petstore/java/docs/paths/anotherfakedummy/Patch.md +++ /dev/null @@ -1,174 +0,0 @@ -# Patch - -public class Patch - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Patch1](#patch1)
The class that has a patch method to call the endpoint | -| static class | [PatchRequest](#patchrequest)
The final request inputs class | -| static class | [PatchNullableRequest](#patchnullablerequest)
The initial request inputs class | -| static class | [Patch0RequestBuilder](#patch0requestbuilder)
A builder for the request input class | -| static class | [PatchRequestBuilder](#patchrequestbuilder)
A builder for the request input class | - -## Patch1 -public static class Patch1 extends ApiClient.ApiClient1 implements PatchOperation
- -a class that allows one to call the endpoint using a method named patch - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.anotherfakedummy.patch.RequestBody; -import org.openapijsonschematools.client.components.schemas.Client; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.anotherfakedummy.patch.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.anotherfakedummy.Patch; -import org.openapijsonschematools.client.paths.anotherfakedummy.patch.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Patch.Patch1 apiClient = new Patch.Patch1(apiConfiguration, schemaConfiguration); - - -Client1BoxedMap requestBodyPayload = - Client.Client1.validateAndBox( - new Client.ClientMapBuilder1() - .client("a") - - .build(), - schemaConfiguration -); -RequestBody.SealedRequestBody requestBody = new RequestBody.ApplicationjsonRequestBody(requestBodyPayload); - -var request = new PatchRequestBuilder() - .requestBody(requestBody) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.patch(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -Code200Response.ApplicationjsonResponseBody deserializedBody = (Code200Response.ApplicationjsonResponseBody) castResponse.body; -// handle deserialized body here -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Patch1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/anotherfakedummy/patch/Responses.md#endpointresponse) | patch([PatchRequest](#patchrequest) request) | - -## PatchRequest -public static class PatchRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.SealedRequestBody](../../paths/anotherfakedummy/patch/RequestBody.md#sealedrequestbody) | requestBody | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PatchNullableRequest -public static class PatchNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/anotherfakedummy/patch/RequestBody.md#sealedrequestbody) | requestBody | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| @Nullable Duration | timeout | - -## Patch0RequestBuilder -public static class Patch0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Patch0RequestBuilder(Patch0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PatchRequest](#patchrequest) | build()
Returns the request input used to call an endpoint method | -| [Patch0RequestBuilder](#patch0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Patch0RequestBuilder](#patch0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## PatchRequestBuilder -public static class PatchRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PatchRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Patch0RequestBuilder](#patch0requestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/anotherfakedummy/patch/RequestBody.md#sealedrequestbody) requestBody)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/anotherfakedummy/patch/AnotherfakedummyPatchRequestBody.md b/samples/client/petstore/java/docs/paths/anotherfakedummy/patch/AnotherfakedummyPatchRequestBody.md new file mode 100644 index 00000000000..efa5336e17e --- /dev/null +++ b/samples/client/petstore/java/docs/paths/anotherfakedummy/patch/AnotherfakedummyPatchRequestBody.md @@ -0,0 +1,17 @@ +# AnotherfakedummyPatchRequestBody + +public class AnotherfakedummyPatchRequestBody extends [Client](../../../components/requestbodies/Client.md) + +A class (extended from the $ref class) that contains necessary nested request body classes +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [AnotherfakedummyPatchRequestBody.AnotherfakedummyPatchRequestBody1](#anotherfakedummypatchrequestbody1)
class that serializes request bodies | + +## AnotherfakedummyPatchRequestBody1 +public static class AnotherfakedummyPatchRequestBody1 extends [Client1](../../../components/requestbodies/Client.md#client1)
+ +a class that serializes SealedRequestBody request bodies, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/anotherfakedummy/patch/AnotherfakedummyPatchResponses.md b/samples/client/petstore/java/docs/paths/anotherfakedummy/patch/AnotherfakedummyPatchResponses.md new file mode 100644 index 00000000000..b7064b938da --- /dev/null +++ b/samples/client/petstore/java/docs/paths/anotherfakedummy/patch/AnotherfakedummyPatchResponses.md @@ -0,0 +1,29 @@ +# AnotherfakedummyPatchResponses + +public class AnotherfakedummyPatchResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointAnotherfakedummyPatchCode200Response](#endpointanotherfakedummypatchcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointAnotherfakedummyPatchCode200Response](#endpointanotherfakedummypatchcode200response) + +a sealed interface that stores endpoint responses + +## EndpointAnotherfakedummyPatchCode200Response +public record EndpointAnotherfakedummyPatchCode200Response( + HttpResponse response, + [AnotherfakedummyPatchCode200Response.SealedResponseBody](../../../paths/anotherfakedummy/patch/responses/AnotherfakedummyPatchCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/anotherfakedummy/patch/RequestBody.md b/samples/client/petstore/java/docs/paths/anotherfakedummy/patch/RequestBody.md deleted file mode 100644 index 72d0a1a3ced..00000000000 --- a/samples/client/petstore/java/docs/paths/anotherfakedummy/patch/RequestBody.md +++ /dev/null @@ -1,17 +0,0 @@ -# RequestBody - -public class RequestBody extends [Client](../../../components/requestbodies/Client.md) - -A class (extended from the $ref class) that contains necessary nested request body classes -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | - -## RequestBody1 -public static class RequestBody1 extends [Client1](../../../components/requestbodies/Client.md#client1)
- -a class that serializes SealedRequestBody request bodies, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/anotherfakedummy/patch/Responses.md b/samples/client/petstore/java/docs/paths/anotherfakedummy/patch/Responses.md deleted file mode 100644 index f12cf80e9d7..00000000000 --- a/samples/client/petstore/java/docs/paths/anotherfakedummy/patch/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/anotherfakedummy/patch/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/anotherfakedummy/patch/responses/AnotherfakedummyPatchCode200Response.md b/samples/client/petstore/java/docs/paths/anotherfakedummy/patch/responses/AnotherfakedummyPatchCode200Response.md new file mode 100644 index 00000000000..e9a291fa5fb --- /dev/null +++ b/samples/client/petstore/java/docs/paths/anotherfakedummy/patch/responses/AnotherfakedummyPatchCode200Response.md @@ -0,0 +1,87 @@ +# AnotherfakedummyPatchCode200Response + +public class AnotherfakedummyPatchCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [AnotherfakedummyPatchCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [AnotherfakedummyPatchCode200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [AnotherfakedummyPatchCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [AnotherfakedummyPatchCode200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [AnotherfakedummyPatchCode200Response.AnotherfakedummyPatchCode200Response1](#anotherfakedummypatchcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/anotherfakedummy/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/anotherfakedummy/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.[Client1Boxed](../../../../components/schemas/Client.md#client1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.[Client1Boxed](../../../../components/schemas/Client.md#client1boxed) | body()
returns the body passed in in the constructor | + +## AnotherfakedummyPatchCode200Response1 +public static class AnotherfakedummyPatchCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| AnotherfakedummyPatchCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/anotherfakedummy/patch/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/anotherfakedummy/patch/responses/Code200Response.md deleted file mode 100644 index cc3c29215e0..00000000000 --- a/samples/client/petstore/java/docs/paths/anotherfakedummy/patch/responses/Code200Response.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/anotherfakedummy/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/anotherfakedummy/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.[Client1Boxed](../../../../components/schemas/Client.md#client1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.[Client1Boxed](../../../../components/schemas/Client.md#client1boxed) | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/CommonparamsubdirDelete.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/CommonparamsubdirDelete.md new file mode 100644 index 00000000000..243e4b11f76 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/commonparamsubdir/CommonparamsubdirDelete.md @@ -0,0 +1,186 @@ +# CommonparamsubdirDelete + +public class CommonparamsubdirDelete + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Delete](#delete)
The class that has a delete method to call the endpoint | +| interface | [DeleteCommonParamOperation](#deletecommonparamoperation)
The interface that has a deleteCommonParam method to call the endpoint | +| static class | [DeleteRequest](#deleterequest)
The final request inputs class | +| static class | [DeleteNullableRequest](#deletenullablerequest)
The initial request inputs class | +| static class | [Delete0RequestBuilder](#delete0requestbuilder)
A builder for the request input class | +| static class | [DeleteRequestBuilder](#deleterequestbuilder)
A builder for the request input class | + +## Delete +public static class Delete extends ApiClient.ApiClient1 implements DeleteOperation
+ +a class that allows one to call the endpoint using a method named delete + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.commonparamsubdir.delete.CommonparamsubdirDeleteHeaderParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.commonparamsubdir.delete.CommonparamsubdirDeletePathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.commonparamsubdir.delete.responses.CommonparamsubdirDeleteCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.commonparamsubdir.CommonparamsubdirDelete; +import org.openapijsonschematools.client.paths.commonparamsubdir.delete.CommonparamsubdirDeleteResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +CommonparamsubdirDelete.Delete apiClient = new CommonparamsubdirDelete.Delete(apiConfiguration, schemaConfiguration); + + +// Map validation +CommonparamsubdirDeletePathParameters.CommonparamsubdirDeletePathParametersMap pathParameters = + CommonparamsubdirDeletePathParameters.CommonparamsubdirDeletePathParameters1.validate( + new CommonparamsubdirDeletePathParameters.CommonparamsubdirDeletePathParametersMapBuilder() + .subDir("c") + + .build(), + schemaConfiguration +); + +var request = new CommonparamsubdirDelete.DeleteRequestBuilder() + .pathParameters(pathParameters) + .build(); + +CommonparamsubdirDeleteResponses.EndpointResponse response; +try { + response = apiClient.delete(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +CommonparamsubdirDeleteResponses.EndpointCommonparamsubdirDeleteCode200Response castResponse = (CommonparamsubdirDeleteResponses.EndpointCommonparamsubdirDeleteCode200Response) response; +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Delete(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [CommonparamsubdirDeleteResponses.EndpointResponse](../../paths/commonparamsubdir/delete/CommonparamsubdirDeleteResponses.md#endpointresponse) | delete([DeleteRequest](#deleterequest) request) | + +## DeleteCommonParamOperation +public interface DeleteCommonParamOperation
+ +an interface that allows one to call the endpoint using a method named deleteCommonParam by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [CommonparamsubdirDeleteResponses.EndpointResponse](../../paths/commonparamsubdir/delete/CommonparamsubdirDeleteResponses.md#endpointresponse) | deleteCommonParam([DeleteRequest](#deleterequest) request) | + +## DeleteRequest +public static class DeleteRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [CommonparamsubdirDeletePathParameters.CommonparamsubdirDeletePathParametersMap](../../paths/commonparamsubdir/delete/CommonparamsubdirDeletePathParameters.md#commonparamsubdirdeletepathparametersmap) | pathParameters | +| [CommonparamsubdirDeleteHeaderParameters.@Nullable CommonparamsubdirDeleteHeaderParametersMap](../../paths/commonparamsubdir/delete/CommonparamsubdirDeleteHeaderParameters.md#commonparamsubdirdeleteheaderparametersmap) | headerParameters
optional | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## DeleteNullableRequest +public static class DeleteNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [CommonparamsubdirDeletePathParameters.@Nullable CommonparamsubdirDeletePathParametersMap](../../paths/commonparamsubdir/delete/CommonparamsubdirDeletePathParameters.md#commonparamsubdirdeletepathparametersmap) | pathParameters | +| [CommonparamsubdirDeleteHeaderParameters.@Nullable CommonparamsubdirDeleteHeaderParametersMap](../../paths/commonparamsubdir/delete/CommonparamsubdirDeleteHeaderParameters.md#commonparamsubdirdeleteheaderparametersmap) | headerParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| @Nullable Duration | timeout | + +## Delete0RequestBuilder +public static class Delete0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Delete0RequestBuilder(Delete0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [DeleteRequest](#deleterequest) | build()
Returns the request input used to call an endpoint method | +| [Delete0RequestBuilder](#delete0requestbuilder) | headerParameters([CommonparamsubdirDeleteHeaderParametersCommonparamsubdirDeleteHeaderParametersMap](../../paths/commonparamsubdir/delete/CommonparamsubdirDeleteHeaderParameters.md#commonparamsubdirdeleteheaderparametersmap) headerParameters)
sets the optional property | +| [Delete0RequestBuilder](#delete0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Delete0RequestBuilder](#delete0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## DeleteRequestBuilder +public static class DeleteRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| DeleteRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Delete0RequestBuilder](#delete0requestbuilder) | pathParameters([CommonparamsubdirDeletePathParametersCommonparamsubdirDeletePathParametersMap](../../paths/commonparamsubdir/delete/CommonparamsubdirDeletePathParameters.md#commonparamsubdirdeletepathparametersmap) pathParameters)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/CommonparamsubdirGet.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/CommonparamsubdirGet.md new file mode 100644 index 00000000000..4e7551ee4f6 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/commonparamsubdir/CommonparamsubdirGet.md @@ -0,0 +1,186 @@ +# CommonparamsubdirGet + +public class CommonparamsubdirGet + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Get](#get)
The class that has a get method to call the endpoint | +| interface | [GetCommonParamOperation](#getcommonparamoperation)
The interface that has a getCommonParam method to call the endpoint | +| static class | [GetRequest](#getrequest)
The final request inputs class | +| static class | [GetNullableRequest](#getnullablerequest)
The initial request inputs class | +| static class | [Get0RequestBuilder](#get0requestbuilder)
A builder for the request input class | +| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | + +## Get +public static class Get extends ApiClient.ApiClient1 implements GetOperation
+ +a class that allows one to call the endpoint using a method named get + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.commonparamsubdir.get.CommonparamsubdirGetQueryParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.commonparamsubdir.get.CommonparamsubdirGetPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.commonparamsubdir.get.responses.CommonparamsubdirGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.commonparamsubdir.CommonparamsubdirGet; +import org.openapijsonschematools.client.paths.commonparamsubdir.get.CommonparamsubdirGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +CommonparamsubdirGet.Get apiClient = new CommonparamsubdirGet.Get(apiConfiguration, schemaConfiguration); + + +// Map validation +CommonparamsubdirGetPathParameters.CommonparamsubdirGetPathParametersMap pathParameters = + CommonparamsubdirGetPathParameters.CommonparamsubdirGetPathParameters1.validate( + new CommonparamsubdirGetPathParameters.CommonparamsubdirGetPathParametersMapBuilder() + .subDir("a") + + .build(), + schemaConfiguration +); + +var request = new CommonparamsubdirGet.GetRequestBuilder() + .pathParameters(pathParameters) + .build(); + +CommonparamsubdirGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +CommonparamsubdirGetResponses.EndpointCommonparamsubdirGetCode200Response castResponse = (CommonparamsubdirGetResponses.EndpointCommonparamsubdirGetCode200Response) response; +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [CommonparamsubdirGetResponses.EndpointResponse](../../paths/commonparamsubdir/get/CommonparamsubdirGetResponses.md#endpointresponse) | get([GetRequest](#getrequest) request) | + +## GetCommonParamOperation +public interface GetCommonParamOperation
+ +an interface that allows one to call the endpoint using a method named getCommonParam by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [CommonparamsubdirGetResponses.EndpointResponse](../../paths/commonparamsubdir/get/CommonparamsubdirGetResponses.md#endpointresponse) | getCommonParam([GetRequest](#getrequest) request) | + +## GetRequest +public static class GetRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [CommonparamsubdirGetPathParameters.CommonparamsubdirGetPathParametersMap](../../paths/commonparamsubdir/get/CommonparamsubdirGetPathParameters.md#commonparamsubdirgetpathparametersmap) | pathParameters | +| [CommonparamsubdirGetQueryParameters.@Nullable CommonparamsubdirGetQueryParametersMap](../../paths/commonparamsubdir/get/CommonparamsubdirGetQueryParameters.md#commonparamsubdirgetqueryparametersmap) | queryParameters
optional | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## GetNullableRequest +public static class GetNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [CommonparamsubdirGetPathParameters.@Nullable CommonparamsubdirGetPathParametersMap](../../paths/commonparamsubdir/get/CommonparamsubdirGetPathParameters.md#commonparamsubdirgetpathparametersmap) | pathParameters | +| [CommonparamsubdirGetQueryParameters.@Nullable CommonparamsubdirGetQueryParametersMap](../../paths/commonparamsubdir/get/CommonparamsubdirGetQueryParameters.md#commonparamsubdirgetqueryparametersmap) | queryParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| @Nullable Duration | timeout | + +## Get0RequestBuilder +public static class Get0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get0RequestBuilder(Get0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | +| [Get0RequestBuilder](#get0requestbuilder) | queryParameters([CommonparamsubdirGetQueryParametersCommonparamsubdirGetQueryParametersMap](../../paths/commonparamsubdir/get/CommonparamsubdirGetQueryParameters.md#commonparamsubdirgetqueryparametersmap) queryParameters)
sets the optional property | +| [Get0RequestBuilder](#get0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Get0RequestBuilder](#get0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## GetRequestBuilder +public static class GetRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| GetRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Get0RequestBuilder](#get0requestbuilder) | pathParameters([CommonparamsubdirGetPathParametersCommonparamsubdirGetPathParametersMap](../../paths/commonparamsubdir/get/CommonparamsubdirGetPathParameters.md#commonparamsubdirgetpathparametersmap) pathParameters)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/CommonparamsubdirPost.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/CommonparamsubdirPost.md new file mode 100644 index 00000000000..6c2dbfa3503 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/commonparamsubdir/CommonparamsubdirPost.md @@ -0,0 +1,186 @@ +# CommonparamsubdirPost + +public class CommonparamsubdirPost + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Post](#post)
The class that has a post method to call the endpoint | +| interface | [PostCommonParamOperation](#postcommonparamoperation)
The interface that has a postCommonParam method to call the endpoint | +| static class | [PostRequest](#postrequest)
The final request inputs class | +| static class | [PostNullableRequest](#postnullablerequest)
The initial request inputs class | +| static class | [Post0RequestBuilder](#post0requestbuilder)
A builder for the request input class | +| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | + +## Post +public static class Post extends ApiClient.ApiClient1 implements PostOperation
+ +a class that allows one to call the endpoint using a method named post + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.commonparamsubdir.post.CommonparamsubdirPostHeaderParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.commonparamsubdir.post.CommonparamsubdirPostPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.commonparamsubdir.post.responses.CommonparamsubdirPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.commonparamsubdir.CommonparamsubdirPost; +import org.openapijsonschematools.client.paths.commonparamsubdir.post.CommonparamsubdirPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +CommonparamsubdirPost.Post apiClient = new CommonparamsubdirPost.Post(apiConfiguration, schemaConfiguration); + + +// Map validation +CommonparamsubdirPostPathParameters.CommonparamsubdirPostPathParametersMap pathParameters = + CommonparamsubdirPostPathParameters.CommonparamsubdirPostPathParameters1.validate( + new CommonparamsubdirPostPathParameters.CommonparamsubdirPostPathParametersMapBuilder() + .subDir("a") + + .build(), + schemaConfiguration +); + +var request = new CommonparamsubdirPost.PostRequestBuilder() + .pathParameters(pathParameters) + .build(); + +CommonparamsubdirPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +CommonparamsubdirPostResponses.EndpointCommonparamsubdirPostCode200Response castResponse = (CommonparamsubdirPostResponses.EndpointCommonparamsubdirPostCode200Response) response; +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [CommonparamsubdirPostResponses.EndpointResponse](../../paths/commonparamsubdir/post/CommonparamsubdirPostResponses.md#endpointresponse) | post([PostRequest](#postrequest) request) | + +## PostCommonParamOperation +public interface PostCommonParamOperation
+ +an interface that allows one to call the endpoint using a method named postCommonParam by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [CommonparamsubdirPostResponses.EndpointResponse](../../paths/commonparamsubdir/post/CommonparamsubdirPostResponses.md#endpointresponse) | postCommonParam([PostRequest](#postrequest) request) | + +## PostRequest +public static class PostRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [CommonparamsubdirPostPathParameters.CommonparamsubdirPostPathParametersMap](../../paths/commonparamsubdir/post/CommonparamsubdirPostPathParameters.md#commonparamsubdirpostpathparametersmap) | pathParameters | +| [CommonparamsubdirPostHeaderParameters.@Nullable CommonparamsubdirPostHeaderParametersMap](../../paths/commonparamsubdir/post/CommonparamsubdirPostHeaderParameters.md#commonparamsubdirpostheaderparametersmap) | headerParameters
optional | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PostNullableRequest +public static class PostNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [CommonparamsubdirPostPathParameters.@Nullable CommonparamsubdirPostPathParametersMap](../../paths/commonparamsubdir/post/CommonparamsubdirPostPathParameters.md#commonparamsubdirpostpathparametersmap) | pathParameters | +| [CommonparamsubdirPostHeaderParameters.@Nullable CommonparamsubdirPostHeaderParametersMap](../../paths/commonparamsubdir/post/CommonparamsubdirPostHeaderParameters.md#commonparamsubdirpostheaderparametersmap) | headerParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| @Nullable Duration | timeout | + +## Post0RequestBuilder +public static class Post0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post0RequestBuilder(Post0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | +| [Post0RequestBuilder](#post0requestbuilder) | headerParameters([CommonparamsubdirPostHeaderParametersCommonparamsubdirPostHeaderParametersMap](../../paths/commonparamsubdir/post/CommonparamsubdirPostHeaderParameters.md#commonparamsubdirpostheaderparametersmap) headerParameters)
sets the optional property | +| [Post0RequestBuilder](#post0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Post0RequestBuilder](#post0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## PostRequestBuilder +public static class PostRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PostRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Post0RequestBuilder](#post0requestbuilder) | pathParameters([CommonparamsubdirPostPathParametersCommonparamsubdirPostPathParametersMap](../../paths/commonparamsubdir/post/CommonparamsubdirPostPathParameters.md#commonparamsubdirpostpathparametersmap) pathParameters)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/Delete.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/Delete.md deleted file mode 100644 index 30991ce975e..00000000000 --- a/samples/client/petstore/java/docs/paths/commonparamsubdir/Delete.md +++ /dev/null @@ -1,175 +0,0 @@ -# Delete - -public class Delete - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Delete1](#delete1)
The class that has a delete method to call the endpoint | -| static class | [DeleteRequest](#deleterequest)
The final request inputs class | -| static class | [DeleteNullableRequest](#deletenullablerequest)
The initial request inputs class | -| static class | [Delete0RequestBuilder](#delete0requestbuilder)
A builder for the request input class | -| static class | [DeleteRequestBuilder](#deleterequestbuilder)
A builder for the request input class | - -## Delete1 -public static class Delete1 extends ApiClient.ApiClient1 implements DeleteOperation
- -a class that allows one to call the endpoint using a method named delete - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.commonparamsubdir.delete.HeaderParameters; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.commonparamsubdir.delete.PathParameters; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.commonparamsubdir.delete.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.commonparamsubdir.Delete; -import org.openapijsonschematools.client.paths.commonparamsubdir.delete.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Delete.Delete1 apiClient = new Delete.Delete1(apiConfiguration, schemaConfiguration); - - -// Map validation -PathParameters.PathParametersMap pathParameters = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .subDir("c") - - .build(), - schemaConfiguration -); - -var request = new DeleteRequestBuilder() - .pathParameters(pathParameters) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.delete(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Delete1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/commonparamsubdir/delete/Responses.md#endpointresponse) | delete([DeleteRequest](#deleterequest) request) | - -## DeleteRequest -public static class DeleteRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [PathParameters.PathParametersMap](../../paths/commonparamsubdir/delete/PathParameters.md#pathparametersmap) | pathParameters | -| [HeaderParameters.@Nullable HeaderParametersMap](../../paths/commonparamsubdir/delete/HeaderParameters.md#headerparametersmap) | headerParameters
optional | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## DeleteNullableRequest -public static class DeleteNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [PathParameters.@Nullable PathParametersMap](../../paths/commonparamsubdir/delete/PathParameters.md#pathparametersmap) | pathParameters | -| [HeaderParameters.@Nullable HeaderParametersMap](../../paths/commonparamsubdir/delete/HeaderParameters.md#headerparametersmap) | headerParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| @Nullable Duration | timeout | - -## Delete0RequestBuilder -public static class Delete0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Delete0RequestBuilder(Delete0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [DeleteRequest](#deleterequest) | build()
Returns the request input used to call an endpoint method | -| [Delete0RequestBuilder](#delete0requestbuilder) | headerParameters([HeaderParametersHeaderParametersMap](../../paths/commonparamsubdir/delete/HeaderParameters.md#headerparametersmap) headerParameters)
sets the optional property | -| [Delete0RequestBuilder](#delete0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Delete0RequestBuilder](#delete0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## DeleteRequestBuilder -public static class DeleteRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| DeleteRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Delete0RequestBuilder](#delete0requestbuilder) | pathParameters([PathParametersPathParametersMap](../../paths/commonparamsubdir/delete/PathParameters.md#pathparametersmap) pathParameters)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/Get.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/Get.md deleted file mode 100644 index 0dd7f7129e0..00000000000 --- a/samples/client/petstore/java/docs/paths/commonparamsubdir/Get.md +++ /dev/null @@ -1,175 +0,0 @@ -# Get - -public class Get - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Get1](#get1)
The class that has a get method to call the endpoint | -| static class | [GetRequest](#getrequest)
The final request inputs class | -| static class | [GetNullableRequest](#getnullablerequest)
The initial request inputs class | -| static class | [Get0RequestBuilder](#get0requestbuilder)
A builder for the request input class | -| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | - -## Get1 -public static class Get1 extends ApiClient.ApiClient1 implements GetOperation
- -a class that allows one to call the endpoint using a method named get - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.commonparamsubdir.get.QueryParameters; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.commonparamsubdir.get.PathParameters; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.commonparamsubdir.get.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.commonparamsubdir.Get; -import org.openapijsonschematools.client.paths.commonparamsubdir.get.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Get.Get1 apiClient = new Get.Get1(apiConfiguration, schemaConfiguration); - - -// Map validation -PathParameters.PathParametersMap pathParameters = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .subDir("a") - - .build(), - schemaConfiguration -); - -var request = new GetRequestBuilder() - .pathParameters(pathParameters) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.get(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/commonparamsubdir/get/Responses.md#endpointresponse) | get([GetRequest](#getrequest) request) | - -## GetRequest -public static class GetRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [PathParameters.PathParametersMap](../../paths/commonparamsubdir/get/PathParameters.md#pathparametersmap) | pathParameters | -| [QueryParameters.@Nullable QueryParametersMap](../../paths/commonparamsubdir/get/QueryParameters.md#queryparametersmap) | queryParameters
optional | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## GetNullableRequest -public static class GetNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [PathParameters.@Nullable PathParametersMap](../../paths/commonparamsubdir/get/PathParameters.md#pathparametersmap) | pathParameters | -| [QueryParameters.@Nullable QueryParametersMap](../../paths/commonparamsubdir/get/QueryParameters.md#queryparametersmap) | queryParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| @Nullable Duration | timeout | - -## Get0RequestBuilder -public static class Get0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get0RequestBuilder(Get0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | -| [Get0RequestBuilder](#get0requestbuilder) | queryParameters([QueryParametersQueryParametersMap](../../paths/commonparamsubdir/get/QueryParameters.md#queryparametersmap) queryParameters)
sets the optional property | -| [Get0RequestBuilder](#get0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Get0RequestBuilder](#get0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## GetRequestBuilder -public static class GetRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| GetRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Get0RequestBuilder](#get0requestbuilder) | pathParameters([PathParametersPathParametersMap](../../paths/commonparamsubdir/get/PathParameters.md#pathparametersmap) pathParameters)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/Post.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/Post.md deleted file mode 100644 index 39c630ee0b4..00000000000 --- a/samples/client/petstore/java/docs/paths/commonparamsubdir/Post.md +++ /dev/null @@ -1,175 +0,0 @@ -# Post - -public class Post - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Post1](#post1)
The class that has a post method to call the endpoint | -| static class | [PostRequest](#postrequest)
The final request inputs class | -| static class | [PostNullableRequest](#postnullablerequest)
The initial request inputs class | -| static class | [Post0RequestBuilder](#post0requestbuilder)
A builder for the request input class | -| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | - -## Post1 -public static class Post1 extends ApiClient.ApiClient1 implements PostOperation
- -a class that allows one to call the endpoint using a method named post - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.commonparamsubdir.post.HeaderParameters; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.commonparamsubdir.post.PathParameters; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.commonparamsubdir.post.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.commonparamsubdir.Post; -import org.openapijsonschematools.client.paths.commonparamsubdir.post.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Post.Post1 apiClient = new Post.Post1(apiConfiguration, schemaConfiguration); - - -// Map validation -PathParameters.PathParametersMap pathParameters = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .subDir("a") - - .build(), - schemaConfiguration -); - -var request = new PostRequestBuilder() - .pathParameters(pathParameters) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.post(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/commonparamsubdir/post/Responses.md#endpointresponse) | post([PostRequest](#postrequest) request) | - -## PostRequest -public static class PostRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [PathParameters.PathParametersMap](../../paths/commonparamsubdir/post/PathParameters.md#pathparametersmap) | pathParameters | -| [HeaderParameters.@Nullable HeaderParametersMap](../../paths/commonparamsubdir/post/HeaderParameters.md#headerparametersmap) | headerParameters
optional | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PostNullableRequest -public static class PostNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [PathParameters.@Nullable PathParametersMap](../../paths/commonparamsubdir/post/PathParameters.md#pathparametersmap) | pathParameters | -| [HeaderParameters.@Nullable HeaderParametersMap](../../paths/commonparamsubdir/post/HeaderParameters.md#headerparametersmap) | headerParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| @Nullable Duration | timeout | - -## Post0RequestBuilder -public static class Post0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post0RequestBuilder(Post0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | -| [Post0RequestBuilder](#post0requestbuilder) | headerParameters([HeaderParametersHeaderParametersMap](../../paths/commonparamsubdir/post/HeaderParameters.md#headerparametersmap) headerParameters)
sets the optional property | -| [Post0RequestBuilder](#post0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Post0RequestBuilder](#post0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## PostRequestBuilder -public static class PostRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PostRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Post0RequestBuilder](#post0requestbuilder) | pathParameters([PathParametersPathParametersMap](../../paths/commonparamsubdir/post/PathParameters.md#pathparametersmap) pathParameters)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/CommonparamsubdirDeleteHeaderParameters.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/CommonparamsubdirDeleteHeaderParameters.md new file mode 100644 index 00000000000..1acedc6bca7 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/CommonparamsubdirDeleteHeaderParameters.md @@ -0,0 +1,252 @@ +# CommonparamsubdirDeleteHeaderParameters +public class CommonparamsubdirDeleteHeaderParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [CommonparamsubdirDeleteHeaderParameters.CommonparamsubdirDeleteHeaderParameters1Boxed](#commonparamsubdirdeleteheaderparameters1boxed)
sealed interface for validated payloads | +| record | [CommonparamsubdirDeleteHeaderParameters.CommonparamsubdirDeleteHeaderParameters1BoxedMap](#commonparamsubdirdeleteheaderparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [CommonparamsubdirDeleteHeaderParameters.CommonparamsubdirDeleteHeaderParameters1](#commonparamsubdirdeleteheaderparameters1)
schema class | +| static class | [CommonparamsubdirDeleteHeaderParameters.CommonparamsubdirDeleteHeaderParametersMapBuilder](#commonparamsubdirdeleteheaderparametersmapbuilder)
builder for Map payloads | +| static class | [CommonparamsubdirDeleteHeaderParameters.CommonparamsubdirDeleteHeaderParametersMap](#commonparamsubdirdeleteheaderparametersmap)
output class for Map payloads | +| sealed interface | [CommonparamsubdirDeleteHeaderParameters.CommonparamsubdirDeleteadditionalPropertiesBoxed](#commonparamsubdirdeleteadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [CommonparamsubdirDeleteHeaderParameters.CommonparamsubdirDeleteadditionalPropertiesBoxedVoid](#commonparamsubdirdeleteadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [CommonparamsubdirDeleteHeaderParameters.CommonparamsubdirDeleteadditionalPropertiesBoxedBoolean](#commonparamsubdirdeleteadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [CommonparamsubdirDeleteHeaderParameters.CommonparamsubdirDeleteadditionalPropertiesBoxedNumber](#commonparamsubdirdeleteadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [CommonparamsubdirDeleteHeaderParameters.CommonparamsubdirDeleteadditionalPropertiesBoxedString](#commonparamsubdirdeleteadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [CommonparamsubdirDeleteHeaderParameters.CommonparamsubdirDeleteadditionalPropertiesBoxedList](#commonparamsubdirdeleteadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [CommonparamsubdirDeleteHeaderParameters.CommonparamsubdirDeleteadditionalPropertiesBoxedMap](#commonparamsubdirdeleteadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [CommonparamsubdirDeleteHeaderParameters.CommonparamsubdirDeleteadditionalProperties](#commonparamsubdirdeleteadditionalproperties)
schema class | + +## CommonparamsubdirDeleteHeaderParameters1Boxed +public sealed interface CommonparamsubdirDeleteHeaderParameters1Boxed
+permits
+[CommonparamsubdirDeleteHeaderParameters1BoxedMap](#commonparamsubdirdeleteheaderparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## CommonparamsubdirDeleteHeaderParameters1BoxedMap +public record CommonparamsubdirDeleteHeaderParameters1BoxedMap
+implements [CommonparamsubdirDeleteHeaderParameters1Boxed](#commonparamsubdirdeleteheaderparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirDeleteHeaderParameters1BoxedMap([CommonparamsubdirDeleteHeaderParametersMap](#commonparamsubdirdeleteheaderparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [CommonparamsubdirDeleteHeaderParametersMap](#commonparamsubdirdeleteheaderparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirDeleteHeaderParameters1 +public static class CommonparamsubdirDeleteHeaderParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.commonparamsubdir.delete.CommonparamsubdirDeleteHeaderParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +CommonparamsubdirDeleteHeaderParameters.CommonparamsubdirDeleteHeaderParametersMap validatedPayload = + CommonparamsubdirDeleteHeaderParameters.CommonparamsubdirDeleteHeaderParameters1.validate( + new CommonparamsubdirDeleteHeaderParameters.CommonparamsubdirDeleteHeaderParametersMapBuilder() + .someHeader("a") + + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("someHeader", [Schema0.Schema01.class](../../../paths/commonparamsubdir/delete/parameters/parameter0/Schema0.md#schema01))
)
| +| Class | additionalProperties = [CommonparamsubdirDeleteadditionalProperties.class](#commonparamsubdirdeleteadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [CommonparamsubdirDeleteHeaderParametersMap](#commonparamsubdirdeleteheaderparametersmap) | validate([Map<?, ?>](#commonparamsubdirdeleteheaderparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [CommonparamsubdirDeleteHeaderParameters1BoxedMap](#commonparamsubdirdeleteheaderparameters1boxedmap) | validateAndBox([Map<?, ?>](#commonparamsubdirdeleteheaderparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [CommonparamsubdirDeleteHeaderParameters1Boxed](#commonparamsubdirdeleteheaderparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## CommonparamsubdirDeleteHeaderParametersMapBuilder +public class CommonparamsubdirDeleteHeaderParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirDeleteHeaderParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | +| [CommonparamsubdirDeleteHeaderParametersMapBuilder](#commonparamsubdirdeleteheaderparametersmapbuilder) | someHeader(String value) | + +## CommonparamsubdirDeleteHeaderParametersMap +public static class CommonparamsubdirDeleteHeaderParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [CommonparamsubdirDeleteHeaderParametersMap](#commonparamsubdirdeleteheaderparametersmap) | of([Map](#commonparamsubdirdeleteheaderparametersmapbuilder) arg, SchemaConfiguration configuration) | +| String | someHeader()
[optional] | + +## CommonparamsubdirDeleteadditionalPropertiesBoxed +public sealed interface CommonparamsubdirDeleteadditionalPropertiesBoxed
+permits
+[CommonparamsubdirDeleteadditionalPropertiesBoxedVoid](#commonparamsubdirdeleteadditionalpropertiesboxedvoid), +[CommonparamsubdirDeleteadditionalPropertiesBoxedBoolean](#commonparamsubdirdeleteadditionalpropertiesboxedboolean), +[CommonparamsubdirDeleteadditionalPropertiesBoxedNumber](#commonparamsubdirdeleteadditionalpropertiesboxednumber), +[CommonparamsubdirDeleteadditionalPropertiesBoxedString](#commonparamsubdirdeleteadditionalpropertiesboxedstring), +[CommonparamsubdirDeleteadditionalPropertiesBoxedList](#commonparamsubdirdeleteadditionalpropertiesboxedlist), +[CommonparamsubdirDeleteadditionalPropertiesBoxedMap](#commonparamsubdirdeleteadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## CommonparamsubdirDeleteadditionalPropertiesBoxedVoid +public record CommonparamsubdirDeleteadditionalPropertiesBoxedVoid
+implements [CommonparamsubdirDeleteadditionalPropertiesBoxed](#commonparamsubdirdeleteadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirDeleteadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirDeleteadditionalPropertiesBoxedBoolean +public record CommonparamsubdirDeleteadditionalPropertiesBoxedBoolean
+implements [CommonparamsubdirDeleteadditionalPropertiesBoxed](#commonparamsubdirdeleteadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirDeleteadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirDeleteadditionalPropertiesBoxedNumber +public record CommonparamsubdirDeleteadditionalPropertiesBoxedNumber
+implements [CommonparamsubdirDeleteadditionalPropertiesBoxed](#commonparamsubdirdeleteadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirDeleteadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirDeleteadditionalPropertiesBoxedString +public record CommonparamsubdirDeleteadditionalPropertiesBoxedString
+implements [CommonparamsubdirDeleteadditionalPropertiesBoxed](#commonparamsubdirdeleteadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirDeleteadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirDeleteadditionalPropertiesBoxedList +public record CommonparamsubdirDeleteadditionalPropertiesBoxedList
+implements [CommonparamsubdirDeleteadditionalPropertiesBoxed](#commonparamsubdirdeleteadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirDeleteadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirDeleteadditionalPropertiesBoxedMap +public record CommonparamsubdirDeleteadditionalPropertiesBoxedMap
+implements [CommonparamsubdirDeleteadditionalPropertiesBoxed](#commonparamsubdirdeleteadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirDeleteadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirDeleteadditionalProperties +public static class CommonparamsubdirDeleteadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/CommonparamsubdirDeletePathParameters.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/CommonparamsubdirDeletePathParameters.md new file mode 100644 index 00000000000..62e02ea4ad8 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/CommonparamsubdirDeletePathParameters.md @@ -0,0 +1,269 @@ +# CommonparamsubdirDeletePathParameters +public class CommonparamsubdirDeletePathParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [CommonparamsubdirDeletePathParameters.CommonparamsubdirDeletePathParameters1Boxed](#commonparamsubdirdeletepathparameters1boxed)
sealed interface for validated payloads | +| record | [CommonparamsubdirDeletePathParameters.CommonparamsubdirDeletePathParameters1BoxedMap](#commonparamsubdirdeletepathparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [CommonparamsubdirDeletePathParameters.CommonparamsubdirDeletePathParameters1](#commonparamsubdirdeletepathparameters1)
schema class | +| static class | [CommonparamsubdirDeletePathParameters.CommonparamsubdirDeletePathParametersMapBuilder](#commonparamsubdirdeletepathparametersmapbuilder)
builder for Map payloads | +| static class | [CommonparamsubdirDeletePathParameters.CommonparamsubdirDeletePathParametersMap](#commonparamsubdirdeletepathparametersmap)
output class for Map payloads | +| sealed interface | [CommonparamsubdirDeletePathParameters.CommonparamsubdirDeleteadditionalPropertiesBoxed](#commonparamsubdirdeleteadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [CommonparamsubdirDeletePathParameters.CommonparamsubdirDeleteadditionalPropertiesBoxedVoid](#commonparamsubdirdeleteadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [CommonparamsubdirDeletePathParameters.CommonparamsubdirDeleteadditionalPropertiesBoxedBoolean](#commonparamsubdirdeleteadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [CommonparamsubdirDeletePathParameters.CommonparamsubdirDeleteadditionalPropertiesBoxedNumber](#commonparamsubdirdeleteadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [CommonparamsubdirDeletePathParameters.CommonparamsubdirDeleteadditionalPropertiesBoxedString](#commonparamsubdirdeleteadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [CommonparamsubdirDeletePathParameters.CommonparamsubdirDeleteadditionalPropertiesBoxedList](#commonparamsubdirdeleteadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [CommonparamsubdirDeletePathParameters.CommonparamsubdirDeleteadditionalPropertiesBoxedMap](#commonparamsubdirdeleteadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [CommonparamsubdirDeletePathParameters.CommonparamsubdirDeleteadditionalProperties](#commonparamsubdirdeleteadditionalproperties)
schema class | + +## CommonparamsubdirDeletePathParameters1Boxed +public sealed interface CommonparamsubdirDeletePathParameters1Boxed
+permits
+[CommonparamsubdirDeletePathParameters1BoxedMap](#commonparamsubdirdeletepathparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## CommonparamsubdirDeletePathParameters1BoxedMap +public record CommonparamsubdirDeletePathParameters1BoxedMap
+implements [CommonparamsubdirDeletePathParameters1Boxed](#commonparamsubdirdeletepathparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirDeletePathParameters1BoxedMap([CommonparamsubdirDeletePathParametersMap](#commonparamsubdirdeletepathparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [CommonparamsubdirDeletePathParametersMap](#commonparamsubdirdeletepathparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirDeletePathParameters1 +public static class CommonparamsubdirDeletePathParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.commonparamsubdir.delete.CommonparamsubdirDeletePathParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +CommonparamsubdirDeletePathParameters.CommonparamsubdirDeletePathParametersMap validatedPayload = + CommonparamsubdirDeletePathParameters.CommonparamsubdirDeletePathParameters1.validate( + new CommonparamsubdirDeletePathParameters.CommonparamsubdirDeletePathParametersMapBuilder() + .subDir("c") + + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("subDir", [Schema1.Schema11.class](../../../paths/commonparamsubdir/delete/parameters/parameter1/Schema1.md#schema11))
)
| +| Set | required = Set.of(
    "subDir"
)
| +| Class | additionalProperties = [CommonparamsubdirDeleteadditionalProperties.class](#commonparamsubdirdeleteadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [CommonparamsubdirDeletePathParametersMap](#commonparamsubdirdeletepathparametersmap) | validate([Map<?, ?>](#commonparamsubdirdeletepathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [CommonparamsubdirDeletePathParameters1BoxedMap](#commonparamsubdirdeletepathparameters1boxedmap) | validateAndBox([Map<?, ?>](#commonparamsubdirdeletepathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [CommonparamsubdirDeletePathParameters1Boxed](#commonparamsubdirdeletepathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## CommonparamsubdirDeletePathParametersMap0Builder +public class CommonparamsubdirDeletePathParametersMap0Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirDeletePathParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | + +## CommonparamsubdirDeletePathParametersMapBuilder +public class CommonparamsubdirDeletePathParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirDeletePathParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [CommonparamsubdirDeletePathParametersMap0Builder](#commonparamsubdirdeletepathparametersmap0builder) | subDir(String value) | +| [CommonparamsubdirDeletePathParametersMap0Builder](#commonparamsubdirdeletepathparametersmap0builder) | subDir([Schema1.StringSchemaEnums1](../../../paths/commonparamsubdir/delete/parameters/parameter1/Schema1.md#stringschemaenums1) value) | + +## CommonparamsubdirDeletePathParametersMap +public static class CommonparamsubdirDeletePathParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [CommonparamsubdirDeletePathParametersMap](#commonparamsubdirdeletepathparametersmap) | of([Map](#commonparamsubdirdeletepathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| String | subDir()
| + +## CommonparamsubdirDeleteadditionalPropertiesBoxed +public sealed interface CommonparamsubdirDeleteadditionalPropertiesBoxed
+permits
+[CommonparamsubdirDeleteadditionalPropertiesBoxedVoid](#commonparamsubdirdeleteadditionalpropertiesboxedvoid), +[CommonparamsubdirDeleteadditionalPropertiesBoxedBoolean](#commonparamsubdirdeleteadditionalpropertiesboxedboolean), +[CommonparamsubdirDeleteadditionalPropertiesBoxedNumber](#commonparamsubdirdeleteadditionalpropertiesboxednumber), +[CommonparamsubdirDeleteadditionalPropertiesBoxedString](#commonparamsubdirdeleteadditionalpropertiesboxedstring), +[CommonparamsubdirDeleteadditionalPropertiesBoxedList](#commonparamsubdirdeleteadditionalpropertiesboxedlist), +[CommonparamsubdirDeleteadditionalPropertiesBoxedMap](#commonparamsubdirdeleteadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## CommonparamsubdirDeleteadditionalPropertiesBoxedVoid +public record CommonparamsubdirDeleteadditionalPropertiesBoxedVoid
+implements [CommonparamsubdirDeleteadditionalPropertiesBoxed](#commonparamsubdirdeleteadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirDeleteadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirDeleteadditionalPropertiesBoxedBoolean +public record CommonparamsubdirDeleteadditionalPropertiesBoxedBoolean
+implements [CommonparamsubdirDeleteadditionalPropertiesBoxed](#commonparamsubdirdeleteadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirDeleteadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirDeleteadditionalPropertiesBoxedNumber +public record CommonparamsubdirDeleteadditionalPropertiesBoxedNumber
+implements [CommonparamsubdirDeleteadditionalPropertiesBoxed](#commonparamsubdirdeleteadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirDeleteadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirDeleteadditionalPropertiesBoxedString +public record CommonparamsubdirDeleteadditionalPropertiesBoxedString
+implements [CommonparamsubdirDeleteadditionalPropertiesBoxed](#commonparamsubdirdeleteadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirDeleteadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirDeleteadditionalPropertiesBoxedList +public record CommonparamsubdirDeleteadditionalPropertiesBoxedList
+implements [CommonparamsubdirDeleteadditionalPropertiesBoxed](#commonparamsubdirdeleteadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirDeleteadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirDeleteadditionalPropertiesBoxedMap +public record CommonparamsubdirDeleteadditionalPropertiesBoxedMap
+implements [CommonparamsubdirDeleteadditionalPropertiesBoxed](#commonparamsubdirdeleteadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirDeleteadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirDeleteadditionalProperties +public static class CommonparamsubdirDeleteadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/CommonparamsubdirDeleteResponses.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/CommonparamsubdirDeleteResponses.md new file mode 100644 index 00000000000..955c52cfc4c --- /dev/null +++ b/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/CommonparamsubdirDeleteResponses.md @@ -0,0 +1,29 @@ +# CommonparamsubdirDeleteResponses + +public class CommonparamsubdirDeleteResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointCommonparamsubdirDeleteCode200Response](#endpointcommonparamsubdirdeletecode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointCommonparamsubdirDeleteCode200Response](#endpointcommonparamsubdirdeletecode200response) + +a sealed interface that stores endpoint responses + +## EndpointCommonparamsubdirDeleteCode200Response +public record EndpointCommonparamsubdirDeleteCode200Response( + HttpResponse response, + Void body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/HeaderParameters.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/HeaderParameters.md deleted file mode 100644 index 8f0f25e94e3..00000000000 --- a/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/HeaderParameters.md +++ /dev/null @@ -1,252 +0,0 @@ -# HeaderParameters -public class HeaderParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [HeaderParameters.HeaderParameters1Boxed](#headerparameters1boxed)
sealed interface for validated payloads | -| record | [HeaderParameters.HeaderParameters1BoxedMap](#headerparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [HeaderParameters.HeaderParameters1](#headerparameters1)
schema class | -| static class | [HeaderParameters.HeaderParametersMapBuilder](#headerparametersmapbuilder)
builder for Map payloads | -| static class | [HeaderParameters.HeaderParametersMap](#headerparametersmap)
output class for Map payloads | -| sealed interface | [HeaderParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [HeaderParameters.AdditionalProperties](#additionalproperties)
schema class | - -## HeaderParameters1Boxed -public sealed interface HeaderParameters1Boxed
-permits
-[HeaderParameters1BoxedMap](#headerparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## HeaderParameters1BoxedMap -public record HeaderParameters1BoxedMap
-implements [HeaderParameters1Boxed](#headerparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| HeaderParameters1BoxedMap([HeaderParametersMap](#headerparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [HeaderParametersMap](#headerparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## HeaderParameters1 -public static class HeaderParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.commonparamsubdir.delete.HeaderParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -HeaderParameters.HeaderParametersMap validatedPayload = - HeaderParameters.HeaderParameters1.validate( - new HeaderParameters.HeaderParametersMapBuilder() - .someHeader("a") - - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("someHeader", [Schema0.Schema01.class](../../../paths/commonparamsubdir/delete/parameters/parameter0/Schema0.md#schema01))
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [HeaderParametersMap](#headerparametersmap) | validate([Map<?, ?>](#headerparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [HeaderParameters1BoxedMap](#headerparameters1boxedmap) | validateAndBox([Map<?, ?>](#headerparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [HeaderParameters1Boxed](#headerparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## HeaderParametersMapBuilder -public class HeaderParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| HeaderParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | -| [HeaderParametersMapBuilder](#headerparametersmapbuilder) | someHeader(String value) | - -## HeaderParametersMap -public static class HeaderParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [HeaderParametersMap](#headerparametersmap) | of([Map](#headerparametersmapbuilder) arg, SchemaConfiguration configuration) | -| String | someHeader()
[optional] | - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/PathParameters.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/PathParameters.md deleted file mode 100644 index 87f833e6a58..00000000000 --- a/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/PathParameters.md +++ /dev/null @@ -1,269 +0,0 @@ -# PathParameters -public class PathParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [PathParameters.PathParameters1Boxed](#pathparameters1boxed)
sealed interface for validated payloads | -| record | [PathParameters.PathParameters1BoxedMap](#pathparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.PathParameters1](#pathparameters1)
schema class | -| static class | [PathParameters.PathParametersMapBuilder](#pathparametersmapbuilder)
builder for Map payloads | -| static class | [PathParameters.PathParametersMap](#pathparametersmap)
output class for Map payloads | -| sealed interface | [PathParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [PathParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [PathParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [PathParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [PathParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [PathParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [PathParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.AdditionalProperties](#additionalproperties)
schema class | - -## PathParameters1Boxed -public sealed interface PathParameters1Boxed
-permits
-[PathParameters1BoxedMap](#pathparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## PathParameters1BoxedMap -public record PathParameters1BoxedMap
-implements [PathParameters1Boxed](#pathparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParameters1BoxedMap([PathParametersMap](#pathparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## PathParameters1 -public static class PathParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.commonparamsubdir.delete.PathParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -PathParameters.PathParametersMap validatedPayload = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .subDir("c") - - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("subDir", [Schema1.Schema11.class](../../../paths/commonparamsubdir/delete/parameters/parameter1/Schema1.md#schema11))
)
| -| Set | required = Set.of(
    "subDir"
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | validate([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1BoxedMap](#pathparameters1boxedmap) | validateAndBox([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1Boxed](#pathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## PathParametersMap0Builder -public class PathParametersMap0Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | - -## PathParametersMapBuilder -public class PathParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap0Builder](#pathparametersmap0builder) | subDir(String value) | -| [PathParametersMap0Builder](#pathparametersmap0builder) | subDir([Schema1.StringSchemaEnums1](../../../paths/commonparamsubdir/delete/parameters/parameter1/Schema1.md#stringschemaenums1) value) | - -## PathParametersMap -public static class PathParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [PathParametersMap](#pathparametersmap) | of([Map](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| String | subDir()
| - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/Responses.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/Responses.md deleted file mode 100644 index d4bf4fdb8f5..00000000000 --- a/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/responses/Code200Response.md deleted file mode 100644 index e89c75b2e12..00000000000 --- a/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/responses/Code200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# Code200Response - -public class Code200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) - -A class (extended from the $ref class) that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## Code200Response1 -public static class Code200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
- -a class that deserializes responses, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/responses/CommonparamsubdirDeleteCode200Response.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/responses/CommonparamsubdirDeleteCode200Response.md new file mode 100644 index 00000000000..7781a6df85d --- /dev/null +++ b/samples/client/petstore/java/docs/paths/commonparamsubdir/delete/responses/CommonparamsubdirDeleteCode200Response.md @@ -0,0 +1,17 @@ +# CommonparamsubdirDeleteCode200Response + +public class CommonparamsubdirDeleteCode200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) + +A class (extended from the $ref class) that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [CommonparamsubdirDeleteCode200Response.CommonparamsubdirDeleteCode200Response1](#commonparamsubdirdeletecode200response1)
class that deserializes responses | + +## CommonparamsubdirDeleteCode200Response1 +public static class CommonparamsubdirDeleteCode200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
+ +a class that deserializes responses, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/get/CommonparamsubdirGetPathParameters.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/get/CommonparamsubdirGetPathParameters.md new file mode 100644 index 00000000000..eed90e0e7c1 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/commonparamsubdir/get/CommonparamsubdirGetPathParameters.md @@ -0,0 +1,269 @@ +# CommonparamsubdirGetPathParameters +public class CommonparamsubdirGetPathParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [CommonparamsubdirGetPathParameters.CommonparamsubdirGetPathParameters1Boxed](#commonparamsubdirgetpathparameters1boxed)
sealed interface for validated payloads | +| record | [CommonparamsubdirGetPathParameters.CommonparamsubdirGetPathParameters1BoxedMap](#commonparamsubdirgetpathparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [CommonparamsubdirGetPathParameters.CommonparamsubdirGetPathParameters1](#commonparamsubdirgetpathparameters1)
schema class | +| static class | [CommonparamsubdirGetPathParameters.CommonparamsubdirGetPathParametersMapBuilder](#commonparamsubdirgetpathparametersmapbuilder)
builder for Map payloads | +| static class | [CommonparamsubdirGetPathParameters.CommonparamsubdirGetPathParametersMap](#commonparamsubdirgetpathparametersmap)
output class for Map payloads | +| sealed interface | [CommonparamsubdirGetPathParameters.CommonparamsubdirGetadditionalPropertiesBoxed](#commonparamsubdirgetadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [CommonparamsubdirGetPathParameters.CommonparamsubdirGetadditionalPropertiesBoxedVoid](#commonparamsubdirgetadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [CommonparamsubdirGetPathParameters.CommonparamsubdirGetadditionalPropertiesBoxedBoolean](#commonparamsubdirgetadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [CommonparamsubdirGetPathParameters.CommonparamsubdirGetadditionalPropertiesBoxedNumber](#commonparamsubdirgetadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [CommonparamsubdirGetPathParameters.CommonparamsubdirGetadditionalPropertiesBoxedString](#commonparamsubdirgetadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [CommonparamsubdirGetPathParameters.CommonparamsubdirGetadditionalPropertiesBoxedList](#commonparamsubdirgetadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [CommonparamsubdirGetPathParameters.CommonparamsubdirGetadditionalPropertiesBoxedMap](#commonparamsubdirgetadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [CommonparamsubdirGetPathParameters.CommonparamsubdirGetadditionalProperties](#commonparamsubdirgetadditionalproperties)
schema class | + +## CommonparamsubdirGetPathParameters1Boxed +public sealed interface CommonparamsubdirGetPathParameters1Boxed
+permits
+[CommonparamsubdirGetPathParameters1BoxedMap](#commonparamsubdirgetpathparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## CommonparamsubdirGetPathParameters1BoxedMap +public record CommonparamsubdirGetPathParameters1BoxedMap
+implements [CommonparamsubdirGetPathParameters1Boxed](#commonparamsubdirgetpathparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirGetPathParameters1BoxedMap([CommonparamsubdirGetPathParametersMap](#commonparamsubdirgetpathparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [CommonparamsubdirGetPathParametersMap](#commonparamsubdirgetpathparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirGetPathParameters1 +public static class CommonparamsubdirGetPathParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.commonparamsubdir.get.CommonparamsubdirGetPathParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +CommonparamsubdirGetPathParameters.CommonparamsubdirGetPathParametersMap validatedPayload = + CommonparamsubdirGetPathParameters.CommonparamsubdirGetPathParameters1.validate( + new CommonparamsubdirGetPathParameters.CommonparamsubdirGetPathParametersMapBuilder() + .subDir("a") + + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("subDir", [RouteParamSchema0.RouteParamSchema01.class](../../../paths/commonparamsubdir/parameters/routeparameter0/RouteParamSchema0.md#routeparamschema01))
)
| +| Set | required = Set.of(
    "subDir"
)
| +| Class | additionalProperties = [CommonparamsubdirGetadditionalProperties.class](#commonparamsubdirgetadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [CommonparamsubdirGetPathParametersMap](#commonparamsubdirgetpathparametersmap) | validate([Map<?, ?>](#commonparamsubdirgetpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [CommonparamsubdirGetPathParameters1BoxedMap](#commonparamsubdirgetpathparameters1boxedmap) | validateAndBox([Map<?, ?>](#commonparamsubdirgetpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [CommonparamsubdirGetPathParameters1Boxed](#commonparamsubdirgetpathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## CommonparamsubdirGetPathParametersMap0Builder +public class CommonparamsubdirGetPathParametersMap0Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirGetPathParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | + +## CommonparamsubdirGetPathParametersMapBuilder +public class CommonparamsubdirGetPathParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirGetPathParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [CommonparamsubdirGetPathParametersMap0Builder](#commonparamsubdirgetpathparametersmap0builder) | subDir(String value) | +| [CommonparamsubdirGetPathParametersMap0Builder](#commonparamsubdirgetpathparametersmap0builder) | subDir([RouteParamSchema0.StringRouteParamSchemaEnums0](../../../paths/commonparamsubdir/parameters/routeparameter0/RouteParamSchema0.md#stringrouteparamschemaenums0) value) | + +## CommonparamsubdirGetPathParametersMap +public static class CommonparamsubdirGetPathParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [CommonparamsubdirGetPathParametersMap](#commonparamsubdirgetpathparametersmap) | of([Map](#commonparamsubdirgetpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| String | subDir()
| + +## CommonparamsubdirGetadditionalPropertiesBoxed +public sealed interface CommonparamsubdirGetadditionalPropertiesBoxed
+permits
+[CommonparamsubdirGetadditionalPropertiesBoxedVoid](#commonparamsubdirgetadditionalpropertiesboxedvoid), +[CommonparamsubdirGetadditionalPropertiesBoxedBoolean](#commonparamsubdirgetadditionalpropertiesboxedboolean), +[CommonparamsubdirGetadditionalPropertiesBoxedNumber](#commonparamsubdirgetadditionalpropertiesboxednumber), +[CommonparamsubdirGetadditionalPropertiesBoxedString](#commonparamsubdirgetadditionalpropertiesboxedstring), +[CommonparamsubdirGetadditionalPropertiesBoxedList](#commonparamsubdirgetadditionalpropertiesboxedlist), +[CommonparamsubdirGetadditionalPropertiesBoxedMap](#commonparamsubdirgetadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## CommonparamsubdirGetadditionalPropertiesBoxedVoid +public record CommonparamsubdirGetadditionalPropertiesBoxedVoid
+implements [CommonparamsubdirGetadditionalPropertiesBoxed](#commonparamsubdirgetadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirGetadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirGetadditionalPropertiesBoxedBoolean +public record CommonparamsubdirGetadditionalPropertiesBoxedBoolean
+implements [CommonparamsubdirGetadditionalPropertiesBoxed](#commonparamsubdirgetadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirGetadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirGetadditionalPropertiesBoxedNumber +public record CommonparamsubdirGetadditionalPropertiesBoxedNumber
+implements [CommonparamsubdirGetadditionalPropertiesBoxed](#commonparamsubdirgetadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirGetadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirGetadditionalPropertiesBoxedString +public record CommonparamsubdirGetadditionalPropertiesBoxedString
+implements [CommonparamsubdirGetadditionalPropertiesBoxed](#commonparamsubdirgetadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirGetadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirGetadditionalPropertiesBoxedList +public record CommonparamsubdirGetadditionalPropertiesBoxedList
+implements [CommonparamsubdirGetadditionalPropertiesBoxed](#commonparamsubdirgetadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirGetadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirGetadditionalPropertiesBoxedMap +public record CommonparamsubdirGetadditionalPropertiesBoxedMap
+implements [CommonparamsubdirGetadditionalPropertiesBoxed](#commonparamsubdirgetadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirGetadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirGetadditionalProperties +public static class CommonparamsubdirGetadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/get/CommonparamsubdirGetQueryParameters.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/get/CommonparamsubdirGetQueryParameters.md new file mode 100644 index 00000000000..32a24a2bd57 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/commonparamsubdir/get/CommonparamsubdirGetQueryParameters.md @@ -0,0 +1,252 @@ +# CommonparamsubdirGetQueryParameters +public class CommonparamsubdirGetQueryParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [CommonparamsubdirGetQueryParameters.CommonparamsubdirGetQueryParameters1Boxed](#commonparamsubdirgetqueryparameters1boxed)
sealed interface for validated payloads | +| record | [CommonparamsubdirGetQueryParameters.CommonparamsubdirGetQueryParameters1BoxedMap](#commonparamsubdirgetqueryparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [CommonparamsubdirGetQueryParameters.CommonparamsubdirGetQueryParameters1](#commonparamsubdirgetqueryparameters1)
schema class | +| static class | [CommonparamsubdirGetQueryParameters.CommonparamsubdirGetQueryParametersMapBuilder](#commonparamsubdirgetqueryparametersmapbuilder)
builder for Map payloads | +| static class | [CommonparamsubdirGetQueryParameters.CommonparamsubdirGetQueryParametersMap](#commonparamsubdirgetqueryparametersmap)
output class for Map payloads | +| sealed interface | [CommonparamsubdirGetQueryParameters.CommonparamsubdirGetadditionalPropertiesBoxed](#commonparamsubdirgetadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [CommonparamsubdirGetQueryParameters.CommonparamsubdirGetadditionalPropertiesBoxedVoid](#commonparamsubdirgetadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [CommonparamsubdirGetQueryParameters.CommonparamsubdirGetadditionalPropertiesBoxedBoolean](#commonparamsubdirgetadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [CommonparamsubdirGetQueryParameters.CommonparamsubdirGetadditionalPropertiesBoxedNumber](#commonparamsubdirgetadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [CommonparamsubdirGetQueryParameters.CommonparamsubdirGetadditionalPropertiesBoxedString](#commonparamsubdirgetadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [CommonparamsubdirGetQueryParameters.CommonparamsubdirGetadditionalPropertiesBoxedList](#commonparamsubdirgetadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [CommonparamsubdirGetQueryParameters.CommonparamsubdirGetadditionalPropertiesBoxedMap](#commonparamsubdirgetadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [CommonparamsubdirGetQueryParameters.CommonparamsubdirGetadditionalProperties](#commonparamsubdirgetadditionalproperties)
schema class | + +## CommonparamsubdirGetQueryParameters1Boxed +public sealed interface CommonparamsubdirGetQueryParameters1Boxed
+permits
+[CommonparamsubdirGetQueryParameters1BoxedMap](#commonparamsubdirgetqueryparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## CommonparamsubdirGetQueryParameters1BoxedMap +public record CommonparamsubdirGetQueryParameters1BoxedMap
+implements [CommonparamsubdirGetQueryParameters1Boxed](#commonparamsubdirgetqueryparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirGetQueryParameters1BoxedMap([CommonparamsubdirGetQueryParametersMap](#commonparamsubdirgetqueryparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [CommonparamsubdirGetQueryParametersMap](#commonparamsubdirgetqueryparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirGetQueryParameters1 +public static class CommonparamsubdirGetQueryParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.commonparamsubdir.get.CommonparamsubdirGetQueryParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +CommonparamsubdirGetQueryParameters.CommonparamsubdirGetQueryParametersMap validatedPayload = + CommonparamsubdirGetQueryParameters.CommonparamsubdirGetQueryParameters1.validate( + new CommonparamsubdirGetQueryParameters.CommonparamsubdirGetQueryParametersMapBuilder() + .searchStr("a") + + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("searchStr", [Schema0.Schema01.class](../../../paths/commonparamsubdir/get/parameters/parameter0/Schema0.md#schema01))
)
| +| Class | additionalProperties = [CommonparamsubdirGetadditionalProperties.class](#commonparamsubdirgetadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [CommonparamsubdirGetQueryParametersMap](#commonparamsubdirgetqueryparametersmap) | validate([Map<?, ?>](#commonparamsubdirgetqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [CommonparamsubdirGetQueryParameters1BoxedMap](#commonparamsubdirgetqueryparameters1boxedmap) | validateAndBox([Map<?, ?>](#commonparamsubdirgetqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [CommonparamsubdirGetQueryParameters1Boxed](#commonparamsubdirgetqueryparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## CommonparamsubdirGetQueryParametersMapBuilder +public class CommonparamsubdirGetQueryParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirGetQueryParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | +| [CommonparamsubdirGetQueryParametersMapBuilder](#commonparamsubdirgetqueryparametersmapbuilder) | searchStr(String value) | + +## CommonparamsubdirGetQueryParametersMap +public static class CommonparamsubdirGetQueryParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [CommonparamsubdirGetQueryParametersMap](#commonparamsubdirgetqueryparametersmap) | of([Map](#commonparamsubdirgetqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| String | searchStr()
[optional] | + +## CommonparamsubdirGetadditionalPropertiesBoxed +public sealed interface CommonparamsubdirGetadditionalPropertiesBoxed
+permits
+[CommonparamsubdirGetadditionalPropertiesBoxedVoid](#commonparamsubdirgetadditionalpropertiesboxedvoid), +[CommonparamsubdirGetadditionalPropertiesBoxedBoolean](#commonparamsubdirgetadditionalpropertiesboxedboolean), +[CommonparamsubdirGetadditionalPropertiesBoxedNumber](#commonparamsubdirgetadditionalpropertiesboxednumber), +[CommonparamsubdirGetadditionalPropertiesBoxedString](#commonparamsubdirgetadditionalpropertiesboxedstring), +[CommonparamsubdirGetadditionalPropertiesBoxedList](#commonparamsubdirgetadditionalpropertiesboxedlist), +[CommonparamsubdirGetadditionalPropertiesBoxedMap](#commonparamsubdirgetadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## CommonparamsubdirGetadditionalPropertiesBoxedVoid +public record CommonparamsubdirGetadditionalPropertiesBoxedVoid
+implements [CommonparamsubdirGetadditionalPropertiesBoxed](#commonparamsubdirgetadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirGetadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirGetadditionalPropertiesBoxedBoolean +public record CommonparamsubdirGetadditionalPropertiesBoxedBoolean
+implements [CommonparamsubdirGetadditionalPropertiesBoxed](#commonparamsubdirgetadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirGetadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirGetadditionalPropertiesBoxedNumber +public record CommonparamsubdirGetadditionalPropertiesBoxedNumber
+implements [CommonparamsubdirGetadditionalPropertiesBoxed](#commonparamsubdirgetadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirGetadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirGetadditionalPropertiesBoxedString +public record CommonparamsubdirGetadditionalPropertiesBoxedString
+implements [CommonparamsubdirGetadditionalPropertiesBoxed](#commonparamsubdirgetadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirGetadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirGetadditionalPropertiesBoxedList +public record CommonparamsubdirGetadditionalPropertiesBoxedList
+implements [CommonparamsubdirGetadditionalPropertiesBoxed](#commonparamsubdirgetadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirGetadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirGetadditionalPropertiesBoxedMap +public record CommonparamsubdirGetadditionalPropertiesBoxedMap
+implements [CommonparamsubdirGetadditionalPropertiesBoxed](#commonparamsubdirgetadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirGetadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirGetadditionalProperties +public static class CommonparamsubdirGetadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/get/CommonparamsubdirGetResponses.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/get/CommonparamsubdirGetResponses.md new file mode 100644 index 00000000000..1341c9284d9 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/commonparamsubdir/get/CommonparamsubdirGetResponses.md @@ -0,0 +1,29 @@ +# CommonparamsubdirGetResponses + +public class CommonparamsubdirGetResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointCommonparamsubdirGetCode200Response](#endpointcommonparamsubdirgetcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointCommonparamsubdirGetCode200Response](#endpointcommonparamsubdirgetcode200response) + +a sealed interface that stores endpoint responses + +## EndpointCommonparamsubdirGetCode200Response +public record EndpointCommonparamsubdirGetCode200Response( + HttpResponse response, + Void body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/get/PathParameters.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/get/PathParameters.md deleted file mode 100644 index bb7ece676f5..00000000000 --- a/samples/client/petstore/java/docs/paths/commonparamsubdir/get/PathParameters.md +++ /dev/null @@ -1,269 +0,0 @@ -# PathParameters -public class PathParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [PathParameters.PathParameters1Boxed](#pathparameters1boxed)
sealed interface for validated payloads | -| record | [PathParameters.PathParameters1BoxedMap](#pathparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.PathParameters1](#pathparameters1)
schema class | -| static class | [PathParameters.PathParametersMapBuilder](#pathparametersmapbuilder)
builder for Map payloads | -| static class | [PathParameters.PathParametersMap](#pathparametersmap)
output class for Map payloads | -| sealed interface | [PathParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [PathParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [PathParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [PathParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [PathParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [PathParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [PathParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.AdditionalProperties](#additionalproperties)
schema class | - -## PathParameters1Boxed -public sealed interface PathParameters1Boxed
-permits
-[PathParameters1BoxedMap](#pathparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## PathParameters1BoxedMap -public record PathParameters1BoxedMap
-implements [PathParameters1Boxed](#pathparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParameters1BoxedMap([PathParametersMap](#pathparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## PathParameters1 -public static class PathParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.commonparamsubdir.get.PathParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -PathParameters.PathParametersMap validatedPayload = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .subDir("a") - - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("subDir", [RouteParamSchema0.RouteParamSchema01.class](../../../paths/commonparamsubdir/parameters/routeparameter0/RouteParamSchema0.md#routeparamschema01))
)
| -| Set | required = Set.of(
    "subDir"
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | validate([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1BoxedMap](#pathparameters1boxedmap) | validateAndBox([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1Boxed](#pathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## PathParametersMap0Builder -public class PathParametersMap0Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | - -## PathParametersMapBuilder -public class PathParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap0Builder](#pathparametersmap0builder) | subDir(String value) | -| [PathParametersMap0Builder](#pathparametersmap0builder) | subDir([RouteParamSchema0.StringRouteParamSchemaEnums0](../../../paths/commonparamsubdir/parameters/routeparameter0/RouteParamSchema0.md#stringrouteparamschemaenums0) value) | - -## PathParametersMap -public static class PathParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [PathParametersMap](#pathparametersmap) | of([Map](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| String | subDir()
| - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/get/QueryParameters.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/get/QueryParameters.md deleted file mode 100644 index b7a7775bc7d..00000000000 --- a/samples/client/petstore/java/docs/paths/commonparamsubdir/get/QueryParameters.md +++ /dev/null @@ -1,252 +0,0 @@ -# QueryParameters -public class QueryParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [QueryParameters.QueryParameters1Boxed](#queryparameters1boxed)
sealed interface for validated payloads | -| record | [QueryParameters.QueryParameters1BoxedMap](#queryparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [QueryParameters.QueryParameters1](#queryparameters1)
schema class | -| static class | [QueryParameters.QueryParametersMapBuilder](#queryparametersmapbuilder)
builder for Map payloads | -| static class | [QueryParameters.QueryParametersMap](#queryparametersmap)
output class for Map payloads | -| sealed interface | [QueryParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [QueryParameters.AdditionalProperties](#additionalproperties)
schema class | - -## QueryParameters1Boxed -public sealed interface QueryParameters1Boxed
-permits
-[QueryParameters1BoxedMap](#queryparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## QueryParameters1BoxedMap -public record QueryParameters1BoxedMap
-implements [QueryParameters1Boxed](#queryparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParameters1BoxedMap([QueryParametersMap](#queryparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap](#queryparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## QueryParameters1 -public static class QueryParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.commonparamsubdir.get.QueryParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -QueryParameters.QueryParametersMap validatedPayload = - QueryParameters.QueryParameters1.validate( - new QueryParameters.QueryParametersMapBuilder() - .searchStr("a") - - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("searchStr", [Schema0.Schema01.class](../../../paths/commonparamsubdir/get/parameters/parameter0/Schema0.md#schema01))
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap](#queryparametersmap) | validate([Map<?, ?>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [QueryParameters1BoxedMap](#queryparameters1boxedmap) | validateAndBox([Map<?, ?>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [QueryParameters1Boxed](#queryparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## QueryParametersMapBuilder -public class QueryParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | searchStr(String value) | - -## QueryParametersMap -public static class QueryParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [QueryParametersMap](#queryparametersmap) | of([Map](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| String | searchStr()
[optional] | - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/get/Responses.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/get/Responses.md deleted file mode 100644 index d4bf4fdb8f5..00000000000 --- a/samples/client/petstore/java/docs/paths/commonparamsubdir/get/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/get/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/get/responses/Code200Response.md deleted file mode 100644 index e89c75b2e12..00000000000 --- a/samples/client/petstore/java/docs/paths/commonparamsubdir/get/responses/Code200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# Code200Response - -public class Code200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) - -A class (extended from the $ref class) that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## Code200Response1 -public static class Code200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
- -a class that deserializes responses, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/get/responses/CommonparamsubdirGetCode200Response.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/get/responses/CommonparamsubdirGetCode200Response.md new file mode 100644 index 00000000000..11da3fc2681 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/commonparamsubdir/get/responses/CommonparamsubdirGetCode200Response.md @@ -0,0 +1,17 @@ +# CommonparamsubdirGetCode200Response + +public class CommonparamsubdirGetCode200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) + +A class (extended from the $ref class) that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [CommonparamsubdirGetCode200Response.CommonparamsubdirGetCode200Response1](#commonparamsubdirgetcode200response1)
class that deserializes responses | + +## CommonparamsubdirGetCode200Response1 +public static class CommonparamsubdirGetCode200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
+ +a class that deserializes responses, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/parameters/parameter0/PathParamSchema0.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/parameters/parameter0/PathParamSchema0.md deleted file mode 100644 index a862a707c04..00000000000 --- a/samples/client/petstore/java/docs/paths/commonparamsubdir/parameters/parameter0/PathParamSchema0.md +++ /dev/null @@ -1,96 +0,0 @@ -# PathParamSchema0 -public class PathParamSchema0
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- enum classes - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [PathParamSchema0.PathParamSchema01Boxed](#pathparamschema01boxed)
sealed interface for validated payloads | -| record | [PathParamSchema0.PathParamSchema01BoxedString](#pathparamschema01boxedstring)
boxed class to store validated String payloads | -| static class | [PathParamSchema0.PathParamSchema01](#pathparamschema01)
schema class | -| enum | [PathParamSchema0.StringPathParamSchemaEnums0](#stringpathparamschemaenums0)
String enum | - -## PathParamSchema01Boxed -public sealed interface PathParamSchema01Boxed
-permits
-[PathParamSchema01BoxedString](#pathparamschema01boxedstring) - -sealed interface that stores validated payloads using boxed classes - -## PathParamSchema01BoxedString -public record PathParamSchema01BoxedString
-implements [PathParamSchema01Boxed](#pathparamschema01boxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParamSchema01BoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## PathParamSchema01 -public static class PathParamSchema01
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.commonparamsubdir.parameters.parameter0.PathParamSchema0; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); - -// String validation -String validatedPayload = PathParamSchema0.PathParamSchema01.validate( - "a", - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(
    String.class
)
| -| Set | enumValues = SetMaker.makeSet(
    "a",
    "b"
)
| - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | validate(String arg, SchemaConfiguration configuration) | -| String | validate([StringPathParamSchemaEnums0](#stringpathparamschemaenums0) arg, SchemaConfiguration configuration) | -| [PathParamSchema01BoxedString](#pathparamschema01boxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | -| [PathParamSchema01Boxed](#pathparamschema01boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## StringPathParamSchemaEnums0 -public enum StringPathParamSchemaEnums0
-extends `Enum` - -A class that stores String enum values - -### Enum Constant Summary -| Enum Constant | Description | -| ------------- | ----------- | -| A | value = "a" | -| B | value = "b" | diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/post/CommonparamsubdirPostHeaderParameters.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/post/CommonparamsubdirPostHeaderParameters.md new file mode 100644 index 00000000000..8e6e4dc7616 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/commonparamsubdir/post/CommonparamsubdirPostHeaderParameters.md @@ -0,0 +1,252 @@ +# CommonparamsubdirPostHeaderParameters +public class CommonparamsubdirPostHeaderParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [CommonparamsubdirPostHeaderParameters.CommonparamsubdirPostHeaderParameters1Boxed](#commonparamsubdirpostheaderparameters1boxed)
sealed interface for validated payloads | +| record | [CommonparamsubdirPostHeaderParameters.CommonparamsubdirPostHeaderParameters1BoxedMap](#commonparamsubdirpostheaderparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [CommonparamsubdirPostHeaderParameters.CommonparamsubdirPostHeaderParameters1](#commonparamsubdirpostheaderparameters1)
schema class | +| static class | [CommonparamsubdirPostHeaderParameters.CommonparamsubdirPostHeaderParametersMapBuilder](#commonparamsubdirpostheaderparametersmapbuilder)
builder for Map payloads | +| static class | [CommonparamsubdirPostHeaderParameters.CommonparamsubdirPostHeaderParametersMap](#commonparamsubdirpostheaderparametersmap)
output class for Map payloads | +| sealed interface | [CommonparamsubdirPostHeaderParameters.CommonparamsubdirPostadditionalPropertiesBoxed](#commonparamsubdirpostadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [CommonparamsubdirPostHeaderParameters.CommonparamsubdirPostadditionalPropertiesBoxedVoid](#commonparamsubdirpostadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [CommonparamsubdirPostHeaderParameters.CommonparamsubdirPostadditionalPropertiesBoxedBoolean](#commonparamsubdirpostadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [CommonparamsubdirPostHeaderParameters.CommonparamsubdirPostadditionalPropertiesBoxedNumber](#commonparamsubdirpostadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [CommonparamsubdirPostHeaderParameters.CommonparamsubdirPostadditionalPropertiesBoxedString](#commonparamsubdirpostadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [CommonparamsubdirPostHeaderParameters.CommonparamsubdirPostadditionalPropertiesBoxedList](#commonparamsubdirpostadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [CommonparamsubdirPostHeaderParameters.CommonparamsubdirPostadditionalPropertiesBoxedMap](#commonparamsubdirpostadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [CommonparamsubdirPostHeaderParameters.CommonparamsubdirPostadditionalProperties](#commonparamsubdirpostadditionalproperties)
schema class | + +## CommonparamsubdirPostHeaderParameters1Boxed +public sealed interface CommonparamsubdirPostHeaderParameters1Boxed
+permits
+[CommonparamsubdirPostHeaderParameters1BoxedMap](#commonparamsubdirpostheaderparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## CommonparamsubdirPostHeaderParameters1BoxedMap +public record CommonparamsubdirPostHeaderParameters1BoxedMap
+implements [CommonparamsubdirPostHeaderParameters1Boxed](#commonparamsubdirpostheaderparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirPostHeaderParameters1BoxedMap([CommonparamsubdirPostHeaderParametersMap](#commonparamsubdirpostheaderparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [CommonparamsubdirPostHeaderParametersMap](#commonparamsubdirpostheaderparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirPostHeaderParameters1 +public static class CommonparamsubdirPostHeaderParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.commonparamsubdir.post.CommonparamsubdirPostHeaderParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +CommonparamsubdirPostHeaderParameters.CommonparamsubdirPostHeaderParametersMap validatedPayload = + CommonparamsubdirPostHeaderParameters.CommonparamsubdirPostHeaderParameters1.validate( + new CommonparamsubdirPostHeaderParameters.CommonparamsubdirPostHeaderParametersMapBuilder() + .someHeader("a") + + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("someHeader", [Schema0.Schema01.class](../../../paths/commonparamsubdir/post/parameters/parameter0/Schema0.md#schema01))
)
| +| Class | additionalProperties = [CommonparamsubdirPostadditionalProperties.class](#commonparamsubdirpostadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [CommonparamsubdirPostHeaderParametersMap](#commonparamsubdirpostheaderparametersmap) | validate([Map<?, ?>](#commonparamsubdirpostheaderparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [CommonparamsubdirPostHeaderParameters1BoxedMap](#commonparamsubdirpostheaderparameters1boxedmap) | validateAndBox([Map<?, ?>](#commonparamsubdirpostheaderparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [CommonparamsubdirPostHeaderParameters1Boxed](#commonparamsubdirpostheaderparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## CommonparamsubdirPostHeaderParametersMapBuilder +public class CommonparamsubdirPostHeaderParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirPostHeaderParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | +| [CommonparamsubdirPostHeaderParametersMapBuilder](#commonparamsubdirpostheaderparametersmapbuilder) | someHeader(String value) | + +## CommonparamsubdirPostHeaderParametersMap +public static class CommonparamsubdirPostHeaderParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [CommonparamsubdirPostHeaderParametersMap](#commonparamsubdirpostheaderparametersmap) | of([Map](#commonparamsubdirpostheaderparametersmapbuilder) arg, SchemaConfiguration configuration) | +| String | someHeader()
[optional] | + +## CommonparamsubdirPostadditionalPropertiesBoxed +public sealed interface CommonparamsubdirPostadditionalPropertiesBoxed
+permits
+[CommonparamsubdirPostadditionalPropertiesBoxedVoid](#commonparamsubdirpostadditionalpropertiesboxedvoid), +[CommonparamsubdirPostadditionalPropertiesBoxedBoolean](#commonparamsubdirpostadditionalpropertiesboxedboolean), +[CommonparamsubdirPostadditionalPropertiesBoxedNumber](#commonparamsubdirpostadditionalpropertiesboxednumber), +[CommonparamsubdirPostadditionalPropertiesBoxedString](#commonparamsubdirpostadditionalpropertiesboxedstring), +[CommonparamsubdirPostadditionalPropertiesBoxedList](#commonparamsubdirpostadditionalpropertiesboxedlist), +[CommonparamsubdirPostadditionalPropertiesBoxedMap](#commonparamsubdirpostadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## CommonparamsubdirPostadditionalPropertiesBoxedVoid +public record CommonparamsubdirPostadditionalPropertiesBoxedVoid
+implements [CommonparamsubdirPostadditionalPropertiesBoxed](#commonparamsubdirpostadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirPostadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirPostadditionalPropertiesBoxedBoolean +public record CommonparamsubdirPostadditionalPropertiesBoxedBoolean
+implements [CommonparamsubdirPostadditionalPropertiesBoxed](#commonparamsubdirpostadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirPostadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirPostadditionalPropertiesBoxedNumber +public record CommonparamsubdirPostadditionalPropertiesBoxedNumber
+implements [CommonparamsubdirPostadditionalPropertiesBoxed](#commonparamsubdirpostadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirPostadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirPostadditionalPropertiesBoxedString +public record CommonparamsubdirPostadditionalPropertiesBoxedString
+implements [CommonparamsubdirPostadditionalPropertiesBoxed](#commonparamsubdirpostadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirPostadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirPostadditionalPropertiesBoxedList +public record CommonparamsubdirPostadditionalPropertiesBoxedList
+implements [CommonparamsubdirPostadditionalPropertiesBoxed](#commonparamsubdirpostadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirPostadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirPostadditionalPropertiesBoxedMap +public record CommonparamsubdirPostadditionalPropertiesBoxedMap
+implements [CommonparamsubdirPostadditionalPropertiesBoxed](#commonparamsubdirpostadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirPostadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirPostadditionalProperties +public static class CommonparamsubdirPostadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/post/CommonparamsubdirPostPathParameters.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/post/CommonparamsubdirPostPathParameters.md new file mode 100644 index 00000000000..7693f93a48b --- /dev/null +++ b/samples/client/petstore/java/docs/paths/commonparamsubdir/post/CommonparamsubdirPostPathParameters.md @@ -0,0 +1,269 @@ +# CommonparamsubdirPostPathParameters +public class CommonparamsubdirPostPathParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [CommonparamsubdirPostPathParameters.CommonparamsubdirPostPathParameters1Boxed](#commonparamsubdirpostpathparameters1boxed)
sealed interface for validated payloads | +| record | [CommonparamsubdirPostPathParameters.CommonparamsubdirPostPathParameters1BoxedMap](#commonparamsubdirpostpathparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [CommonparamsubdirPostPathParameters.CommonparamsubdirPostPathParameters1](#commonparamsubdirpostpathparameters1)
schema class | +| static class | [CommonparamsubdirPostPathParameters.CommonparamsubdirPostPathParametersMapBuilder](#commonparamsubdirpostpathparametersmapbuilder)
builder for Map payloads | +| static class | [CommonparamsubdirPostPathParameters.CommonparamsubdirPostPathParametersMap](#commonparamsubdirpostpathparametersmap)
output class for Map payloads | +| sealed interface | [CommonparamsubdirPostPathParameters.CommonparamsubdirPostadditionalPropertiesBoxed](#commonparamsubdirpostadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [CommonparamsubdirPostPathParameters.CommonparamsubdirPostadditionalPropertiesBoxedVoid](#commonparamsubdirpostadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [CommonparamsubdirPostPathParameters.CommonparamsubdirPostadditionalPropertiesBoxedBoolean](#commonparamsubdirpostadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [CommonparamsubdirPostPathParameters.CommonparamsubdirPostadditionalPropertiesBoxedNumber](#commonparamsubdirpostadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [CommonparamsubdirPostPathParameters.CommonparamsubdirPostadditionalPropertiesBoxedString](#commonparamsubdirpostadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [CommonparamsubdirPostPathParameters.CommonparamsubdirPostadditionalPropertiesBoxedList](#commonparamsubdirpostadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [CommonparamsubdirPostPathParameters.CommonparamsubdirPostadditionalPropertiesBoxedMap](#commonparamsubdirpostadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [CommonparamsubdirPostPathParameters.CommonparamsubdirPostadditionalProperties](#commonparamsubdirpostadditionalproperties)
schema class | + +## CommonparamsubdirPostPathParameters1Boxed +public sealed interface CommonparamsubdirPostPathParameters1Boxed
+permits
+[CommonparamsubdirPostPathParameters1BoxedMap](#commonparamsubdirpostpathparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## CommonparamsubdirPostPathParameters1BoxedMap +public record CommonparamsubdirPostPathParameters1BoxedMap
+implements [CommonparamsubdirPostPathParameters1Boxed](#commonparamsubdirpostpathparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirPostPathParameters1BoxedMap([CommonparamsubdirPostPathParametersMap](#commonparamsubdirpostpathparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [CommonparamsubdirPostPathParametersMap](#commonparamsubdirpostpathparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirPostPathParameters1 +public static class CommonparamsubdirPostPathParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.commonparamsubdir.post.CommonparamsubdirPostPathParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +CommonparamsubdirPostPathParameters.CommonparamsubdirPostPathParametersMap validatedPayload = + CommonparamsubdirPostPathParameters.CommonparamsubdirPostPathParameters1.validate( + new CommonparamsubdirPostPathParameters.CommonparamsubdirPostPathParametersMapBuilder() + .subDir("a") + + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("subDir", [RouteParamSchema0.RouteParamSchema01.class](../../../paths/commonparamsubdir/parameters/routeparameter0/RouteParamSchema0.md#routeparamschema01))
)
| +| Set | required = Set.of(
    "subDir"
)
| +| Class | additionalProperties = [CommonparamsubdirPostadditionalProperties.class](#commonparamsubdirpostadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [CommonparamsubdirPostPathParametersMap](#commonparamsubdirpostpathparametersmap) | validate([Map<?, ?>](#commonparamsubdirpostpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [CommonparamsubdirPostPathParameters1BoxedMap](#commonparamsubdirpostpathparameters1boxedmap) | validateAndBox([Map<?, ?>](#commonparamsubdirpostpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [CommonparamsubdirPostPathParameters1Boxed](#commonparamsubdirpostpathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## CommonparamsubdirPostPathParametersMap0Builder +public class CommonparamsubdirPostPathParametersMap0Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirPostPathParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | + +## CommonparamsubdirPostPathParametersMapBuilder +public class CommonparamsubdirPostPathParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirPostPathParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [CommonparamsubdirPostPathParametersMap0Builder](#commonparamsubdirpostpathparametersmap0builder) | subDir(String value) | +| [CommonparamsubdirPostPathParametersMap0Builder](#commonparamsubdirpostpathparametersmap0builder) | subDir([RouteParamSchema0.StringRouteParamSchemaEnums0](../../../paths/commonparamsubdir/parameters/routeparameter0/RouteParamSchema0.md#stringrouteparamschemaenums0) value) | + +## CommonparamsubdirPostPathParametersMap +public static class CommonparamsubdirPostPathParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [CommonparamsubdirPostPathParametersMap](#commonparamsubdirpostpathparametersmap) | of([Map](#commonparamsubdirpostpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| String | subDir()
| + +## CommonparamsubdirPostadditionalPropertiesBoxed +public sealed interface CommonparamsubdirPostadditionalPropertiesBoxed
+permits
+[CommonparamsubdirPostadditionalPropertiesBoxedVoid](#commonparamsubdirpostadditionalpropertiesboxedvoid), +[CommonparamsubdirPostadditionalPropertiesBoxedBoolean](#commonparamsubdirpostadditionalpropertiesboxedboolean), +[CommonparamsubdirPostadditionalPropertiesBoxedNumber](#commonparamsubdirpostadditionalpropertiesboxednumber), +[CommonparamsubdirPostadditionalPropertiesBoxedString](#commonparamsubdirpostadditionalpropertiesboxedstring), +[CommonparamsubdirPostadditionalPropertiesBoxedList](#commonparamsubdirpostadditionalpropertiesboxedlist), +[CommonparamsubdirPostadditionalPropertiesBoxedMap](#commonparamsubdirpostadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## CommonparamsubdirPostadditionalPropertiesBoxedVoid +public record CommonparamsubdirPostadditionalPropertiesBoxedVoid
+implements [CommonparamsubdirPostadditionalPropertiesBoxed](#commonparamsubdirpostadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirPostadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirPostadditionalPropertiesBoxedBoolean +public record CommonparamsubdirPostadditionalPropertiesBoxedBoolean
+implements [CommonparamsubdirPostadditionalPropertiesBoxed](#commonparamsubdirpostadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirPostadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirPostadditionalPropertiesBoxedNumber +public record CommonparamsubdirPostadditionalPropertiesBoxedNumber
+implements [CommonparamsubdirPostadditionalPropertiesBoxed](#commonparamsubdirpostadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirPostadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirPostadditionalPropertiesBoxedString +public record CommonparamsubdirPostadditionalPropertiesBoxedString
+implements [CommonparamsubdirPostadditionalPropertiesBoxed](#commonparamsubdirpostadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirPostadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirPostadditionalPropertiesBoxedList +public record CommonparamsubdirPostadditionalPropertiesBoxedList
+implements [CommonparamsubdirPostadditionalPropertiesBoxed](#commonparamsubdirpostadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirPostadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirPostadditionalPropertiesBoxedMap +public record CommonparamsubdirPostadditionalPropertiesBoxedMap
+implements [CommonparamsubdirPostadditionalPropertiesBoxed](#commonparamsubdirpostadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| CommonparamsubdirPostadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## CommonparamsubdirPostadditionalProperties +public static class CommonparamsubdirPostadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/post/CommonparamsubdirPostResponses.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/post/CommonparamsubdirPostResponses.md new file mode 100644 index 00000000000..2f181986105 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/commonparamsubdir/post/CommonparamsubdirPostResponses.md @@ -0,0 +1,29 @@ +# CommonparamsubdirPostResponses + +public class CommonparamsubdirPostResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointCommonparamsubdirPostCode200Response](#endpointcommonparamsubdirpostcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointCommonparamsubdirPostCode200Response](#endpointcommonparamsubdirpostcode200response) + +a sealed interface that stores endpoint responses + +## EndpointCommonparamsubdirPostCode200Response +public record EndpointCommonparamsubdirPostCode200Response( + HttpResponse response, + Void body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/post/HeaderParameters.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/post/HeaderParameters.md deleted file mode 100644 index ee5f95055d9..00000000000 --- a/samples/client/petstore/java/docs/paths/commonparamsubdir/post/HeaderParameters.md +++ /dev/null @@ -1,252 +0,0 @@ -# HeaderParameters -public class HeaderParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [HeaderParameters.HeaderParameters1Boxed](#headerparameters1boxed)
sealed interface for validated payloads | -| record | [HeaderParameters.HeaderParameters1BoxedMap](#headerparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [HeaderParameters.HeaderParameters1](#headerparameters1)
schema class | -| static class | [HeaderParameters.HeaderParametersMapBuilder](#headerparametersmapbuilder)
builder for Map payloads | -| static class | [HeaderParameters.HeaderParametersMap](#headerparametersmap)
output class for Map payloads | -| sealed interface | [HeaderParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [HeaderParameters.AdditionalProperties](#additionalproperties)
schema class | - -## HeaderParameters1Boxed -public sealed interface HeaderParameters1Boxed
-permits
-[HeaderParameters1BoxedMap](#headerparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## HeaderParameters1BoxedMap -public record HeaderParameters1BoxedMap
-implements [HeaderParameters1Boxed](#headerparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| HeaderParameters1BoxedMap([HeaderParametersMap](#headerparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [HeaderParametersMap](#headerparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## HeaderParameters1 -public static class HeaderParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.commonparamsubdir.post.HeaderParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -HeaderParameters.HeaderParametersMap validatedPayload = - HeaderParameters.HeaderParameters1.validate( - new HeaderParameters.HeaderParametersMapBuilder() - .someHeader("a") - - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("someHeader", [Schema0.Schema01.class](../../../paths/commonparamsubdir/post/parameters/parameter0/Schema0.md#schema01))
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [HeaderParametersMap](#headerparametersmap) | validate([Map<?, ?>](#headerparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [HeaderParameters1BoxedMap](#headerparameters1boxedmap) | validateAndBox([Map<?, ?>](#headerparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [HeaderParameters1Boxed](#headerparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## HeaderParametersMapBuilder -public class HeaderParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| HeaderParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | -| [HeaderParametersMapBuilder](#headerparametersmapbuilder) | someHeader(String value) | - -## HeaderParametersMap -public static class HeaderParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [HeaderParametersMap](#headerparametersmap) | of([Map](#headerparametersmapbuilder) arg, SchemaConfiguration configuration) | -| String | someHeader()
[optional] | - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/post/PathParameters.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/post/PathParameters.md deleted file mode 100644 index 241d933e5b7..00000000000 --- a/samples/client/petstore/java/docs/paths/commonparamsubdir/post/PathParameters.md +++ /dev/null @@ -1,269 +0,0 @@ -# PathParameters -public class PathParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [PathParameters.PathParameters1Boxed](#pathparameters1boxed)
sealed interface for validated payloads | -| record | [PathParameters.PathParameters1BoxedMap](#pathparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.PathParameters1](#pathparameters1)
schema class | -| static class | [PathParameters.PathParametersMapBuilder](#pathparametersmapbuilder)
builder for Map payloads | -| static class | [PathParameters.PathParametersMap](#pathparametersmap)
output class for Map payloads | -| sealed interface | [PathParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [PathParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [PathParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [PathParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [PathParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [PathParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [PathParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.AdditionalProperties](#additionalproperties)
schema class | - -## PathParameters1Boxed -public sealed interface PathParameters1Boxed
-permits
-[PathParameters1BoxedMap](#pathparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## PathParameters1BoxedMap -public record PathParameters1BoxedMap
-implements [PathParameters1Boxed](#pathparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParameters1BoxedMap([PathParametersMap](#pathparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## PathParameters1 -public static class PathParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.commonparamsubdir.post.PathParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -PathParameters.PathParametersMap validatedPayload = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .subDir("a") - - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("subDir", [RouteParamSchema0.RouteParamSchema01.class](../../../paths/commonparamsubdir/parameters/routeparameter0/RouteParamSchema0.md#routeparamschema01))
)
| -| Set | required = Set.of(
    "subDir"
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | validate([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1BoxedMap](#pathparameters1boxedmap) | validateAndBox([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1Boxed](#pathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## PathParametersMap0Builder -public class PathParametersMap0Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | - -## PathParametersMapBuilder -public class PathParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap0Builder](#pathparametersmap0builder) | subDir(String value) | -| [PathParametersMap0Builder](#pathparametersmap0builder) | subDir([RouteParamSchema0.StringRouteParamSchemaEnums0](../../../paths/commonparamsubdir/parameters/routeparameter0/RouteParamSchema0.md#stringrouteparamschemaenums0) value) | - -## PathParametersMap -public static class PathParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [PathParametersMap](#pathparametersmap) | of([Map](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| String | subDir()
| - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/post/Responses.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/post/Responses.md deleted file mode 100644 index d4bf4fdb8f5..00000000000 --- a/samples/client/petstore/java/docs/paths/commonparamsubdir/post/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/post/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/post/responses/Code200Response.md deleted file mode 100644 index e89c75b2e12..00000000000 --- a/samples/client/petstore/java/docs/paths/commonparamsubdir/post/responses/Code200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# Code200Response - -public class Code200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) - -A class (extended from the $ref class) that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## Code200Response1 -public static class Code200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
- -a class that deserializes responses, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/commonparamsubdir/post/responses/CommonparamsubdirPostCode200Response.md b/samples/client/petstore/java/docs/paths/commonparamsubdir/post/responses/CommonparamsubdirPostCode200Response.md new file mode 100644 index 00000000000..56ce18a3786 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/commonparamsubdir/post/responses/CommonparamsubdirPostCode200Response.md @@ -0,0 +1,17 @@ +# CommonparamsubdirPostCode200Response + +public class CommonparamsubdirPostCode200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) + +A class (extended from the $ref class) that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [CommonparamsubdirPostCode200Response.CommonparamsubdirPostCode200Response1](#commonparamsubdirpostcode200response1)
class that deserializes responses | + +## CommonparamsubdirPostCode200Response1 +public static class CommonparamsubdirPostCode200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
+ +a class that deserializes responses, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/fake/Delete.md b/samples/client/petstore/java/docs/paths/fake/Delete.md deleted file mode 100644 index 38085cff27f..00000000000 --- a/samples/client/petstore/java/docs/paths/fake/Delete.md +++ /dev/null @@ -1,241 +0,0 @@ -# Delete - -public class Delete - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Delete1](#delete1)
The class that has a delete method to call the endpoint | -| static class | [DeleteRequest](#deleterequest)
The final request inputs class | -| static class | [DeleteNullableRequest](#deletenullablerequest)
The initial request inputs class | -| static class | [Delete00RequestBuilder](#delete00requestbuilder)
A builder for the request input class | -| static class | [Delete01RequestBuilder](#delete01requestbuilder)
A builder for the request input class | -| static class | [Delete10RequestBuilder](#delete10requestbuilder)
A builder for the request input class | -| static class | [DeleteRequestBuilder](#deleterequestbuilder)
A builder for the request input class | - -## Delete1 -public static class Delete1 extends ApiClient.ApiClient1 implements DeleteOperation
- -a class that allows one to call the endpoint using a method named delete - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fake.delete.FakeDeleteSecurityInfo; -import org.openapijsonschematools.client.paths.fake.delete.HeaderParameters; -import org.openapijsonschematools.client.paths.fake.delete.QueryParameters; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.securityschemes.SecurityScheme; -import org.openapijsonschematools.client.components.securityschemes.BearerTest; -import org.openapijsonschematools.client.paths.fake.delete.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fake.Delete; -import org.openapijsonschematools.client.paths.fake.delete.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -List securitySchemes = new ArrayList(); -securitySchemes.add( - new BearerTest("someAccessToken"); -); -ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() - .fakeDeleteSecurityRequirementObject0SecurityIndex(FakeDeleteSecurityRequirementObject0.SecurityIndex.SECURITY_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - securitySchemes, - securityIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Delete.Delete1 apiClient = new Delete.Delete1(apiConfiguration, schemaConfiguration); - - -// Map validation -HeaderParameters.HeaderParametersMap headerParameters = - HeaderParameters.HeaderParameters1.validate( - new HeaderParameters.HeaderParametersMapBuilder() - .required_boolean_group("true") - - .boolean_group("true") - - .build(), - schemaConfiguration -); - -// Map validation -QueryParameters.QueryParametersMap queryParameters = - QueryParameters.QueryParameters1.validate( - new QueryParameters.QueryParametersMapBuilder() - .required_int64_group(1L) - - .required_string_group("a") - - .int64_group(1L) - - .string_group("a") - - .build(), - schemaConfiguration -); - -var request = new DeleteRequestBuilder() - .headerParameters(headerParameters) - .queryParameters(queryParameters) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.delete(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Delete1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fake/delete/Responses.md#endpointresponse) | delete([DeleteRequest](#deleterequest) request) | - -## DeleteRequest -public static class DeleteRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [HeaderParameters.HeaderParametersMap](../../paths/fake/delete/HeaderParameters.md#headerparametersmap) | headerParameters | -| [QueryParameters.QueryParametersMap](../../paths/fake/delete/QueryParameters.md#queryparametersmap) | queryParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| [FakeDeleteSecurityInfo.@Nullable SecurityIndex](../../paths/fake/delete/FakeDeleteSecurityInfo.md#securityindex) | securityIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## DeleteNullableRequest -public static class DeleteNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [HeaderParameters.@Nullable HeaderParametersMap](../../paths/fake/delete/HeaderParameters.md#headerparametersmap) | headerParameters | -| [QueryParameters.@Nullable QueryParametersMap](../../paths/fake/delete/QueryParameters.md#queryparametersmap) | queryParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| [FakeDeleteSecurityInfo.@Nullable SecurityIndex](../../paths/fake/delete/FakeDeleteSecurityInfo.md#securityindex) | securityIndex | -| @Nullable Duration | timeout | - -## Delete00RequestBuilder -public static class Delete00RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Delete00RequestBuilder(Delete00RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [DeleteRequest](#deleterequest) | build()
Returns the request input used to call an endpoint method | -| [Delete00RequestBuilder](#delete00requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Delete00RequestBuilder](#delete00requestbuilder) | securityIndex([FakeDeleteSecurityInfo.SecurityIndex](../../paths/fake/delete/FakeDeleteSecurityInfo.md#securityindex) securityIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Delete00RequestBuilder](#delete00requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## Delete01RequestBuilder -public static class Delete01RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Delete01RequestBuilder(Delete01RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Delete00RequestBuilder](#delete00requestbuilder) | queryParameters([QueryParametersQueryParametersMap](../../paths/fake/delete/QueryParameters.md#queryparametersmap) queryParameters)
sets the property | - -## Delete10RequestBuilder -public static class Delete10RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Delete10RequestBuilder(Delete10RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Delete00RequestBuilder](#delete00requestbuilder) | headerParameters([HeaderParametersHeaderParametersMap](../../paths/fake/delete/HeaderParameters.md#headerparametersmap) headerParameters)
sets the property | - -## DeleteRequestBuilder -public static class DeleteRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| DeleteRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Delete01RequestBuilder](#delete01requestbuilder) | headerParameters([HeaderParametersHeaderParametersMap](../../paths/fake/delete/HeaderParameters.md#headerparametersmap) headerParameters)
sets the property | -| [Delete10RequestBuilder](#delete10requestbuilder) | queryParameters([QueryParametersQueryParametersMap](../../paths/fake/delete/QueryParameters.md#queryparametersmap) queryParameters)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fake/FakeDelete.md b/samples/client/petstore/java/docs/paths/fake/FakeDelete.md new file mode 100644 index 00000000000..cef1ceb69ca --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fake/FakeDelete.md @@ -0,0 +1,252 @@ +# FakeDelete + +public class FakeDelete + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Delete](#delete)
The class that has a delete method to call the endpoint | +| interface | [GroupParametersOperation](#groupparametersoperation)
The interface that has a groupParameters method to call the endpoint | +| static class | [DeleteRequest](#deleterequest)
The final request inputs class | +| static class | [DeleteNullableRequest](#deletenullablerequest)
The initial request inputs class | +| static class | [Delete00RequestBuilder](#delete00requestbuilder)
A builder for the request input class | +| static class | [Delete01RequestBuilder](#delete01requestbuilder)
A builder for the request input class | +| static class | [Delete10RequestBuilder](#delete10requestbuilder)
A builder for the request input class | +| static class | [DeleteRequestBuilder](#deleterequestbuilder)
A builder for the request input class | + +## Delete +public static class Delete extends ApiClient.ApiClient1 implements DeleteOperation
+ +a class that allows one to call the endpoint using a method named delete + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fake.delete.FakeDeleteSecurityInfo; +import org.openapijsonschematools.client.paths.fake.delete.FakeDeleteHeaderParameters; +import org.openapijsonschematools.client.paths.fake.delete.FakeDeleteQueryParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.BearerTest; +import org.openapijsonschematools.client.paths.fake.delete.responses.FakeDeleteCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fake.FakeDelete; +import org.openapijsonschematools.client.paths.fake.delete.FakeDeleteResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new BearerTest("someAccessToken"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .fakeDeleteSecurityRequirementObject0SecurityIndex(FakeDeleteSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakeDelete.Delete apiClient = new FakeDelete.Delete(apiConfiguration, schemaConfiguration); + + +// Map validation +FakeDeleteHeaderParameters.FakeDeleteHeaderParametersMap headerParameters = + FakeDeleteHeaderParameters.FakeDeleteHeaderParameters1.validate( + new FakeDeleteHeaderParameters.FakeDeleteHeaderParametersMapBuilder() + .required_boolean_group("true") + + .boolean_group("true") + + .build(), + schemaConfiguration +); + +// Map validation +FakeDeleteQueryParameters.FakeDeleteQueryParametersMap queryParameters = + FakeDeleteQueryParameters.FakeDeleteQueryParameters1.validate( + new FakeDeleteQueryParameters.FakeDeleteQueryParametersMapBuilder() + .required_int64_group(1L) + + .required_string_group("a") + + .int64_group(1L) + + .string_group("a") + + .build(), + schemaConfiguration +); + +var request = new FakeDelete.DeleteRequestBuilder() + .headerParameters(headerParameters) + .queryParameters(queryParameters) + .build(); + +FakeDeleteResponses.EndpointResponse response; +try { + response = apiClient.delete(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeDeleteResponses.EndpointFakeDeleteCode200Response castResponse = (FakeDeleteResponses.EndpointFakeDeleteCode200Response) response; +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Delete(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeDeleteResponses.EndpointResponse](../../paths/fake/delete/FakeDeleteResponses.md#endpointresponse) | delete([DeleteRequest](#deleterequest) request) | + +## GroupParametersOperation +public interface GroupParametersOperation
+ +an interface that allows one to call the endpoint using a method named groupParameters by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeDeleteResponses.EndpointResponse](../../paths/fake/delete/FakeDeleteResponses.md#endpointresponse) | groupParameters([DeleteRequest](#deleterequest) request) | + +## DeleteRequest +public static class DeleteRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakeDeleteHeaderParameters.FakeDeleteHeaderParametersMap](../../paths/fake/delete/FakeDeleteHeaderParameters.md#fakedeleteheaderparametersmap) | headerParameters | +| [FakeDeleteQueryParameters.FakeDeleteQueryParametersMap](../../paths/fake/delete/FakeDeleteQueryParameters.md#fakedeletequeryparametersmap) | queryParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| [FakeDeleteSecurityInfo.@Nullable SecurityIndex](../../paths/fake/delete/FakeDeleteSecurityInfo.md#securityindex) | securityIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## DeleteNullableRequest +public static class DeleteNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakeDeleteHeaderParameters.@Nullable FakeDeleteHeaderParametersMap](../../paths/fake/delete/FakeDeleteHeaderParameters.md#fakedeleteheaderparametersmap) | headerParameters | +| [FakeDeleteQueryParameters.@Nullable FakeDeleteQueryParametersMap](../../paths/fake/delete/FakeDeleteQueryParameters.md#fakedeletequeryparametersmap) | queryParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| [FakeDeleteSecurityInfo.@Nullable SecurityIndex](../../paths/fake/delete/FakeDeleteSecurityInfo.md#securityindex) | securityIndex | +| @Nullable Duration | timeout | + +## Delete00RequestBuilder +public static class Delete00RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Delete00RequestBuilder(Delete00RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [DeleteRequest](#deleterequest) | build()
Returns the request input used to call an endpoint method | +| [Delete00RequestBuilder](#delete00requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Delete00RequestBuilder](#delete00requestbuilder) | securityIndex([FakeDeleteSecurityInfo.SecurityIndex](../../paths/fake/delete/FakeDeleteSecurityInfo.md#securityindex) securityIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Delete00RequestBuilder](#delete00requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## Delete01RequestBuilder +public static class Delete01RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Delete01RequestBuilder(Delete01RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Delete00RequestBuilder](#delete00requestbuilder) | queryParameters([FakeDeleteQueryParametersFakeDeleteQueryParametersMap](../../paths/fake/delete/FakeDeleteQueryParameters.md#fakedeletequeryparametersmap) queryParameters)
sets the property | + +## Delete10RequestBuilder +public static class Delete10RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Delete10RequestBuilder(Delete10RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Delete00RequestBuilder](#delete00requestbuilder) | headerParameters([FakeDeleteHeaderParametersFakeDeleteHeaderParametersMap](../../paths/fake/delete/FakeDeleteHeaderParameters.md#fakedeleteheaderparametersmap) headerParameters)
sets the property | + +## DeleteRequestBuilder +public static class DeleteRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| DeleteRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Delete01RequestBuilder](#delete01requestbuilder) | headerParameters([FakeDeleteHeaderParametersFakeDeleteHeaderParametersMap](../../paths/fake/delete/FakeDeleteHeaderParameters.md#fakedeleteheaderparametersmap) headerParameters)
sets the property | +| [Delete10RequestBuilder](#delete10requestbuilder) | queryParameters([FakeDeleteQueryParametersFakeDeleteQueryParametersMap](../../paths/fake/delete/FakeDeleteQueryParameters.md#fakedeletequeryparametersmap) queryParameters)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fake/FakeGet.md b/samples/client/petstore/java/docs/paths/fake/FakeGet.md new file mode 100644 index 00000000000..ed501ec1511 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fake/FakeGet.md @@ -0,0 +1,153 @@ +# FakeGet + +public class FakeGet + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Get](#get)
The class that has a get method to call the endpoint | +| interface | [EnumParametersOperation](#enumparametersoperation)
The interface that has a enumParameters method to call the endpoint | +| static class | [GetRequest](#getrequest)
The request inputs class | +| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | + +## Get +public static class Get extends ApiClient.ApiClient1 implements GetOperation
+ +a class that allows one to call the endpoint using a method named get + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fake.get.FakeGetRequestBody; +import org.openapijsonschematools.client.paths.fake.get.requestbody.content.applicationxwwwformurlencoded.ApplicationxwwwformurlencodedSchema; +import org.openapijsonschematools.client.paths.fake.get.FakeGetHeaderParameters; +import org.openapijsonschematools.client.paths.fake.get.FakeGetQueryParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fake.get.responses.FakeGetCode200Response; +import org.openapijsonschematools.client.paths.fake.get.responses.FakeGetCode404Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fake.FakeGet; +import org.openapijsonschematools.client.paths.fake.get.FakeGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakeGet.Get apiClient = new FakeGet.Get(apiConfiguration, schemaConfiguration); + + +var request = new FakeGet.GetRequestBuilder().build(); + +FakeGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (FakeGetCode404Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeGetResponses.EndpointFakeGetCode200Response castResponse = (FakeGetResponses.EndpointFakeGetCode200Response) response; +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeGetResponses.EndpointResponse](../../paths/fake/get/FakeGetResponses.md#endpointresponse) | get([GetRequest](#getrequest) request) | + +## EnumParametersOperation +public interface EnumParametersOperation
+ +an interface that allows one to call the endpoint using a method named enumParameters by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeGetResponses.EndpointResponse](../../paths/fake/get/FakeGetResponses.md#endpointresponse) | enumParameters([GetRequest](#getrequest) request) | + +## GetRequest +public static class GetRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakeGetRequestBody.@Nullable SealedRequestBody](../../paths/fake/get/FakeGetRequestBody.md#sealedrequestbody) | requestBody
optional | +| [FakeGetHeaderParameters.@Nullable FakeGetHeaderParametersMap](../../paths/fake/get/FakeGetHeaderParameters.md#fakegetheaderparametersmap) | headerParameters
optional | +| [FakeGetQueryParameters.@Nullable FakeGetQueryParametersMap](../../paths/fake/get/FakeGetQueryParameters.md#fakegetqueryparametersmap) | queryParameters
optional | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## GetRequestBuilder +public static class GetRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| GetRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | +| [GetRequestBuilder](#getrequestbuilder) | requestBody([FakeGetRequestBody.SealedRequestBody](../../paths/fake/get/FakeGetRequestBody.md#sealedrequestbody) requestBody)
sets the optional property | +| [GetRequestBuilder](#getrequestbuilder) | headerParameters([FakeGetHeaderParametersFakeGetHeaderParametersMap](../../paths/fake/get/FakeGetHeaderParameters.md#fakegetheaderparametersmap) headerParameters)
sets the optional property | +| [GetRequestBuilder](#getrequestbuilder) | queryParameters([FakeGetQueryParametersFakeGetQueryParametersMap](../../paths/fake/get/FakeGetQueryParameters.md#fakegetqueryparametersmap) queryParameters)
sets the optional property | +| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fake/FakePatch.md b/samples/client/petstore/java/docs/paths/fake/FakePatch.md new file mode 100644 index 00000000000..e15fb436dde --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fake/FakePatch.md @@ -0,0 +1,185 @@ +# FakePatch + +public class FakePatch + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Patch](#patch)
The class that has a patch method to call the endpoint | +| interface | [ClientModelOperation](#clientmodeloperation)
The interface that has a clientModel method to call the endpoint | +| static class | [PatchRequest](#patchrequest)
The final request inputs class | +| static class | [PatchNullableRequest](#patchnullablerequest)
The initial request inputs class | +| static class | [Patch0RequestBuilder](#patch0requestbuilder)
A builder for the request input class | +| static class | [PatchRequestBuilder](#patchrequestbuilder)
A builder for the request input class | + +## Patch +public static class Patch extends ApiClient.ApiClient1 implements PatchOperation
+ +a class that allows one to call the endpoint using a method named patch + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fake.patch.FakePatchRequestBody; +import org.openapijsonschematools.client.components.schemas.Client; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fake.patch.responses.FakePatchCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fake.FakePatch; +import org.openapijsonschematools.client.paths.fake.patch.FakePatchResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakePatch.Patch apiClient = new FakePatch.Patch(apiConfiguration, schemaConfiguration); + + +Client1BoxedMap requestBodyPayload = + Client.Client1.validateAndBox( + new Client.ClientMapBuilder1() + .client("a") + + .build(), + schemaConfiguration +); +FakePatchRequestBody.SealedRequestBody requestBody = new FakePatchRequestBody.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new FakePatch.PatchRequestBuilder() + .requestBody(requestBody) + .build(); + +FakePatchResponses.EndpointResponse response; +try { + response = apiClient.patch(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakePatchResponses.EndpointFakePatchCode200Response castResponse = (FakePatchResponses.EndpointFakePatchCode200Response) response; +FakePatchCode200Response.ApplicationjsonResponseBody deserializedBody = (FakePatchCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Patch(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakePatchResponses.EndpointResponse](../../paths/fake/patch/FakePatchResponses.md#endpointresponse) | patch([PatchRequest](#patchrequest) request) | + +## ClientModelOperation +public interface ClientModelOperation
+ +an interface that allows one to call the endpoint using a method named clientModel by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakePatchResponses.EndpointResponse](../../paths/fake/patch/FakePatchResponses.md#endpointresponse) | clientModel([PatchRequest](#patchrequest) request) | + +## PatchRequest +public static class PatchRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakePatchRequestBody.SealedRequestBody](../../paths/fake/patch/FakePatchRequestBody.md#sealedrequestbody) | requestBody | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PatchNullableRequest +public static class PatchNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakePatchRequestBody.@Nullable SealedRequestBody](../../paths/fake/patch/FakePatchRequestBody.md#sealedrequestbody) | requestBody | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| @Nullable Duration | timeout | + +## Patch0RequestBuilder +public static class Patch0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Patch0RequestBuilder(Patch0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PatchRequest](#patchrequest) | build()
Returns the request input used to call an endpoint method | +| [Patch0RequestBuilder](#patch0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Patch0RequestBuilder](#patch0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## PatchRequestBuilder +public static class PatchRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PatchRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Patch0RequestBuilder](#patch0requestbuilder) | requestBody([FakePatchRequestBody.SealedRequestBody](../../paths/fake/patch/FakePatchRequestBody.md#sealedrequestbody) requestBody)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fake/FakePost.md b/samples/client/petstore/java/docs/paths/fake/FakePost.md new file mode 100644 index 00000000000..defb5a55b0a --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fake/FakePost.md @@ -0,0 +1,161 @@ +# FakePost + +public class FakePost + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Post](#post)
The class that has a post method to call the endpoint | +| interface | [EndpointParametersOperation](#endpointparametersoperation)
The interface that has a endpointParameters method to call the endpoint | +| static class | [PostRequest](#postrequest)
The request inputs class | +| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | + +## Post +public static class Post extends ApiClient.ApiClient1 implements PostOperation
+ +a class that allows one to call the endpoint using a method named post + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fake.post.FakePostRequestBody; +import org.openapijsonschematools.client.paths.fake.post.requestbody.content.applicationxwwwformurlencoded.ApplicationxwwwformurlencodedSchema; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fake.post.FakePostSecurityInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.HttpBasicTest; +import org.openapijsonschematools.client.paths.fake.post.responses.FakePostCode200Response; +import org.openapijsonschematools.client.paths.fake.post.responses.FakePostCode404Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fake.FakePost; +import org.openapijsonschematools.client.paths.fake.post.FakePostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new HttpBasicTest("someUserId", "somePassword"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .fakePostSecurityRequirementObject0SecurityIndex(FakePostSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakePost.Post apiClient = new FakePost.Post(apiConfiguration, schemaConfiguration); + + +var request = new FakePost.PostRequestBuilder().build(); + +FakePostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (FakePostCode404Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakePostResponses.EndpointFakePostCode200Response castResponse = (FakePostResponses.EndpointFakePostCode200Response) response; +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakePostResponses.EndpointResponse](../../paths/fake/post/FakePostResponses.md#endpointresponse) | post([PostRequest](#postrequest) request) | + +## EndpointParametersOperation +public interface EndpointParametersOperation
+ +an interface that allows one to call the endpoint using a method named endpointParameters by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakePostResponses.EndpointResponse](../../paths/fake/post/FakePostResponses.md#endpointresponse) | endpointParameters([PostRequest](#postrequest) request) | + +## PostRequest +public static class PostRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakePostRequestBody.@Nullable SealedRequestBody](../../paths/fake/post/FakePostRequestBody.md#sealedrequestbody) | requestBody
optional | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| [FakePostSecurityInfo.@Nullable SecurityIndex](../../paths/fake/post/FakePostSecurityInfo.md#securityindex) | securityIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PostRequestBuilder +public static class PostRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PostRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | +| [PostRequestBuilder](#postrequestbuilder) | requestBody([FakePostRequestBody.SealedRequestBody](../../paths/fake/post/FakePostRequestBody.md#sealedrequestbody) requestBody)
sets the optional property | +| [PostRequestBuilder](#postrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [PostRequestBuilder](#postrequestbuilder) | securityIndex([FakePostSecurityInfo.SecurityIndex](../../paths/fake/post/FakePostSecurityInfo.md#securityindex) securityIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [PostRequestBuilder](#postrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fake/Get.md b/samples/client/petstore/java/docs/paths/fake/Get.md deleted file mode 100644 index ce06f4cdb92..00000000000 --- a/samples/client/petstore/java/docs/paths/fake/Get.md +++ /dev/null @@ -1,142 +0,0 @@ -# Get - -public class Get - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Get1](#get1)
The class that has a get method to call the endpoint | -| static class | [GetRequest](#getrequest)
The request inputs class | -| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | - -## Get1 -public static class Get1 extends ApiClient.ApiClient1 implements GetOperation
- -a class that allows one to call the endpoint using a method named get - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fake.get.RequestBody; -import org.openapijsonschematools.client.paths.fake.get.requestbody.content.applicationxwwwformurlencoded.ApplicationxwwwformurlencodedSchema; -import org.openapijsonschematools.client.paths.fake.get.HeaderParameters; -import org.openapijsonschematools.client.paths.fake.get.QueryParameters; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fake.get.responses.Code200Response; -import org.openapijsonschematools.client.paths.fake.get.responses.Code404Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fake.Get; -import org.openapijsonschematools.client.paths.fake.get.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Get.Get1 apiClient = new Get.Get1(apiConfiguration, schemaConfiguration); - - -var request = new GetRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.get(request); -} catch (Code404Response.ResponseApiException e) { - // server returned an error response defined in the openapi document - throw e; -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fake/get/Responses.md#endpointresponse) | get([GetRequest](#getrequest) request) | - -## GetRequest -public static class GetRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fake/get/RequestBody.md#sealedrequestbody) | requestBody
optional | -| [HeaderParameters.@Nullable HeaderParametersMap](../../paths/fake/get/HeaderParameters.md#headerparametersmap) | headerParameters
optional | -| [QueryParameters.@Nullable QueryParametersMap](../../paths/fake/get/QueryParameters.md#queryparametersmap) | queryParameters
optional | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## GetRequestBuilder -public static class GetRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| GetRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | -| [GetRequestBuilder](#getrequestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/fake/get/RequestBody.md#sealedrequestbody) requestBody)
sets the optional property | -| [GetRequestBuilder](#getrequestbuilder) | headerParameters([HeaderParametersHeaderParametersMap](../../paths/fake/get/HeaderParameters.md#headerparametersmap) headerParameters)
sets the optional property | -| [GetRequestBuilder](#getrequestbuilder) | queryParameters([QueryParametersQueryParametersMap](../../paths/fake/get/QueryParameters.md#queryparametersmap) queryParameters)
sets the optional property | -| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fake/Patch.md b/samples/client/petstore/java/docs/paths/fake/Patch.md deleted file mode 100644 index aacb0a78049..00000000000 --- a/samples/client/petstore/java/docs/paths/fake/Patch.md +++ /dev/null @@ -1,174 +0,0 @@ -# Patch - -public class Patch - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Patch1](#patch1)
The class that has a patch method to call the endpoint | -| static class | [PatchRequest](#patchrequest)
The final request inputs class | -| static class | [PatchNullableRequest](#patchnullablerequest)
The initial request inputs class | -| static class | [Patch0RequestBuilder](#patch0requestbuilder)
A builder for the request input class | -| static class | [PatchRequestBuilder](#patchrequestbuilder)
A builder for the request input class | - -## Patch1 -public static class Patch1 extends ApiClient.ApiClient1 implements PatchOperation
- -a class that allows one to call the endpoint using a method named patch - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fake.patch.RequestBody; -import org.openapijsonschematools.client.components.schemas.Client; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fake.patch.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fake.Patch; -import org.openapijsonschematools.client.paths.fake.patch.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Patch.Patch1 apiClient = new Patch.Patch1(apiConfiguration, schemaConfiguration); - - -Client1BoxedMap requestBodyPayload = - Client.Client1.validateAndBox( - new Client.ClientMapBuilder1() - .client("a") - - .build(), - schemaConfiguration -); -RequestBody.SealedRequestBody requestBody = new RequestBody.ApplicationjsonRequestBody(requestBodyPayload); - -var request = new PatchRequestBuilder() - .requestBody(requestBody) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.patch(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -Code200Response.ApplicationjsonResponseBody deserializedBody = (Code200Response.ApplicationjsonResponseBody) castResponse.body; -// handle deserialized body here -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Patch1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fake/patch/Responses.md#endpointresponse) | patch([PatchRequest](#patchrequest) request) | - -## PatchRequest -public static class PatchRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.SealedRequestBody](../../paths/fake/patch/RequestBody.md#sealedrequestbody) | requestBody | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PatchNullableRequest -public static class PatchNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fake/patch/RequestBody.md#sealedrequestbody) | requestBody | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| @Nullable Duration | timeout | - -## Patch0RequestBuilder -public static class Patch0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Patch0RequestBuilder(Patch0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PatchRequest](#patchrequest) | build()
Returns the request input used to call an endpoint method | -| [Patch0RequestBuilder](#patch0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Patch0RequestBuilder](#patch0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## PatchRequestBuilder -public static class PatchRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PatchRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Patch0RequestBuilder](#patch0requestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/fake/patch/RequestBody.md#sealedrequestbody) requestBody)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fake/Post.md b/samples/client/petstore/java/docs/paths/fake/Post.md deleted file mode 100644 index b85dee6e90e..00000000000 --- a/samples/client/petstore/java/docs/paths/fake/Post.md +++ /dev/null @@ -1,150 +0,0 @@ -# Post - -public class Post - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Post1](#post1)
The class that has a post method to call the endpoint | -| static class | [PostRequest](#postrequest)
The request inputs class | -| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | - -## Post1 -public static class Post1 extends ApiClient.ApiClient1 implements PostOperation
- -a class that allows one to call the endpoint using a method named post - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fake.post.RequestBody; -import org.openapijsonschematools.client.paths.fake.post.requestbody.content.applicationxwwwformurlencoded.ApplicationxwwwformurlencodedSchema; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fake.post.FakePostSecurityInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.securityschemes.SecurityScheme; -import org.openapijsonschematools.client.components.securityschemes.HttpBasicTest; -import org.openapijsonschematools.client.paths.fake.post.responses.Code200Response; -import org.openapijsonschematools.client.paths.fake.post.responses.Code404Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fake.Post; -import org.openapijsonschematools.client.paths.fake.post.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -List securitySchemes = new ArrayList(); -securitySchemes.add( - new HttpBasicTest("someUserId", "somePassword"); -); -ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() - .fakePostSecurityRequirementObject0SecurityIndex(FakePostSecurityRequirementObject0.SecurityIndex.SECURITY_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - securitySchemes, - securityIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Post.Post1 apiClient = new Post.Post1(apiConfiguration, schemaConfiguration); - - -var request = new PostRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.post(request); -} catch (Code404Response.ResponseApiException e) { - // server returned an error response defined in the openapi document - throw e; -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fake/post/Responses.md#endpointresponse) | post([PostRequest](#postrequest) request) | - -## PostRequest -public static class PostRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fake/post/RequestBody.md#sealedrequestbody) | requestBody
optional | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| [FakePostSecurityInfo.@Nullable SecurityIndex](../../paths/fake/post/FakePostSecurityInfo.md#securityindex) | securityIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PostRequestBuilder -public static class PostRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PostRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | -| [PostRequestBuilder](#postrequestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/fake/post/RequestBody.md#sealedrequestbody) requestBody)
sets the optional property | -| [PostRequestBuilder](#postrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [PostRequestBuilder](#postrequestbuilder) | securityIndex([FakePostSecurityInfo.SecurityIndex](../../paths/fake/post/FakePostSecurityInfo.md#securityindex) securityIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [PostRequestBuilder](#postrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fake/delete/FakeDeleteHeaderParameters.md b/samples/client/petstore/java/docs/paths/fake/delete/FakeDeleteHeaderParameters.md new file mode 100644 index 00000000000..c39d5ece8b9 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fake/delete/FakeDeleteHeaderParameters.md @@ -0,0 +1,274 @@ +# FakeDeleteHeaderParameters +public class FakeDeleteHeaderParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [FakeDeleteHeaderParameters.FakeDeleteHeaderParameters1Boxed](#fakedeleteheaderparameters1boxed)
sealed interface for validated payloads | +| record | [FakeDeleteHeaderParameters.FakeDeleteHeaderParameters1BoxedMap](#fakedeleteheaderparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [FakeDeleteHeaderParameters.FakeDeleteHeaderParameters1](#fakedeleteheaderparameters1)
schema class | +| static class | [FakeDeleteHeaderParameters.FakeDeleteHeaderParametersMapBuilder](#fakedeleteheaderparametersmapbuilder)
builder for Map payloads | +| static class | [FakeDeleteHeaderParameters.FakeDeleteHeaderParametersMap](#fakedeleteheaderparametersmap)
output class for Map payloads | +| sealed interface | [FakeDeleteHeaderParameters.FakeDeleteadditionalPropertiesBoxed](#fakedeleteadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [FakeDeleteHeaderParameters.FakeDeleteadditionalPropertiesBoxedVoid](#fakedeleteadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [FakeDeleteHeaderParameters.FakeDeleteadditionalPropertiesBoxedBoolean](#fakedeleteadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [FakeDeleteHeaderParameters.FakeDeleteadditionalPropertiesBoxedNumber](#fakedeleteadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [FakeDeleteHeaderParameters.FakeDeleteadditionalPropertiesBoxedString](#fakedeleteadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [FakeDeleteHeaderParameters.FakeDeleteadditionalPropertiesBoxedList](#fakedeleteadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [FakeDeleteHeaderParameters.FakeDeleteadditionalPropertiesBoxedMap](#fakedeleteadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [FakeDeleteHeaderParameters.FakeDeleteadditionalProperties](#fakedeleteadditionalproperties)
schema class | + +## FakeDeleteHeaderParameters1Boxed +public sealed interface FakeDeleteHeaderParameters1Boxed
+permits
+[FakeDeleteHeaderParameters1BoxedMap](#fakedeleteheaderparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## FakeDeleteHeaderParameters1BoxedMap +public record FakeDeleteHeaderParameters1BoxedMap
+implements [FakeDeleteHeaderParameters1Boxed](#fakedeleteheaderparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeDeleteHeaderParameters1BoxedMap([FakeDeleteHeaderParametersMap](#fakedeleteheaderparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeDeleteHeaderParametersMap](#fakedeleteheaderparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeDeleteHeaderParameters1 +public static class FakeDeleteHeaderParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fake.delete.FakeDeleteHeaderParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +FakeDeleteHeaderParameters.FakeDeleteHeaderParametersMap validatedPayload = + FakeDeleteHeaderParameters.FakeDeleteHeaderParameters1.validate( + new FakeDeleteHeaderParameters.FakeDeleteHeaderParametersMapBuilder() + .required_boolean_group("true") + + .boolean_group("true") + + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("required_boolean_group", [Schema1.Schema11.class](../../../paths/fake/delete/parameters/parameter1/Schema1.md#schema11)),
    new PropertyEntry("boolean_group", [Schema4.Schema41.class](../../../paths/fake/delete/parameters/parameter4/Schema4.md#schema41))
)
| +| Set | required = Set.of(
    "required_boolean_group"
)
| +| Class | additionalProperties = [FakeDeleteadditionalProperties.class](#fakedeleteadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeDeleteHeaderParametersMap](#fakedeleteheaderparametersmap) | validate([Map<?, ?>](#fakedeleteheaderparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [FakeDeleteHeaderParameters1BoxedMap](#fakedeleteheaderparameters1boxedmap) | validateAndBox([Map<?, ?>](#fakedeleteheaderparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [FakeDeleteHeaderParameters1Boxed](#fakedeleteheaderparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## FakeDeleteHeaderParametersMap0Builder +public class FakeDeleteHeaderParametersMap0Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeDeleteHeaderParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | +| [FakeDeleteHeaderParametersMap0Builder](#fakedeleteheaderparametersmap0builder) | boolean_group(String value) | +| [FakeDeleteHeaderParametersMap0Builder](#fakedeleteheaderparametersmap0builder) | boolean_group([Schema4.StringSchemaEnums4](../../../paths/fake/delete/parameters/parameter4/Schema4.md#stringschemaenums4) value) | + +## FakeDeleteHeaderParametersMapBuilder +public class FakeDeleteHeaderParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeDeleteHeaderParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeDeleteHeaderParametersMap0Builder](#fakedeleteheaderparametersmap0builder) | required_boolean_group(String value) | +| [FakeDeleteHeaderParametersMap0Builder](#fakedeleteheaderparametersmap0builder) | required_boolean_group([Schema1.StringSchemaEnums1](../../../paths/fake/delete/parameters/parameter1/Schema1.md#stringschemaenums1) value) | + +## FakeDeleteHeaderParametersMap +public static class FakeDeleteHeaderParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [FakeDeleteHeaderParametersMap](#fakedeleteheaderparametersmap) | of([Map](#fakedeleteheaderparametersmapbuilder) arg, SchemaConfiguration configuration) | +| String | required_boolean_group()
| +| String | boolean_group()
[optional] | + +## FakeDeleteadditionalPropertiesBoxed +public sealed interface FakeDeleteadditionalPropertiesBoxed
+permits
+[FakeDeleteadditionalPropertiesBoxedVoid](#fakedeleteadditionalpropertiesboxedvoid), +[FakeDeleteadditionalPropertiesBoxedBoolean](#fakedeleteadditionalpropertiesboxedboolean), +[FakeDeleteadditionalPropertiesBoxedNumber](#fakedeleteadditionalpropertiesboxednumber), +[FakeDeleteadditionalPropertiesBoxedString](#fakedeleteadditionalpropertiesboxedstring), +[FakeDeleteadditionalPropertiesBoxedList](#fakedeleteadditionalpropertiesboxedlist), +[FakeDeleteadditionalPropertiesBoxedMap](#fakedeleteadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## FakeDeleteadditionalPropertiesBoxedVoid +public record FakeDeleteadditionalPropertiesBoxedVoid
+implements [FakeDeleteadditionalPropertiesBoxed](#fakedeleteadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeDeleteadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeDeleteadditionalPropertiesBoxedBoolean +public record FakeDeleteadditionalPropertiesBoxedBoolean
+implements [FakeDeleteadditionalPropertiesBoxed](#fakedeleteadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeDeleteadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeDeleteadditionalPropertiesBoxedNumber +public record FakeDeleteadditionalPropertiesBoxedNumber
+implements [FakeDeleteadditionalPropertiesBoxed](#fakedeleteadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeDeleteadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeDeleteadditionalPropertiesBoxedString +public record FakeDeleteadditionalPropertiesBoxedString
+implements [FakeDeleteadditionalPropertiesBoxed](#fakedeleteadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeDeleteadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeDeleteadditionalPropertiesBoxedList +public record FakeDeleteadditionalPropertiesBoxedList
+implements [FakeDeleteadditionalPropertiesBoxed](#fakedeleteadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeDeleteadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeDeleteadditionalPropertiesBoxedMap +public record FakeDeleteadditionalPropertiesBoxedMap
+implements [FakeDeleteadditionalPropertiesBoxed](#fakedeleteadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeDeleteadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeDeleteadditionalProperties +public static class FakeDeleteadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fake/delete/FakeDeleteQueryParameters.md b/samples/client/petstore/java/docs/paths/fake/delete/FakeDeleteQueryParameters.md new file mode 100644 index 00000000000..ebaddcc38c2 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fake/delete/FakeDeleteQueryParameters.md @@ -0,0 +1,321 @@ +# FakeDeleteQueryParameters +public class FakeDeleteQueryParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [FakeDeleteQueryParameters.FakeDeleteQueryParameters1Boxed](#fakedeletequeryparameters1boxed)
sealed interface for validated payloads | +| record | [FakeDeleteQueryParameters.FakeDeleteQueryParameters1BoxedMap](#fakedeletequeryparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [FakeDeleteQueryParameters.FakeDeleteQueryParameters1](#fakedeletequeryparameters1)
schema class | +| static class | [FakeDeleteQueryParameters.FakeDeleteQueryParametersMapBuilder](#fakedeletequeryparametersmapbuilder)
builder for Map payloads | +| static class | [FakeDeleteQueryParameters.FakeDeleteQueryParametersMap](#fakedeletequeryparametersmap)
output class for Map payloads | +| sealed interface | [FakeDeleteQueryParameters.FakeDeleteadditionalPropertiesBoxed](#fakedeleteadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [FakeDeleteQueryParameters.FakeDeleteadditionalPropertiesBoxedVoid](#fakedeleteadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [FakeDeleteQueryParameters.FakeDeleteadditionalPropertiesBoxedBoolean](#fakedeleteadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [FakeDeleteQueryParameters.FakeDeleteadditionalPropertiesBoxedNumber](#fakedeleteadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [FakeDeleteQueryParameters.FakeDeleteadditionalPropertiesBoxedString](#fakedeleteadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [FakeDeleteQueryParameters.FakeDeleteadditionalPropertiesBoxedList](#fakedeleteadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [FakeDeleteQueryParameters.FakeDeleteadditionalPropertiesBoxedMap](#fakedeleteadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [FakeDeleteQueryParameters.FakeDeleteadditionalProperties](#fakedeleteadditionalproperties)
schema class | + +## FakeDeleteQueryParameters1Boxed +public sealed interface FakeDeleteQueryParameters1Boxed
+permits
+[FakeDeleteQueryParameters1BoxedMap](#fakedeletequeryparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## FakeDeleteQueryParameters1BoxedMap +public record FakeDeleteQueryParameters1BoxedMap
+implements [FakeDeleteQueryParameters1Boxed](#fakedeletequeryparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeDeleteQueryParameters1BoxedMap([FakeDeleteQueryParametersMap](#fakedeletequeryparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeDeleteQueryParametersMap](#fakedeletequeryparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeDeleteQueryParameters1 +public static class FakeDeleteQueryParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fake.delete.FakeDeleteQueryParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +FakeDeleteQueryParameters.FakeDeleteQueryParametersMap validatedPayload = + FakeDeleteQueryParameters.FakeDeleteQueryParameters1.validate( + new FakeDeleteQueryParameters.FakeDeleteQueryParametersMapBuilder() + .required_int64_group(1L) + + .required_string_group("a") + + .int64_group(1L) + + .string_group("a") + + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("required_string_group", [Schema0.Schema01.class](../../../paths/fake/delete/parameters/parameter0/Schema0.md#schema01)),
    new PropertyEntry("int64_group", [Schema5.Schema51.class](../../../paths/fake/delete/parameters/parameter5/Schema5.md#schema51)),
    new PropertyEntry("string_group", [Schema3.Schema31.class](../../../paths/fake/delete/parameters/parameter3/Schema3.md#schema31)),
    new PropertyEntry("required_int64_group", [Schema2.Schema21.class](../../../paths/fake/delete/parameters/parameter2/Schema2.md#schema21))
)
| +| Set | required = Set.of(
    "required_int64_group",
    "required_string_group"
)
| +| Class | additionalProperties = [FakeDeleteadditionalProperties.class](#fakedeleteadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeDeleteQueryParametersMap](#fakedeletequeryparametersmap) | validate([Map<?, ?>](#fakedeletequeryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [FakeDeleteQueryParameters1BoxedMap](#fakedeletequeryparameters1boxedmap) | validateAndBox([Map<?, ?>](#fakedeletequeryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [FakeDeleteQueryParameters1Boxed](#fakedeletequeryparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## FakeDeleteQueryParametersMap00Builder +public class FakeDeleteQueryParametersMap00Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeDeleteQueryParametersMap00Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | +| [FakeDeleteQueryParametersMap00Builder](#fakedeletequeryparametersmap00builder) | int64_group(int value) | +| [FakeDeleteQueryParametersMap00Builder](#fakedeletequeryparametersmap00builder) | int64_group(float value) | +| [FakeDeleteQueryParametersMap00Builder](#fakedeletequeryparametersmap00builder) | int64_group(long value) | +| [FakeDeleteQueryParametersMap00Builder](#fakedeletequeryparametersmap00builder) | int64_group(double value) | +| [FakeDeleteQueryParametersMap00Builder](#fakedeletequeryparametersmap00builder) | string_group(String value) | + +## FakeDeleteQueryParametersMap01Builder +public class FakeDeleteQueryParametersMap01Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeDeleteQueryParametersMap01Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeDeleteQueryParametersMap00Builder](#fakedeletequeryparametersmap00builder) | required_string_group(String value) | + +## FakeDeleteQueryParametersMap10Builder +public class FakeDeleteQueryParametersMap10Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeDeleteQueryParametersMap10Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeDeleteQueryParametersMap00Builder](#fakedeletequeryparametersmap00builder) | required_int64_group(int value) | +| [FakeDeleteQueryParametersMap00Builder](#fakedeletequeryparametersmap00builder) | required_int64_group(float value) | +| [FakeDeleteQueryParametersMap00Builder](#fakedeletequeryparametersmap00builder) | required_int64_group(long value) | +| [FakeDeleteQueryParametersMap00Builder](#fakedeletequeryparametersmap00builder) | required_int64_group(double value) | + +## FakeDeleteQueryParametersMapBuilder +public class FakeDeleteQueryParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeDeleteQueryParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeDeleteQueryParametersMap01Builder](#fakedeletequeryparametersmap01builder) | required_int64_group(int value) | +| [FakeDeleteQueryParametersMap01Builder](#fakedeletequeryparametersmap01builder) | required_int64_group(float value) | +| [FakeDeleteQueryParametersMap01Builder](#fakedeletequeryparametersmap01builder) | required_int64_group(long value) | +| [FakeDeleteQueryParametersMap01Builder](#fakedeletequeryparametersmap01builder) | required_int64_group(double value) | +| [FakeDeleteQueryParametersMap10Builder](#fakedeletequeryparametersmap10builder) | required_string_group(String value) | + +## FakeDeleteQueryParametersMap +public static class FakeDeleteQueryParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [FakeDeleteQueryParametersMap](#fakedeletequeryparametersmap) | of([Map](#fakedeletequeryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| Number | required_int64_group()
| +| String | required_string_group()
| +| Number | int64_group()
[optional] | +| String | string_group()
[optional] | + +## FakeDeleteadditionalPropertiesBoxed +public sealed interface FakeDeleteadditionalPropertiesBoxed
+permits
+[FakeDeleteadditionalPropertiesBoxedVoid](#fakedeleteadditionalpropertiesboxedvoid), +[FakeDeleteadditionalPropertiesBoxedBoolean](#fakedeleteadditionalpropertiesboxedboolean), +[FakeDeleteadditionalPropertiesBoxedNumber](#fakedeleteadditionalpropertiesboxednumber), +[FakeDeleteadditionalPropertiesBoxedString](#fakedeleteadditionalpropertiesboxedstring), +[FakeDeleteadditionalPropertiesBoxedList](#fakedeleteadditionalpropertiesboxedlist), +[FakeDeleteadditionalPropertiesBoxedMap](#fakedeleteadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## FakeDeleteadditionalPropertiesBoxedVoid +public record FakeDeleteadditionalPropertiesBoxedVoid
+implements [FakeDeleteadditionalPropertiesBoxed](#fakedeleteadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeDeleteadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeDeleteadditionalPropertiesBoxedBoolean +public record FakeDeleteadditionalPropertiesBoxedBoolean
+implements [FakeDeleteadditionalPropertiesBoxed](#fakedeleteadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeDeleteadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeDeleteadditionalPropertiesBoxedNumber +public record FakeDeleteadditionalPropertiesBoxedNumber
+implements [FakeDeleteadditionalPropertiesBoxed](#fakedeleteadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeDeleteadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeDeleteadditionalPropertiesBoxedString +public record FakeDeleteadditionalPropertiesBoxedString
+implements [FakeDeleteadditionalPropertiesBoxed](#fakedeleteadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeDeleteadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeDeleteadditionalPropertiesBoxedList +public record FakeDeleteadditionalPropertiesBoxedList
+implements [FakeDeleteadditionalPropertiesBoxed](#fakedeleteadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeDeleteadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeDeleteadditionalPropertiesBoxedMap +public record FakeDeleteadditionalPropertiesBoxedMap
+implements [FakeDeleteadditionalPropertiesBoxed](#fakedeleteadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeDeleteadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeDeleteadditionalProperties +public static class FakeDeleteadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fake/delete/FakeDeleteResponses.md b/samples/client/petstore/java/docs/paths/fake/delete/FakeDeleteResponses.md new file mode 100644 index 00000000000..f922799dc04 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fake/delete/FakeDeleteResponses.md @@ -0,0 +1,29 @@ +# FakeDeleteResponses + +public class FakeDeleteResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakeDeleteCode200Response](#endpointfakedeletecode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakeDeleteCode200Response](#endpointfakedeletecode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakeDeleteCode200Response +public record EndpointFakeDeleteCode200Response( + HttpResponse response, + Void body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fake/delete/HeaderParameters.md b/samples/client/petstore/java/docs/paths/fake/delete/HeaderParameters.md deleted file mode 100644 index 2950f661f66..00000000000 --- a/samples/client/petstore/java/docs/paths/fake/delete/HeaderParameters.md +++ /dev/null @@ -1,274 +0,0 @@ -# HeaderParameters -public class HeaderParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [HeaderParameters.HeaderParameters1Boxed](#headerparameters1boxed)
sealed interface for validated payloads | -| record | [HeaderParameters.HeaderParameters1BoxedMap](#headerparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [HeaderParameters.HeaderParameters1](#headerparameters1)
schema class | -| static class | [HeaderParameters.HeaderParametersMapBuilder](#headerparametersmapbuilder)
builder for Map payloads | -| static class | [HeaderParameters.HeaderParametersMap](#headerparametersmap)
output class for Map payloads | -| sealed interface | [HeaderParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [HeaderParameters.AdditionalProperties](#additionalproperties)
schema class | - -## HeaderParameters1Boxed -public sealed interface HeaderParameters1Boxed
-permits
-[HeaderParameters1BoxedMap](#headerparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## HeaderParameters1BoxedMap -public record HeaderParameters1BoxedMap
-implements [HeaderParameters1Boxed](#headerparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| HeaderParameters1BoxedMap([HeaderParametersMap](#headerparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [HeaderParametersMap](#headerparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## HeaderParameters1 -public static class HeaderParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fake.delete.HeaderParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -HeaderParameters.HeaderParametersMap validatedPayload = - HeaderParameters.HeaderParameters1.validate( - new HeaderParameters.HeaderParametersMapBuilder() - .required_boolean_group("true") - - .boolean_group("true") - - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("required_boolean_group", [Schema1.Schema11.class](../../../paths/fake/delete/parameters/parameter1/Schema1.md#schema11)),
    new PropertyEntry("boolean_group", [Schema4.Schema41.class](../../../paths/fake/delete/parameters/parameter4/Schema4.md#schema41))
)
| -| Set | required = Set.of(
    "required_boolean_group"
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [HeaderParametersMap](#headerparametersmap) | validate([Map<?, ?>](#headerparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [HeaderParameters1BoxedMap](#headerparameters1boxedmap) | validateAndBox([Map<?, ?>](#headerparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [HeaderParameters1Boxed](#headerparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## HeaderParametersMap0Builder -public class HeaderParametersMap0Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| HeaderParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | -| [HeaderParametersMap0Builder](#headerparametersmap0builder) | boolean_group(String value) | -| [HeaderParametersMap0Builder](#headerparametersmap0builder) | boolean_group([Schema4.StringSchemaEnums4](../../../paths/fake/delete/parameters/parameter4/Schema4.md#stringschemaenums4) value) | - -## HeaderParametersMapBuilder -public class HeaderParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| HeaderParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [HeaderParametersMap0Builder](#headerparametersmap0builder) | required_boolean_group(String value) | -| [HeaderParametersMap0Builder](#headerparametersmap0builder) | required_boolean_group([Schema1.StringSchemaEnums1](../../../paths/fake/delete/parameters/parameter1/Schema1.md#stringschemaenums1) value) | - -## HeaderParametersMap -public static class HeaderParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [HeaderParametersMap](#headerparametersmap) | of([Map](#headerparametersmapbuilder) arg, SchemaConfiguration configuration) | -| String | required_boolean_group()
| -| String | boolean_group()
[optional] | - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fake/delete/QueryParameters.md b/samples/client/petstore/java/docs/paths/fake/delete/QueryParameters.md deleted file mode 100644 index 455f2a77379..00000000000 --- a/samples/client/petstore/java/docs/paths/fake/delete/QueryParameters.md +++ /dev/null @@ -1,321 +0,0 @@ -# QueryParameters -public class QueryParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [QueryParameters.QueryParameters1Boxed](#queryparameters1boxed)
sealed interface for validated payloads | -| record | [QueryParameters.QueryParameters1BoxedMap](#queryparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [QueryParameters.QueryParameters1](#queryparameters1)
schema class | -| static class | [QueryParameters.QueryParametersMapBuilder](#queryparametersmapbuilder)
builder for Map payloads | -| static class | [QueryParameters.QueryParametersMap](#queryparametersmap)
output class for Map payloads | -| sealed interface | [QueryParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [QueryParameters.AdditionalProperties](#additionalproperties)
schema class | - -## QueryParameters1Boxed -public sealed interface QueryParameters1Boxed
-permits
-[QueryParameters1BoxedMap](#queryparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## QueryParameters1BoxedMap -public record QueryParameters1BoxedMap
-implements [QueryParameters1Boxed](#queryparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParameters1BoxedMap([QueryParametersMap](#queryparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap](#queryparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## QueryParameters1 -public static class QueryParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fake.delete.QueryParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -QueryParameters.QueryParametersMap validatedPayload = - QueryParameters.QueryParameters1.validate( - new QueryParameters.QueryParametersMapBuilder() - .required_int64_group(1L) - - .required_string_group("a") - - .int64_group(1L) - - .string_group("a") - - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("required_string_group", [Schema0.Schema01.class](../../../paths/fake/delete/parameters/parameter0/Schema0.md#schema01)),
    new PropertyEntry("int64_group", [Schema5.Schema51.class](../../../paths/fake/delete/parameters/parameter5/Schema5.md#schema51)),
    new PropertyEntry("string_group", [Schema3.Schema31.class](../../../paths/fake/delete/parameters/parameter3/Schema3.md#schema31)),
    new PropertyEntry("required_int64_group", [Schema2.Schema21.class](../../../paths/fake/delete/parameters/parameter2/Schema2.md#schema21))
)
| -| Set | required = Set.of(
    "required_int64_group",
    "required_string_group"
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap](#queryparametersmap) | validate([Map<?, ?>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [QueryParameters1BoxedMap](#queryparameters1boxedmap) | validateAndBox([Map<?, ?>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [QueryParameters1Boxed](#queryparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## QueryParametersMap00Builder -public class QueryParametersMap00Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap00Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | -| [QueryParametersMap00Builder](#queryparametersmap00builder) | int64_group(int value) | -| [QueryParametersMap00Builder](#queryparametersmap00builder) | int64_group(float value) | -| [QueryParametersMap00Builder](#queryparametersmap00builder) | int64_group(long value) | -| [QueryParametersMap00Builder](#queryparametersmap00builder) | int64_group(double value) | -| [QueryParametersMap00Builder](#queryparametersmap00builder) | string_group(String value) | - -## QueryParametersMap01Builder -public class QueryParametersMap01Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap01Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap00Builder](#queryparametersmap00builder) | required_string_group(String value) | - -## QueryParametersMap10Builder -public class QueryParametersMap10Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap10Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap00Builder](#queryparametersmap00builder) | required_int64_group(int value) | -| [QueryParametersMap00Builder](#queryparametersmap00builder) | required_int64_group(float value) | -| [QueryParametersMap00Builder](#queryparametersmap00builder) | required_int64_group(long value) | -| [QueryParametersMap00Builder](#queryparametersmap00builder) | required_int64_group(double value) | - -## QueryParametersMapBuilder -public class QueryParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap01Builder](#queryparametersmap01builder) | required_int64_group(int value) | -| [QueryParametersMap01Builder](#queryparametersmap01builder) | required_int64_group(float value) | -| [QueryParametersMap01Builder](#queryparametersmap01builder) | required_int64_group(long value) | -| [QueryParametersMap01Builder](#queryparametersmap01builder) | required_int64_group(double value) | -| [QueryParametersMap10Builder](#queryparametersmap10builder) | required_string_group(String value) | - -## QueryParametersMap -public static class QueryParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [QueryParametersMap](#queryparametersmap) | of([Map](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| Number | required_int64_group()
| -| String | required_string_group()
| -| Number | int64_group()
[optional] | -| String | string_group()
[optional] | - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fake/delete/Responses.md b/samples/client/petstore/java/docs/paths/fake/delete/Responses.md deleted file mode 100644 index d4bf4fdb8f5..00000000000 --- a/samples/client/petstore/java/docs/paths/fake/delete/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fake/delete/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fake/delete/responses/Code200Response.md deleted file mode 100644 index e89c75b2e12..00000000000 --- a/samples/client/petstore/java/docs/paths/fake/delete/responses/Code200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# Code200Response - -public class Code200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) - -A class (extended from the $ref class) that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## Code200Response1 -public static class Code200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
- -a class that deserializes responses, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/fake/delete/responses/FakeDeleteCode200Response.md b/samples/client/petstore/java/docs/paths/fake/delete/responses/FakeDeleteCode200Response.md new file mode 100644 index 00000000000..64d63ac41a4 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fake/delete/responses/FakeDeleteCode200Response.md @@ -0,0 +1,17 @@ +# FakeDeleteCode200Response + +public class FakeDeleteCode200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) + +A class (extended from the $ref class) that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [FakeDeleteCode200Response.FakeDeleteCode200Response1](#fakedeletecode200response1)
class that deserializes responses | + +## FakeDeleteCode200Response1 +public static class FakeDeleteCode200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
+ +a class that deserializes responses, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/fake/get/FakeGetHeaderParameters.md b/samples/client/petstore/java/docs/paths/fake/get/FakeGetHeaderParameters.md new file mode 100644 index 00000000000..786bd606a2d --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fake/get/FakeGetHeaderParameters.md @@ -0,0 +1,260 @@ +# FakeGetHeaderParameters +public class FakeGetHeaderParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [FakeGetHeaderParameters.FakeGetHeaderParameters1Boxed](#fakegetheaderparameters1boxed)
sealed interface for validated payloads | +| record | [FakeGetHeaderParameters.FakeGetHeaderParameters1BoxedMap](#fakegetheaderparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [FakeGetHeaderParameters.FakeGetHeaderParameters1](#fakegetheaderparameters1)
schema class | +| static class | [FakeGetHeaderParameters.FakeGetHeaderParametersMapBuilder](#fakegetheaderparametersmapbuilder)
builder for Map payloads | +| static class | [FakeGetHeaderParameters.FakeGetHeaderParametersMap](#fakegetheaderparametersmap)
output class for Map payloads | +| sealed interface | [FakeGetHeaderParameters.FakeGetadditionalPropertiesBoxed](#fakegetadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [FakeGetHeaderParameters.FakeGetadditionalPropertiesBoxedVoid](#fakegetadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [FakeGetHeaderParameters.FakeGetadditionalPropertiesBoxedBoolean](#fakegetadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [FakeGetHeaderParameters.FakeGetadditionalPropertiesBoxedNumber](#fakegetadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [FakeGetHeaderParameters.FakeGetadditionalPropertiesBoxedString](#fakegetadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [FakeGetHeaderParameters.FakeGetadditionalPropertiesBoxedList](#fakegetadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [FakeGetHeaderParameters.FakeGetadditionalPropertiesBoxedMap](#fakegetadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [FakeGetHeaderParameters.FakeGetadditionalProperties](#fakegetadditionalproperties)
schema class | + +## FakeGetHeaderParameters1Boxed +public sealed interface FakeGetHeaderParameters1Boxed
+permits
+[FakeGetHeaderParameters1BoxedMap](#fakegetheaderparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## FakeGetHeaderParameters1BoxedMap +public record FakeGetHeaderParameters1BoxedMap
+implements [FakeGetHeaderParameters1Boxed](#fakegetheaderparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeGetHeaderParameters1BoxedMap([FakeGetHeaderParametersMap](#fakegetheaderparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeGetHeaderParametersMap](#fakegetheaderparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeGetHeaderParameters1 +public static class FakeGetHeaderParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fake.get.FakeGetHeaderParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +FakeGetHeaderParameters.FakeGetHeaderParametersMap validatedPayload = + FakeGetHeaderParameters.FakeGetHeaderParameters1.validate( + new FakeGetHeaderParameters.FakeGetHeaderParametersMapBuilder() + .enum_header_string("_abc") + + .enum_header_string_array( + Arrays.asList( + ">" + ) + ) + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("enum_header_string", [Schema1.Schema11.class](../../../paths/fake/get/parameters/parameter1/Schema1.md#schema11)),
    new PropertyEntry("enum_header_string_array", [Schema0.Schema01.class](../../../paths/fake/get/parameters/parameter0/Schema0.md#schema01))
)
| +| Class | additionalProperties = [FakeGetadditionalProperties.class](#fakegetadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeGetHeaderParametersMap](#fakegetheaderparametersmap) | validate([Map<?, ?>](#fakegetheaderparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [FakeGetHeaderParameters1BoxedMap](#fakegetheaderparameters1boxedmap) | validateAndBox([Map<?, ?>](#fakegetheaderparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [FakeGetHeaderParameters1Boxed](#fakegetheaderparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## FakeGetHeaderParametersMapBuilder +public class FakeGetHeaderParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeGetHeaderParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | +| [FakeGetHeaderParametersMapBuilder](#fakegetheaderparametersmapbuilder) | enum_header_string(String value) | +| [FakeGetHeaderParametersMapBuilder](#fakegetheaderparametersmapbuilder) | enum_header_string([Schema1.StringSchemaEnums1](../../../paths/fake/get/parameters/parameter1/Schema1.md#stringschemaenums1) value) | +| [FakeGetHeaderParametersMapBuilder](#fakegetheaderparametersmapbuilder) | enum_header_string_array(List value) | + +## FakeGetHeaderParametersMap +public static class FakeGetHeaderParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [FakeGetHeaderParametersMap](#fakegetheaderparametersmap) | of([Map](#fakegetheaderparametersmapbuilder) arg, SchemaConfiguration configuration) | +| String | enum_header_string()
[optional] | +| [Schema0.SchemaList0](../../../paths/fake/get/parameters/parameter0/Schema0.md#schemalist0) | enum_header_string_array()
[optional] | + +## FakeGetadditionalPropertiesBoxed +public sealed interface FakeGetadditionalPropertiesBoxed
+permits
+[FakeGetadditionalPropertiesBoxedVoid](#fakegetadditionalpropertiesboxedvoid), +[FakeGetadditionalPropertiesBoxedBoolean](#fakegetadditionalpropertiesboxedboolean), +[FakeGetadditionalPropertiesBoxedNumber](#fakegetadditionalpropertiesboxednumber), +[FakeGetadditionalPropertiesBoxedString](#fakegetadditionalpropertiesboxedstring), +[FakeGetadditionalPropertiesBoxedList](#fakegetadditionalpropertiesboxedlist), +[FakeGetadditionalPropertiesBoxedMap](#fakegetadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## FakeGetadditionalPropertiesBoxedVoid +public record FakeGetadditionalPropertiesBoxedVoid
+implements [FakeGetadditionalPropertiesBoxed](#fakegetadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeGetadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeGetadditionalPropertiesBoxedBoolean +public record FakeGetadditionalPropertiesBoxedBoolean
+implements [FakeGetadditionalPropertiesBoxed](#fakegetadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeGetadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeGetadditionalPropertiesBoxedNumber +public record FakeGetadditionalPropertiesBoxedNumber
+implements [FakeGetadditionalPropertiesBoxed](#fakegetadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeGetadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeGetadditionalPropertiesBoxedString +public record FakeGetadditionalPropertiesBoxedString
+implements [FakeGetadditionalPropertiesBoxed](#fakegetadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeGetadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeGetadditionalPropertiesBoxedList +public record FakeGetadditionalPropertiesBoxedList
+implements [FakeGetadditionalPropertiesBoxed](#fakegetadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeGetadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeGetadditionalPropertiesBoxedMap +public record FakeGetadditionalPropertiesBoxedMap
+implements [FakeGetadditionalPropertiesBoxed](#fakegetadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeGetadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeGetadditionalProperties +public static class FakeGetadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fake/get/FakeGetQueryParameters.md b/samples/client/petstore/java/docs/paths/fake/get/FakeGetQueryParameters.md new file mode 100644 index 00000000000..83475a59e39 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fake/get/FakeGetQueryParameters.md @@ -0,0 +1,278 @@ +# FakeGetQueryParameters +public class FakeGetQueryParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [FakeGetQueryParameters.FakeGetQueryParameters1Boxed](#fakegetqueryparameters1boxed)
sealed interface for validated payloads | +| record | [FakeGetQueryParameters.FakeGetQueryParameters1BoxedMap](#fakegetqueryparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [FakeGetQueryParameters.FakeGetQueryParameters1](#fakegetqueryparameters1)
schema class | +| static class | [FakeGetQueryParameters.FakeGetQueryParametersMapBuilder](#fakegetqueryparametersmapbuilder)
builder for Map payloads | +| static class | [FakeGetQueryParameters.FakeGetQueryParametersMap](#fakegetqueryparametersmap)
output class for Map payloads | +| sealed interface | [FakeGetQueryParameters.FakeGetadditionalPropertiesBoxed](#fakegetadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [FakeGetQueryParameters.FakeGetadditionalPropertiesBoxedVoid](#fakegetadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [FakeGetQueryParameters.FakeGetadditionalPropertiesBoxedBoolean](#fakegetadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [FakeGetQueryParameters.FakeGetadditionalPropertiesBoxedNumber](#fakegetadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [FakeGetQueryParameters.FakeGetadditionalPropertiesBoxedString](#fakegetadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [FakeGetQueryParameters.FakeGetadditionalPropertiesBoxedList](#fakegetadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [FakeGetQueryParameters.FakeGetadditionalPropertiesBoxedMap](#fakegetadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [FakeGetQueryParameters.FakeGetadditionalProperties](#fakegetadditionalproperties)
schema class | + +## FakeGetQueryParameters1Boxed +public sealed interface FakeGetQueryParameters1Boxed
+permits
+[FakeGetQueryParameters1BoxedMap](#fakegetqueryparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## FakeGetQueryParameters1BoxedMap +public record FakeGetQueryParameters1BoxedMap
+implements [FakeGetQueryParameters1Boxed](#fakegetqueryparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeGetQueryParameters1BoxedMap([FakeGetQueryParametersMap](#fakegetqueryparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeGetQueryParametersMap](#fakegetqueryparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeGetQueryParameters1 +public static class FakeGetQueryParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fake.get.FakeGetQueryParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +FakeGetQueryParameters.FakeGetQueryParametersMap validatedPayload = + FakeGetQueryParameters.FakeGetQueryParameters1.validate( + new FakeGetQueryParameters.FakeGetQueryParametersMapBuilder() + .enum_query_double(3.14d) + + .enum_query_string("_abc") + + .enum_query_integer(1) + + .enum_query_string_array( + Arrays.asList( + ">" + ) + ) + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("enum_query_double", [Schema5.Schema51.class](../../../paths/fake/get/parameters/parameter5/Schema5.md#schema51)),
    new PropertyEntry("enum_query_string", [Schema3.Schema31.class](../../../paths/fake/get/parameters/parameter3/Schema3.md#schema31)),
    new PropertyEntry("enum_query_integer", [Schema4.Schema41.class](../../../paths/fake/get/parameters/parameter4/Schema4.md#schema41)),
    new PropertyEntry("enum_query_string_array", [Schema2.Schema21.class](../../../paths/fake/get/parameters/parameter2/Schema2.md#schema21))
)
| +| Class | additionalProperties = [FakeGetadditionalProperties.class](#fakegetadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeGetQueryParametersMap](#fakegetqueryparametersmap) | validate([Map<?, ?>](#fakegetqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [FakeGetQueryParameters1BoxedMap](#fakegetqueryparameters1boxedmap) | validateAndBox([Map<?, ?>](#fakegetqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [FakeGetQueryParameters1Boxed](#fakegetqueryparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## FakeGetQueryParametersMapBuilder +public class FakeGetQueryParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeGetQueryParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | +| [FakeGetQueryParametersMapBuilder](#fakegetqueryparametersmapbuilder) | enum_query_double(int value) | +| [FakeGetQueryParametersMapBuilder](#fakegetqueryparametersmapbuilder) | enum_query_double(float value) | +| [FakeGetQueryParametersMapBuilder](#fakegetqueryparametersmapbuilder) | enum_query_double(long value) | +| [FakeGetQueryParametersMapBuilder](#fakegetqueryparametersmapbuilder) | enum_query_double(double value) | +| [FakeGetQueryParametersMapBuilder](#fakegetqueryparametersmapbuilder) | enum_query_double([Schema5.DoubleSchemaEnums5](../../../paths/fake/get/parameters/parameter5/Schema5.md#doubleschemaenums5) value) | +| [FakeGetQueryParametersMapBuilder](#fakegetqueryparametersmapbuilder) | enum_query_double([Schema5.FloatSchemaEnums5](../../../paths/fake/get/parameters/parameter5/Schema5.md#floatschemaenums5) value) | +| [FakeGetQueryParametersMapBuilder](#fakegetqueryparametersmapbuilder) | enum_query_string(String value) | +| [FakeGetQueryParametersMapBuilder](#fakegetqueryparametersmapbuilder) | enum_query_string([Schema3.StringSchemaEnums3](../../../paths/fake/get/parameters/parameter3/Schema3.md#stringschemaenums3) value) | +| [FakeGetQueryParametersMapBuilder](#fakegetqueryparametersmapbuilder) | enum_query_integer(int value) | +| [FakeGetQueryParametersMapBuilder](#fakegetqueryparametersmapbuilder) | enum_query_integer(float value) | +| [FakeGetQueryParametersMapBuilder](#fakegetqueryparametersmapbuilder) | enum_query_integer([Schema4.IntegerSchemaEnums4](../../../paths/fake/get/parameters/parameter4/Schema4.md#integerschemaenums4) value) | +| [FakeGetQueryParametersMapBuilder](#fakegetqueryparametersmapbuilder) | enum_query_integer([Schema4.LongSchemaEnums4](../../../paths/fake/get/parameters/parameter4/Schema4.md#longschemaenums4) value) | +| [FakeGetQueryParametersMapBuilder](#fakegetqueryparametersmapbuilder) | enum_query_integer([Schema4.FloatSchemaEnums4](../../../paths/fake/get/parameters/parameter4/Schema4.md#floatschemaenums4) value) | +| [FakeGetQueryParametersMapBuilder](#fakegetqueryparametersmapbuilder) | enum_query_integer([Schema4.DoubleSchemaEnums4](../../../paths/fake/get/parameters/parameter4/Schema4.md#doubleschemaenums4) value) | +| [FakeGetQueryParametersMapBuilder](#fakegetqueryparametersmapbuilder) | enum_query_string_array(List value) | + +## FakeGetQueryParametersMap +public static class FakeGetQueryParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [FakeGetQueryParametersMap](#fakegetqueryparametersmap) | of([Map](#fakegetqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| Number | enum_query_double()
[optional] | +| String | enum_query_string()
[optional] | +| Number | enum_query_integer()
[optional] | +| [Schema2.SchemaList2](../../../paths/fake/get/parameters/parameter2/Schema2.md#schemalist2) | enum_query_string_array()
[optional] | + +## FakeGetadditionalPropertiesBoxed +public sealed interface FakeGetadditionalPropertiesBoxed
+permits
+[FakeGetadditionalPropertiesBoxedVoid](#fakegetadditionalpropertiesboxedvoid), +[FakeGetadditionalPropertiesBoxedBoolean](#fakegetadditionalpropertiesboxedboolean), +[FakeGetadditionalPropertiesBoxedNumber](#fakegetadditionalpropertiesboxednumber), +[FakeGetadditionalPropertiesBoxedString](#fakegetadditionalpropertiesboxedstring), +[FakeGetadditionalPropertiesBoxedList](#fakegetadditionalpropertiesboxedlist), +[FakeGetadditionalPropertiesBoxedMap](#fakegetadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## FakeGetadditionalPropertiesBoxedVoid +public record FakeGetadditionalPropertiesBoxedVoid
+implements [FakeGetadditionalPropertiesBoxed](#fakegetadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeGetadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeGetadditionalPropertiesBoxedBoolean +public record FakeGetadditionalPropertiesBoxedBoolean
+implements [FakeGetadditionalPropertiesBoxed](#fakegetadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeGetadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeGetadditionalPropertiesBoxedNumber +public record FakeGetadditionalPropertiesBoxedNumber
+implements [FakeGetadditionalPropertiesBoxed](#fakegetadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeGetadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeGetadditionalPropertiesBoxedString +public record FakeGetadditionalPropertiesBoxedString
+implements [FakeGetadditionalPropertiesBoxed](#fakegetadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeGetadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeGetadditionalPropertiesBoxedList +public record FakeGetadditionalPropertiesBoxedList
+implements [FakeGetadditionalPropertiesBoxed](#fakegetadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeGetadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeGetadditionalPropertiesBoxedMap +public record FakeGetadditionalPropertiesBoxedMap
+implements [FakeGetadditionalPropertiesBoxed](#fakegetadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeGetadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeGetadditionalProperties +public static class FakeGetadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fake/get/FakeGetRequestBody.md b/samples/client/petstore/java/docs/paths/fake/get/FakeGetRequestBody.md new file mode 100644 index 00000000000..3ac852200b2 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fake/get/FakeGetRequestBody.md @@ -0,0 +1,90 @@ +# FakeGetRequestBody + +public class FakeGetRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakeGetRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakeGetRequestBody.ApplicationxwwwformurlencodedMediaType](#applicationxwwwformurlencodedmediatype)
record storing schema + encoding for a specific contentType | +| static class | [FakeGetRequestBody.FakeGetRequestBody1](#fakegetrequestbody1)
class that serializes request bodies | +| sealed interface | [FakeGetRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [FakeGetRequestBody.ApplicationxwwwformurlencodedRequestBody](#applicationxwwwformurlencodedrequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationxwwwformurlencodedMediaType](#applicationxwwwformurlencodedmediatype) + +sealed interface that stores schema and encoding info + + +## ApplicationxwwwformurlencodedMediaType +public record ApplicationxwwwformurlencodedMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1](../../../paths/fake/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationxwwwformurlencodedMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1](../../../paths/fake/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## FakeGetRequestBody1 +public static class FakeGetRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeGetRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = false
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/x-www-form-urlencoded", new [ApplicationxwwwformurlencodedMediaType](#applicationxwwwformurlencodedmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[ApplicationxwwwformurlencodedRequestBody](#applicationxwwwformurlencodedrequestbody) + +sealed interface that stores request contentType + validated schema data + +## ApplicationxwwwformurlencodedRequestBody +public record ApplicationxwwwformurlencodedRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="application/x-www-form-urlencoded" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationxwwwformurlencodedRequestBody(ApplicationxwwwformurlencodedSchema.[ApplicationxwwwformurlencodedSchema1Boxed](../../../paths/fake/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "application/x-www-form-urlencoded" | +| ApplicationxwwwformurlencodedSchema.[ApplicationxwwwformurlencodedSchema1Boxed](../../../paths/fake/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fake/get/FakeGetResponses.md b/samples/client/petstore/java/docs/paths/fake/get/FakeGetResponses.md new file mode 100644 index 00000000000..97fb3ded3d4 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fake/get/FakeGetResponses.md @@ -0,0 +1,29 @@ +# FakeGetResponses + +public class FakeGetResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakeGetCode200Response](#endpointfakegetcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakeGetCode200Response](#endpointfakegetcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakeGetCode200Response +public record EndpointFakeGetCode200Response( + HttpResponse response, + Void body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fake/get/HeaderParameters.md b/samples/client/petstore/java/docs/paths/fake/get/HeaderParameters.md deleted file mode 100644 index ffb2035d0d7..00000000000 --- a/samples/client/petstore/java/docs/paths/fake/get/HeaderParameters.md +++ /dev/null @@ -1,260 +0,0 @@ -# HeaderParameters -public class HeaderParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [HeaderParameters.HeaderParameters1Boxed](#headerparameters1boxed)
sealed interface for validated payloads | -| record | [HeaderParameters.HeaderParameters1BoxedMap](#headerparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [HeaderParameters.HeaderParameters1](#headerparameters1)
schema class | -| static class | [HeaderParameters.HeaderParametersMapBuilder](#headerparametersmapbuilder)
builder for Map payloads | -| static class | [HeaderParameters.HeaderParametersMap](#headerparametersmap)
output class for Map payloads | -| sealed interface | [HeaderParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [HeaderParameters.AdditionalProperties](#additionalproperties)
schema class | - -## HeaderParameters1Boxed -public sealed interface HeaderParameters1Boxed
-permits
-[HeaderParameters1BoxedMap](#headerparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## HeaderParameters1BoxedMap -public record HeaderParameters1BoxedMap
-implements [HeaderParameters1Boxed](#headerparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| HeaderParameters1BoxedMap([HeaderParametersMap](#headerparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [HeaderParametersMap](#headerparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## HeaderParameters1 -public static class HeaderParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fake.get.HeaderParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -HeaderParameters.HeaderParametersMap validatedPayload = - HeaderParameters.HeaderParameters1.validate( - new HeaderParameters.HeaderParametersMapBuilder() - .enum_header_string("_abc") - - .enum_header_string_array( - Arrays.asList( - ">" - ) - ) - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("enum_header_string", [Schema1.Schema11.class](../../../paths/fake/get/parameters/parameter1/Schema1.md#schema11)),
    new PropertyEntry("enum_header_string_array", [Schema0.Schema01.class](../../../paths/fake/get/parameters/parameter0/Schema0.md#schema01))
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [HeaderParametersMap](#headerparametersmap) | validate([Map<?, ?>](#headerparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [HeaderParameters1BoxedMap](#headerparameters1boxedmap) | validateAndBox([Map<?, ?>](#headerparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [HeaderParameters1Boxed](#headerparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## HeaderParametersMapBuilder -public class HeaderParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| HeaderParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | -| [HeaderParametersMapBuilder](#headerparametersmapbuilder) | enum_header_string(String value) | -| [HeaderParametersMapBuilder](#headerparametersmapbuilder) | enum_header_string([Schema1.StringSchemaEnums1](../../../paths/fake/get/parameters/parameter1/Schema1.md#stringschemaenums1) value) | -| [HeaderParametersMapBuilder](#headerparametersmapbuilder) | enum_header_string_array(List value) | - -## HeaderParametersMap -public static class HeaderParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [HeaderParametersMap](#headerparametersmap) | of([Map](#headerparametersmapbuilder) arg, SchemaConfiguration configuration) | -| String | enum_header_string()
[optional] | -| [Schema0.SchemaList0](../../../paths/fake/get/parameters/parameter0/Schema0.md#schemalist0) | enum_header_string_array()
[optional] | - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fake/get/QueryParameters.md b/samples/client/petstore/java/docs/paths/fake/get/QueryParameters.md deleted file mode 100644 index a15587d326b..00000000000 --- a/samples/client/petstore/java/docs/paths/fake/get/QueryParameters.md +++ /dev/null @@ -1,278 +0,0 @@ -# QueryParameters -public class QueryParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [QueryParameters.QueryParameters1Boxed](#queryparameters1boxed)
sealed interface for validated payloads | -| record | [QueryParameters.QueryParameters1BoxedMap](#queryparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [QueryParameters.QueryParameters1](#queryparameters1)
schema class | -| static class | [QueryParameters.QueryParametersMapBuilder](#queryparametersmapbuilder)
builder for Map payloads | -| static class | [QueryParameters.QueryParametersMap](#queryparametersmap)
output class for Map payloads | -| sealed interface | [QueryParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [QueryParameters.AdditionalProperties](#additionalproperties)
schema class | - -## QueryParameters1Boxed -public sealed interface QueryParameters1Boxed
-permits
-[QueryParameters1BoxedMap](#queryparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## QueryParameters1BoxedMap -public record QueryParameters1BoxedMap
-implements [QueryParameters1Boxed](#queryparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParameters1BoxedMap([QueryParametersMap](#queryparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap](#queryparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## QueryParameters1 -public static class QueryParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fake.get.QueryParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -QueryParameters.QueryParametersMap validatedPayload = - QueryParameters.QueryParameters1.validate( - new QueryParameters.QueryParametersMapBuilder() - .enum_query_double(3.14d) - - .enum_query_string("_abc") - - .enum_query_integer(1) - - .enum_query_string_array( - Arrays.asList( - ">" - ) - ) - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("enum_query_double", [Schema5.Schema51.class](../../../paths/fake/get/parameters/parameter5/Schema5.md#schema51)),
    new PropertyEntry("enum_query_string", [Schema3.Schema31.class](../../../paths/fake/get/parameters/parameter3/Schema3.md#schema31)),
    new PropertyEntry("enum_query_integer", [Schema4.Schema41.class](../../../paths/fake/get/parameters/parameter4/Schema4.md#schema41)),
    new PropertyEntry("enum_query_string_array", [Schema2.Schema21.class](../../../paths/fake/get/parameters/parameter2/Schema2.md#schema21))
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap](#queryparametersmap) | validate([Map<?, ?>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [QueryParameters1BoxedMap](#queryparameters1boxedmap) | validateAndBox([Map<?, ?>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [QueryParameters1Boxed](#queryparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## QueryParametersMapBuilder -public class QueryParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | enum_query_double(int value) | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | enum_query_double(float value) | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | enum_query_double(long value) | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | enum_query_double(double value) | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | enum_query_double([Schema5.DoubleSchemaEnums5](../../../paths/fake/get/parameters/parameter5/Schema5.md#doubleschemaenums5) value) | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | enum_query_double([Schema5.FloatSchemaEnums5](../../../paths/fake/get/parameters/parameter5/Schema5.md#floatschemaenums5) value) | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | enum_query_string(String value) | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | enum_query_string([Schema3.StringSchemaEnums3](../../../paths/fake/get/parameters/parameter3/Schema3.md#stringschemaenums3) value) | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | enum_query_integer(int value) | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | enum_query_integer(float value) | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | enum_query_integer([Schema4.IntegerSchemaEnums4](../../../paths/fake/get/parameters/parameter4/Schema4.md#integerschemaenums4) value) | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | enum_query_integer([Schema4.LongSchemaEnums4](../../../paths/fake/get/parameters/parameter4/Schema4.md#longschemaenums4) value) | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | enum_query_integer([Schema4.FloatSchemaEnums4](../../../paths/fake/get/parameters/parameter4/Schema4.md#floatschemaenums4) value) | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | enum_query_integer([Schema4.DoubleSchemaEnums4](../../../paths/fake/get/parameters/parameter4/Schema4.md#doubleschemaenums4) value) | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | enum_query_string_array(List value) | - -## QueryParametersMap -public static class QueryParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [QueryParametersMap](#queryparametersmap) | of([Map](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| Number | enum_query_double()
[optional] | -| String | enum_query_string()
[optional] | -| Number | enum_query_integer()
[optional] | -| [Schema2.SchemaList2](../../../paths/fake/get/parameters/parameter2/Schema2.md#schemalist2) | enum_query_string_array()
[optional] | - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fake/get/RequestBody.md b/samples/client/petstore/java/docs/paths/fake/get/RequestBody.md deleted file mode 100644 index f65e52d102c..00000000000 --- a/samples/client/petstore/java/docs/paths/fake/get/RequestBody.md +++ /dev/null @@ -1,90 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.ApplicationxwwwformurlencodedMediaType](#applicationxwwwformurlencodedmediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.ApplicationxwwwformurlencodedRequestBody](#applicationxwwwformurlencodedrequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationxwwwformurlencodedMediaType](#applicationxwwwformurlencodedmediatype) - -sealed interface that stores schema and encoding info - - -## ApplicationxwwwformurlencodedMediaType -public record ApplicationxwwwformurlencodedMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1](../../../paths/fake/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationxwwwformurlencodedMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1](../../../paths/fake/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = false
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/x-www-form-urlencoded", new [ApplicationxwwwformurlencodedMediaType](#applicationxwwwformurlencodedmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[ApplicationxwwwformurlencodedRequestBody](#applicationxwwwformurlencodedrequestbody) - -sealed interface that stores request contentType + validated schema data - -## ApplicationxwwwformurlencodedRequestBody -public record ApplicationxwwwformurlencodedRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="application/x-www-form-urlencoded" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationxwwwformurlencodedRequestBody(ApplicationxwwwformurlencodedSchema.[ApplicationxwwwformurlencodedSchema1Boxed](../../../paths/fake/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "application/x-www-form-urlencoded" | -| ApplicationxwwwformurlencodedSchema.[ApplicationxwwwformurlencodedSchema1Boxed](../../../paths/fake/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fake/get/Responses.md b/samples/client/petstore/java/docs/paths/fake/get/Responses.md deleted file mode 100644 index d4bf4fdb8f5..00000000000 --- a/samples/client/petstore/java/docs/paths/fake/get/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fake/get/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fake/get/responses/Code200Response.md deleted file mode 100644 index e89c75b2e12..00000000000 --- a/samples/client/petstore/java/docs/paths/fake/get/responses/Code200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# Code200Response - -public class Code200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) - -A class (extended from the $ref class) that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## Code200Response1 -public static class Code200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
- -a class that deserializes responses, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/fake/get/responses/Code404Response.md b/samples/client/petstore/java/docs/paths/fake/get/responses/Code404Response.md deleted file mode 100644 index 4c15662e637..00000000000 --- a/samples/client/petstore/java/docs/paths/fake/get/responses/Code404Response.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code404Response - -public class Code404Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code404Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code404Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code404Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code404Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code404Response.Code404Response1](#code404response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fake/get/responses/code404response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fake/get/responses/code404response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.MapJsonSchema1Boxed body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.MapJsonSchema1Boxed | body()
returns the body passed in in the constructor | - -## Code404Response1 -public static class Code404Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code404Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fake/get/responses/FakeGetCode200Response.md b/samples/client/petstore/java/docs/paths/fake/get/responses/FakeGetCode200Response.md new file mode 100644 index 00000000000..e22d671a474 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fake/get/responses/FakeGetCode200Response.md @@ -0,0 +1,17 @@ +# FakeGetCode200Response + +public class FakeGetCode200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) + +A class (extended from the $ref class) that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [FakeGetCode200Response.FakeGetCode200Response1](#fakegetcode200response1)
class that deserializes responses | + +## FakeGetCode200Response1 +public static class FakeGetCode200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
+ +a class that deserializes responses, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/fake/get/responses/FakeGetCode404Response.md b/samples/client/petstore/java/docs/paths/fake/get/responses/FakeGetCode404Response.md new file mode 100644 index 00000000000..2bfdf12aa75 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fake/get/responses/FakeGetCode404Response.md @@ -0,0 +1,87 @@ +# FakeGetCode404Response + +public class FakeGetCode404Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakeGetCode404Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakeGetCode404Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakeGetCode404Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakeGetCode404Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [FakeGetCode404Response.FakeGetCode404Response1](#fakegetcode404response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fake/get/responses/code404response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fake/get/responses/code404response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.MapJsonSchema1Boxed body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.MapJsonSchema1Boxed | body()
returns the body passed in in the constructor | + +## FakeGetCode404Response1 +public static class FakeGetCode404Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeGetCode404Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fake/patch/FakePatchRequestBody.md b/samples/client/petstore/java/docs/paths/fake/patch/FakePatchRequestBody.md new file mode 100644 index 00000000000..3f33af4fba5 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fake/patch/FakePatchRequestBody.md @@ -0,0 +1,17 @@ +# FakePatchRequestBody + +public class FakePatchRequestBody extends [Client](../../../components/requestbodies/Client.md) + +A class (extended from the $ref class) that contains necessary nested request body classes +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [FakePatchRequestBody.FakePatchRequestBody1](#fakepatchrequestbody1)
class that serializes request bodies | + +## FakePatchRequestBody1 +public static class FakePatchRequestBody1 extends [Client1](../../../components/requestbodies/Client.md#client1)
+ +a class that serializes SealedRequestBody request bodies, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/fake/patch/FakePatchResponses.md b/samples/client/petstore/java/docs/paths/fake/patch/FakePatchResponses.md new file mode 100644 index 00000000000..82fcf7cfd43 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fake/patch/FakePatchResponses.md @@ -0,0 +1,29 @@ +# FakePatchResponses + +public class FakePatchResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakePatchCode200Response](#endpointfakepatchcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakePatchCode200Response](#endpointfakepatchcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakePatchCode200Response +public record EndpointFakePatchCode200Response( + HttpResponse response, + [FakePatchCode200Response.SealedResponseBody](../../../paths/fake/patch/responses/FakePatchCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fake/patch/RequestBody.md b/samples/client/petstore/java/docs/paths/fake/patch/RequestBody.md deleted file mode 100644 index 72d0a1a3ced..00000000000 --- a/samples/client/petstore/java/docs/paths/fake/patch/RequestBody.md +++ /dev/null @@ -1,17 +0,0 @@ -# RequestBody - -public class RequestBody extends [Client](../../../components/requestbodies/Client.md) - -A class (extended from the $ref class) that contains necessary nested request body classes -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | - -## RequestBody1 -public static class RequestBody1 extends [Client1](../../../components/requestbodies/Client.md#client1)
- -a class that serializes SealedRequestBody request bodies, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/fake/patch/Responses.md b/samples/client/petstore/java/docs/paths/fake/patch/Responses.md deleted file mode 100644 index d537a70a5a6..00000000000 --- a/samples/client/petstore/java/docs/paths/fake/patch/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/fake/patch/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fake/patch/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fake/patch/responses/Code200Response.md deleted file mode 100644 index 0624bf61d5f..00000000000 --- a/samples/client/petstore/java/docs/paths/fake/patch/responses/Code200Response.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fake/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fake/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.[Client1Boxed](../../../../components/schemas/Client.md#client1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.[Client1Boxed](../../../../components/schemas/Client.md#client1boxed) | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fake/patch/responses/FakePatchCode200Response.md b/samples/client/petstore/java/docs/paths/fake/patch/responses/FakePatchCode200Response.md new file mode 100644 index 00000000000..15e710e9dbb --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fake/patch/responses/FakePatchCode200Response.md @@ -0,0 +1,87 @@ +# FakePatchCode200Response + +public class FakePatchCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakePatchCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakePatchCode200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakePatchCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakePatchCode200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [FakePatchCode200Response.FakePatchCode200Response1](#fakepatchcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fake/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fake/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.[Client1Boxed](../../../../components/schemas/Client.md#client1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.[Client1Boxed](../../../../components/schemas/Client.md#client1boxed) | body()
returns the body passed in in the constructor | + +## FakePatchCode200Response1 +public static class FakePatchCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakePatchCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fake/post/FakePostRequestBody.md b/samples/client/petstore/java/docs/paths/fake/post/FakePostRequestBody.md new file mode 100644 index 00000000000..4cb4e7994be --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fake/post/FakePostRequestBody.md @@ -0,0 +1,90 @@ +# FakePostRequestBody + +public class FakePostRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakePostRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakePostRequestBody.ApplicationxwwwformurlencodedMediaType](#applicationxwwwformurlencodedmediatype)
record storing schema + encoding for a specific contentType | +| static class | [FakePostRequestBody.FakePostRequestBody1](#fakepostrequestbody1)
class that serializes request bodies | +| sealed interface | [FakePostRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [FakePostRequestBody.ApplicationxwwwformurlencodedRequestBody](#applicationxwwwformurlencodedrequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationxwwwformurlencodedMediaType](#applicationxwwwformurlencodedmediatype) + +sealed interface that stores schema and encoding info + + +## ApplicationxwwwformurlencodedMediaType +public record ApplicationxwwwformurlencodedMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1](../../../paths/fake/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationxwwwformurlencodedMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1](../../../paths/fake/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## FakePostRequestBody1 +public static class FakePostRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakePostRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = false
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/x-www-form-urlencoded", new [ApplicationxwwwformurlencodedMediaType](#applicationxwwwformurlencodedmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[ApplicationxwwwformurlencodedRequestBody](#applicationxwwwformurlencodedrequestbody) + +sealed interface that stores request contentType + validated schema data + +## ApplicationxwwwformurlencodedRequestBody +public record ApplicationxwwwformurlencodedRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="application/x-www-form-urlencoded" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationxwwwformurlencodedRequestBody(ApplicationxwwwformurlencodedSchema.[ApplicationxwwwformurlencodedSchema1Boxed](../../../paths/fake/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "application/x-www-form-urlencoded" | +| ApplicationxwwwformurlencodedSchema.[ApplicationxwwwformurlencodedSchema1Boxed](../../../paths/fake/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fake/post/FakePostResponses.md b/samples/client/petstore/java/docs/paths/fake/post/FakePostResponses.md new file mode 100644 index 00000000000..a5bb926cd94 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fake/post/FakePostResponses.md @@ -0,0 +1,29 @@ +# FakePostResponses + +public class FakePostResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakePostCode200Response](#endpointfakepostcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakePostCode200Response](#endpointfakepostcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakePostCode200Response +public record EndpointFakePostCode200Response( + HttpResponse response, + Void body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fake/post/RequestBody.md b/samples/client/petstore/java/docs/paths/fake/post/RequestBody.md deleted file mode 100644 index 0b707158f4f..00000000000 --- a/samples/client/petstore/java/docs/paths/fake/post/RequestBody.md +++ /dev/null @@ -1,90 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.ApplicationxwwwformurlencodedMediaType](#applicationxwwwformurlencodedmediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.ApplicationxwwwformurlencodedRequestBody](#applicationxwwwformurlencodedrequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationxwwwformurlencodedMediaType](#applicationxwwwformurlencodedmediatype) - -sealed interface that stores schema and encoding info - - -## ApplicationxwwwformurlencodedMediaType -public record ApplicationxwwwformurlencodedMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1](../../../paths/fake/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationxwwwformurlencodedMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1](../../../paths/fake/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = false
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/x-www-form-urlencoded", new [ApplicationxwwwformurlencodedMediaType](#applicationxwwwformurlencodedmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[ApplicationxwwwformurlencodedRequestBody](#applicationxwwwformurlencodedrequestbody) - -sealed interface that stores request contentType + validated schema data - -## ApplicationxwwwformurlencodedRequestBody -public record ApplicationxwwwformurlencodedRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="application/x-www-form-urlencoded" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationxwwwformurlencodedRequestBody(ApplicationxwwwformurlencodedSchema.[ApplicationxwwwformurlencodedSchema1Boxed](../../../paths/fake/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "application/x-www-form-urlencoded" | -| ApplicationxwwwformurlencodedSchema.[ApplicationxwwwformurlencodedSchema1Boxed](../../../paths/fake/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fake/post/Responses.md b/samples/client/petstore/java/docs/paths/fake/post/Responses.md deleted file mode 100644 index d4bf4fdb8f5..00000000000 --- a/samples/client/petstore/java/docs/paths/fake/post/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fake/post/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fake/post/responses/Code200Response.md deleted file mode 100644 index e89c75b2e12..00000000000 --- a/samples/client/petstore/java/docs/paths/fake/post/responses/Code200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# Code200Response - -public class Code200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) - -A class (extended from the $ref class) that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## Code200Response1 -public static class Code200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
- -a class that deserializes responses, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/fake/post/responses/Code404Response.md b/samples/client/petstore/java/docs/paths/fake/post/responses/Code404Response.md deleted file mode 100644 index ee00cd369a7..00000000000 --- a/samples/client/petstore/java/docs/paths/fake/post/responses/Code404Response.md +++ /dev/null @@ -1,32 +0,0 @@ -# Code404Response - -public class Code404Response - -A class that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code404Response.Code404Response1](#code404response1)
class that deserializes responses | - -## Code404Response1 -public static class Code404Response1
-extends ResponseDeserializer - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code404Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = MapUtils.makeMap(
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fake/post/responses/FakePostCode200Response.md b/samples/client/petstore/java/docs/paths/fake/post/responses/FakePostCode200Response.md new file mode 100644 index 00000000000..3e3ca088f80 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fake/post/responses/FakePostCode200Response.md @@ -0,0 +1,17 @@ +# FakePostCode200Response + +public class FakePostCode200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) + +A class (extended from the $ref class) that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [FakePostCode200Response.FakePostCode200Response1](#fakepostcode200response1)
class that deserializes responses | + +## FakePostCode200Response1 +public static class FakePostCode200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
+ +a class that deserializes responses, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/fake/post/responses/FakePostCode404Response.md b/samples/client/petstore/java/docs/paths/fake/post/responses/FakePostCode404Response.md new file mode 100644 index 00000000000..8bc289f2bd3 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fake/post/responses/FakePostCode404Response.md @@ -0,0 +1,32 @@ +# FakePostCode404Response + +public class FakePostCode404Response + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [FakePostCode404Response.FakePostCode404Response1](#fakepostcode404response1)
class that deserializes responses | + +## FakePostCode404Response1 +public static class FakePostCode404Response1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakePostCode404Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/FakeadditionalpropertieswitharrayofenumsGet.md b/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/FakeadditionalpropertieswitharrayofenumsGet.md new file mode 100644 index 00000000000..f4f97ce49de --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/FakeadditionalpropertieswitharrayofenumsGet.md @@ -0,0 +1,145 @@ +# FakeadditionalpropertieswitharrayofenumsGet + +public class FakeadditionalpropertieswitharrayofenumsGet + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Get](#get)
The class that has a get method to call the endpoint | +| interface | [AdditionalPropertiesWithArrayOfEnumsOperation](#additionalpropertieswitharrayofenumsoperation)
The interface that has a additionalPropertiesWithArrayOfEnums method to call the endpoint | +| static class | [GetRequest](#getrequest)
The request inputs class | +| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | + +## Get +public static class Get extends ApiClient.ApiClient1 implements GetOperation
+ +a class that allows one to call the endpoint using a method named get + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get.FakeadditionalpropertieswitharrayofenumsGetRequestBody; +import org.openapijsonschematools.client.components.schemas.AdditionalPropertiesWithArrayOfEnums; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get.responses.FakeadditionalpropertieswitharrayofenumsGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.FakeadditionalpropertieswitharrayofenumsGet; +import org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get.FakeadditionalpropertieswitharrayofenumsGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakeadditionalpropertieswitharrayofenumsGet.Get apiClient = new FakeadditionalpropertieswitharrayofenumsGet.Get(apiConfiguration, schemaConfiguration); + + +var request = new FakeadditionalpropertieswitharrayofenumsGet.GetRequestBuilder().build(); + +FakeadditionalpropertieswitharrayofenumsGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeadditionalpropertieswitharrayofenumsGetResponses.EndpointFakeadditionalpropertieswitharrayofenumsGetCode200Response castResponse = (FakeadditionalpropertieswitharrayofenumsGetResponses.EndpointFakeadditionalpropertieswitharrayofenumsGetCode200Response) response; +FakeadditionalpropertieswitharrayofenumsGetCode200Response.ApplicationjsonResponseBody deserializedBody = (FakeadditionalpropertieswitharrayofenumsGetCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeadditionalpropertieswitharrayofenumsGetResponses.EndpointResponse](../../paths/fakeadditionalpropertieswitharrayofenums/get/FakeadditionalpropertieswitharrayofenumsGetResponses.md#endpointresponse) | get([GetRequest](#getrequest) request) | + +## AdditionalPropertiesWithArrayOfEnumsOperation +public interface AdditionalPropertiesWithArrayOfEnumsOperation
+ +an interface that allows one to call the endpoint using a method named additionalPropertiesWithArrayOfEnums by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeadditionalpropertieswitharrayofenumsGetResponses.EndpointResponse](../../paths/fakeadditionalpropertieswitharrayofenums/get/FakeadditionalpropertieswitharrayofenumsGetResponses.md#endpointresponse) | additionalPropertiesWithArrayOfEnums([GetRequest](#getrequest) request) | + +## GetRequest +public static class GetRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakeadditionalpropertieswitharrayofenumsGetRequestBody.@Nullable SealedRequestBody](../../paths/fakeadditionalpropertieswitharrayofenums/get/FakeadditionalpropertieswitharrayofenumsGetRequestBody.md#sealedrequestbody) | requestBody
optional | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## GetRequestBuilder +public static class GetRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| GetRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | +| [GetRequestBuilder](#getrequestbuilder) | requestBody([FakeadditionalpropertieswitharrayofenumsGetRequestBody.SealedRequestBody](../../paths/fakeadditionalpropertieswitharrayofenums/get/FakeadditionalpropertieswitharrayofenumsGetRequestBody.md#sealedrequestbody) requestBody)
sets the optional property | +| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/Get.md b/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/Get.md deleted file mode 100644 index 3e2e0cb0ac1..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/Get.md +++ /dev/null @@ -1,134 +0,0 @@ -# Get - -public class Get - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Get1](#get1)
The class that has a get method to call the endpoint | -| static class | [GetRequest](#getrequest)
The request inputs class | -| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | - -## Get1 -public static class Get1 extends ApiClient.ApiClient1 implements GetOperation
- -a class that allows one to call the endpoint using a method named get - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get.RequestBody; -import org.openapijsonschematools.client.components.schemas.AdditionalPropertiesWithArrayOfEnums; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.Get; -import org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Get.Get1 apiClient = new Get.Get1(apiConfiguration, schemaConfiguration); - - -var request = new GetRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.get(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -Code200Response.ApplicationjsonResponseBody deserializedBody = (Code200Response.ApplicationjsonResponseBody) castResponse.body; -// handle deserialized body here -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakeadditionalpropertieswitharrayofenums/get/Responses.md#endpointresponse) | get([GetRequest](#getrequest) request) | - -## GetRequest -public static class GetRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fakeadditionalpropertieswitharrayofenums/get/RequestBody.md#sealedrequestbody) | requestBody
optional | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## GetRequestBuilder -public static class GetRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| GetRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | -| [GetRequestBuilder](#getrequestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/fakeadditionalpropertieswitharrayofenums/get/RequestBody.md#sealedrequestbody) requestBody)
sets the optional property | -| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/get/FakeadditionalpropertieswitharrayofenumsGetRequestBody.md b/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/get/FakeadditionalpropertieswitharrayofenumsGetRequestBody.md new file mode 100644 index 00000000000..6bbac40d22f --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/get/FakeadditionalpropertieswitharrayofenumsGetRequestBody.md @@ -0,0 +1,90 @@ +# FakeadditionalpropertieswitharrayofenumsGetRequestBody + +public class FakeadditionalpropertieswitharrayofenumsGetRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakeadditionalpropertieswitharrayofenumsGetRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakeadditionalpropertieswitharrayofenumsGetRequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| static class | [FakeadditionalpropertieswitharrayofenumsGetRequestBody.FakeadditionalpropertieswitharrayofenumsGetRequestBody1](#fakeadditionalpropertieswitharrayofenumsgetrequestbody1)
class that serializes request bodies | +| sealed interface | [FakeadditionalpropertieswitharrayofenumsGetRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [FakeadditionalpropertieswitharrayofenumsGetRequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakeadditionalpropertieswitharrayofenums/get/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakeadditionalpropertieswitharrayofenums/get/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## FakeadditionalpropertieswitharrayofenumsGetRequestBody1 +public static class FakeadditionalpropertieswitharrayofenumsGetRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeadditionalpropertieswitharrayofenumsGetRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = false
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[ApplicationjsonRequestBody](#applicationjsonrequestbody) + +sealed interface that stores request contentType + validated schema data + +## ApplicationjsonRequestBody +public record ApplicationjsonRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonRequestBody(ApplicationjsonSchema.[AdditionalPropertiesWithArrayOfEnums1Boxed](../../../components/schemas/AdditionalPropertiesWithArrayOfEnums.md#additionalpropertieswitharrayofenums1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "application/json" | +| ApplicationjsonSchema.[AdditionalPropertiesWithArrayOfEnums1Boxed](../../../components/schemas/AdditionalPropertiesWithArrayOfEnums.md#additionalpropertieswitharrayofenums1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/get/FakeadditionalpropertieswitharrayofenumsGetResponses.md b/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/get/FakeadditionalpropertieswitharrayofenumsGetResponses.md new file mode 100644 index 00000000000..7c3bbeb85dc --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/get/FakeadditionalpropertieswitharrayofenumsGetResponses.md @@ -0,0 +1,29 @@ +# FakeadditionalpropertieswitharrayofenumsGetResponses + +public class FakeadditionalpropertieswitharrayofenumsGetResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakeadditionalpropertieswitharrayofenumsGetCode200Response](#endpointfakeadditionalpropertieswitharrayofenumsgetcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakeadditionalpropertieswitharrayofenumsGetCode200Response](#endpointfakeadditionalpropertieswitharrayofenumsgetcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakeadditionalpropertieswitharrayofenumsGetCode200Response +public record EndpointFakeadditionalpropertieswitharrayofenumsGetCode200Response( + HttpResponse response, + [FakeadditionalpropertieswitharrayofenumsGetCode200Response.SealedResponseBody](../../../paths/fakeadditionalpropertieswitharrayofenums/get/responses/FakeadditionalpropertieswitharrayofenumsGetCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/get/RequestBody.md b/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/get/RequestBody.md deleted file mode 100644 index 1619a3e89be..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/get/RequestBody.md +++ /dev/null @@ -1,90 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakeadditionalpropertieswitharrayofenums/get/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakeadditionalpropertieswitharrayofenums/get/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = false
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[ApplicationjsonRequestBody](#applicationjsonrequestbody) - -sealed interface that stores request contentType + validated schema data - -## ApplicationjsonRequestBody -public record ApplicationjsonRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonRequestBody(ApplicationjsonSchema.[AdditionalPropertiesWithArrayOfEnums1Boxed](../../../components/schemas/AdditionalPropertiesWithArrayOfEnums.md#additionalpropertieswitharrayofenums1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "application/json" | -| ApplicationjsonSchema.[AdditionalPropertiesWithArrayOfEnums1Boxed](../../../components/schemas/AdditionalPropertiesWithArrayOfEnums.md#additionalpropertieswitharrayofenums1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/get/Responses.md b/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/get/Responses.md deleted file mode 100644 index 6adb55f074f..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/get/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/fakeadditionalpropertieswitharrayofenums/get/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/get/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/get/responses/Code200Response.md deleted file mode 100644 index dab98f5c670..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/get/responses/Code200Response.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakeadditionalpropertieswitharrayofenums/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakeadditionalpropertieswitharrayofenums/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.[AdditionalPropertiesWithArrayOfEnums1Boxed](../../../../components/schemas/AdditionalPropertiesWithArrayOfEnums.md#additionalpropertieswitharrayofenums1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.[AdditionalPropertiesWithArrayOfEnums1Boxed](../../../../components/schemas/AdditionalPropertiesWithArrayOfEnums.md#additionalpropertieswitharrayofenums1boxed) | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/get/responses/FakeadditionalpropertieswitharrayofenumsGetCode200Response.md b/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/get/responses/FakeadditionalpropertieswitharrayofenumsGetCode200Response.md new file mode 100644 index 00000000000..14134525aa5 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeadditionalpropertieswitharrayofenums/get/responses/FakeadditionalpropertieswitharrayofenumsGetCode200Response.md @@ -0,0 +1,87 @@ +# FakeadditionalpropertieswitharrayofenumsGetCode200Response + +public class FakeadditionalpropertieswitharrayofenumsGetCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakeadditionalpropertieswitharrayofenumsGetCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakeadditionalpropertieswitharrayofenumsGetCode200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakeadditionalpropertieswitharrayofenumsGetCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakeadditionalpropertieswitharrayofenumsGetCode200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [FakeadditionalpropertieswitharrayofenumsGetCode200Response.FakeadditionalpropertieswitharrayofenumsGetCode200Response1](#fakeadditionalpropertieswitharrayofenumsgetcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakeadditionalpropertieswitharrayofenums/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakeadditionalpropertieswitharrayofenums/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.[AdditionalPropertiesWithArrayOfEnums1Boxed](../../../../components/schemas/AdditionalPropertiesWithArrayOfEnums.md#additionalpropertieswitharrayofenums1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.[AdditionalPropertiesWithArrayOfEnums1Boxed](../../../../components/schemas/AdditionalPropertiesWithArrayOfEnums.md#additionalpropertieswitharrayofenums1boxed) | body()
returns the body passed in in the constructor | + +## FakeadditionalpropertieswitharrayofenumsGetCode200Response1 +public static class FakeadditionalpropertieswitharrayofenumsGetCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeadditionalpropertieswitharrayofenumsGetCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakebodywithfileschema/FakebodywithfileschemaPut.md b/samples/client/petstore/java/docs/paths/fakebodywithfileschema/FakebodywithfileschemaPut.md new file mode 100644 index 00000000000..24abe638613 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakebodywithfileschema/FakebodywithfileschemaPut.md @@ -0,0 +1,185 @@ +# FakebodywithfileschemaPut + +public class FakebodywithfileschemaPut + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Put](#put)
The class that has a put method to call the endpoint | +| interface | [BodyWithFileSchemaOperation](#bodywithfileschemaoperation)
The interface that has a bodyWithFileSchema method to call the endpoint | +| static class | [PutRequest](#putrequest)
The final request inputs class | +| static class | [PutNullableRequest](#putnullablerequest)
The initial request inputs class | +| static class | [Put0RequestBuilder](#put0requestbuilder)
A builder for the request input class | +| static class | [PutRequestBuilder](#putrequestbuilder)
A builder for the request input class | + +## Put +public static class Put extends ApiClient.ApiClient1 implements PutOperation
+ +a class that allows one to call the endpoint using a method named put + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakebodywithfileschema.put.FakebodywithfileschemaPutRequestBody; +import org.openapijsonschematools.client.components.schemas.FileSchemaTestClass; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakebodywithfileschema.put.responses.FakebodywithfileschemaPutCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakebodywithfileschema.FakebodywithfileschemaPut; +import org.openapijsonschematools.client.paths.fakebodywithfileschema.put.FakebodywithfileschemaPutResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakebodywithfileschemaPut.Put apiClient = new FakebodywithfileschemaPut.Put(apiConfiguration, schemaConfiguration); + + +FileSchemaTestClass1BoxedMap requestBodyPayload = + FileSchemaTestClass.FileSchemaTestClass1.validateAndBox( + new FileSchemaTestClass.FileSchemaTestClassMapBuilder() + .files( + Arrays.asList( + ) + ) + .build(), + schemaConfiguration +); +FakebodywithfileschemaPut.SealedRequestBody requestBody = new FakebodywithfileschemaPut.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new FakebodywithfileschemaPut.PutRequestBuilder() + .requestBody(requestBody) + .build(); + +FakebodywithfileschemaPutResponses.EndpointResponse response; +try { + response = apiClient.put(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakebodywithfileschemaPutResponses.EndpointFakebodywithfileschemaPutCode200Response castResponse = (FakebodywithfileschemaPutResponses.EndpointFakebodywithfileschemaPutCode200Response) response; +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Put(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakebodywithfileschemaPutResponses.EndpointResponse](../../paths/fakebodywithfileschema/put/FakebodywithfileschemaPutResponses.md#endpointresponse) | put([PutRequest](#putrequest) request) | + +## BodyWithFileSchemaOperation +public interface BodyWithFileSchemaOperation
+ +an interface that allows one to call the endpoint using a method named bodyWithFileSchema by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakebodywithfileschemaPutResponses.EndpointResponse](../../paths/fakebodywithfileschema/put/FakebodywithfileschemaPutResponses.md#endpointresponse) | bodyWithFileSchema([PutRequest](#putrequest) request) | + +## PutRequest +public static class PutRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakebodywithfileschemaPutRequestBody.SealedRequestBody](../../paths/fakebodywithfileschema/put/FakebodywithfileschemaPutRequestBody.md#sealedrequestbody) | requestBody | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PutNullableRequest +public static class PutNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakebodywithfileschemaPutRequestBody.@Nullable SealedRequestBody](../../paths/fakebodywithfileschema/put/FakebodywithfileschemaPutRequestBody.md#sealedrequestbody) | requestBody | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| @Nullable Duration | timeout | + +## Put0RequestBuilder +public static class Put0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Put0RequestBuilder(Put0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PutRequest](#putrequest) | build()
Returns the request input used to call an endpoint method | +| [Put0RequestBuilder](#put0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Put0RequestBuilder](#put0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## PutRequestBuilder +public static class PutRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PutRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Put0RequestBuilder](#put0requestbuilder) | requestBody([FakebodywithfileschemaPutRequestBody.SealedRequestBody](../../paths/fakebodywithfileschema/put/FakebodywithfileschemaPutRequestBody.md#sealedrequestbody) requestBody)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakebodywithfileschema/Put.md b/samples/client/petstore/java/docs/paths/fakebodywithfileschema/Put.md deleted file mode 100644 index 1f440144acf..00000000000 --- a/samples/client/petstore/java/docs/paths/fakebodywithfileschema/Put.md +++ /dev/null @@ -1,174 +0,0 @@ -# Put - -public class Put - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Put1](#put1)
The class that has a put method to call the endpoint | -| static class | [PutRequest](#putrequest)
The final request inputs class | -| static class | [PutNullableRequest](#putnullablerequest)
The initial request inputs class | -| static class | [Put0RequestBuilder](#put0requestbuilder)
A builder for the request input class | -| static class | [PutRequestBuilder](#putrequestbuilder)
A builder for the request input class | - -## Put1 -public static class Put1 extends ApiClient.ApiClient1 implements PutOperation
- -a class that allows one to call the endpoint using a method named put - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakebodywithfileschema.put.RequestBody; -import org.openapijsonschematools.client.components.schemas.FileSchemaTestClass; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakebodywithfileschema.put.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakebodywithfileschema.Put; -import org.openapijsonschematools.client.paths.fakebodywithfileschema.put.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Put.Put1 apiClient = new Put.Put1(apiConfiguration, schemaConfiguration); - - -FileSchemaTestClass1BoxedMap requestBodyPayload = - FileSchemaTestClass.FileSchemaTestClass1.validateAndBox( - new FileSchemaTestClass.FileSchemaTestClassMapBuilder() - .files( - Arrays.asList( - ) - ) - .build(), - schemaConfiguration -); -Put.SealedRequestBody requestBody = new Put.ApplicationjsonRequestBody(requestBodyPayload); - -var request = new PutRequestBuilder() - .requestBody(requestBody) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.put(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Put1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakebodywithfileschema/put/Responses.md#endpointresponse) | put([PutRequest](#putrequest) request) | - -## PutRequest -public static class PutRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.SealedRequestBody](../../paths/fakebodywithfileschema/put/RequestBody.md#sealedrequestbody) | requestBody | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PutNullableRequest -public static class PutNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fakebodywithfileschema/put/RequestBody.md#sealedrequestbody) | requestBody | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| @Nullable Duration | timeout | - -## Put0RequestBuilder -public static class Put0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Put0RequestBuilder(Put0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PutRequest](#putrequest) | build()
Returns the request input used to call an endpoint method | -| [Put0RequestBuilder](#put0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Put0RequestBuilder](#put0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## PutRequestBuilder -public static class PutRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PutRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Put0RequestBuilder](#put0requestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/fakebodywithfileschema/put/RequestBody.md#sealedrequestbody) requestBody)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakebodywithfileschema/put/FakebodywithfileschemaPutRequestBody.md b/samples/client/petstore/java/docs/paths/fakebodywithfileschema/put/FakebodywithfileschemaPutRequestBody.md new file mode 100644 index 00000000000..6852ab03fce --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakebodywithfileschema/put/FakebodywithfileschemaPutRequestBody.md @@ -0,0 +1,90 @@ +# FakebodywithfileschemaPutRequestBody + +public class FakebodywithfileschemaPutRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakebodywithfileschemaPutRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakebodywithfileschemaPutRequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| static class | [FakebodywithfileschemaPutRequestBody.FakebodywithfileschemaPutRequestBody1](#fakebodywithfileschemaputrequestbody1)
class that serializes request bodies | +| sealed interface | [FakebodywithfileschemaPutRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [FakebodywithfileschemaPutRequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakebodywithfileschema/put/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakebodywithfileschema/put/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## FakebodywithfileschemaPutRequestBody1 +public static class FakebodywithfileschemaPutRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakebodywithfileschemaPutRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = true
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[ApplicationjsonRequestBody](#applicationjsonrequestbody) + +sealed interface that stores request contentType + validated schema data + +## ApplicationjsonRequestBody +public record ApplicationjsonRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonRequestBody(ApplicationjsonSchema.[FileSchemaTestClass1Boxed](../../../components/schemas/FileSchemaTestClass.md#fileschematestclass1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "application/json" | +| ApplicationjsonSchema.[FileSchemaTestClass1Boxed](../../../components/schemas/FileSchemaTestClass.md#fileschematestclass1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakebodywithfileschema/put/FakebodywithfileschemaPutResponses.md b/samples/client/petstore/java/docs/paths/fakebodywithfileschema/put/FakebodywithfileschemaPutResponses.md new file mode 100644 index 00000000000..a1f75ddb0d8 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakebodywithfileschema/put/FakebodywithfileschemaPutResponses.md @@ -0,0 +1,29 @@ +# FakebodywithfileschemaPutResponses + +public class FakebodywithfileschemaPutResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakebodywithfileschemaPutCode200Response](#endpointfakebodywithfileschemaputcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakebodywithfileschemaPutCode200Response](#endpointfakebodywithfileschemaputcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakebodywithfileschemaPutCode200Response +public record EndpointFakebodywithfileschemaPutCode200Response( + HttpResponse response, + Void body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakebodywithfileschema/put/RequestBody.md b/samples/client/petstore/java/docs/paths/fakebodywithfileschema/put/RequestBody.md deleted file mode 100644 index 5184498774c..00000000000 --- a/samples/client/petstore/java/docs/paths/fakebodywithfileschema/put/RequestBody.md +++ /dev/null @@ -1,90 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakebodywithfileschema/put/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakebodywithfileschema/put/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = true
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[ApplicationjsonRequestBody](#applicationjsonrequestbody) - -sealed interface that stores request contentType + validated schema data - -## ApplicationjsonRequestBody -public record ApplicationjsonRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonRequestBody(ApplicationjsonSchema.[FileSchemaTestClass1Boxed](../../../components/schemas/FileSchemaTestClass.md#fileschematestclass1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "application/json" | -| ApplicationjsonSchema.[FileSchemaTestClass1Boxed](../../../components/schemas/FileSchemaTestClass.md#fileschematestclass1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakebodywithfileschema/put/Responses.md b/samples/client/petstore/java/docs/paths/fakebodywithfileschema/put/Responses.md deleted file mode 100644 index d4bf4fdb8f5..00000000000 --- a/samples/client/petstore/java/docs/paths/fakebodywithfileschema/put/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakebodywithfileschema/put/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakebodywithfileschema/put/responses/Code200Response.md deleted file mode 100644 index e89c75b2e12..00000000000 --- a/samples/client/petstore/java/docs/paths/fakebodywithfileschema/put/responses/Code200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# Code200Response - -public class Code200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) - -A class (extended from the $ref class) that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## Code200Response1 -public static class Code200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
- -a class that deserializes responses, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/fakebodywithfileschema/put/responses/FakebodywithfileschemaPutCode200Response.md b/samples/client/petstore/java/docs/paths/fakebodywithfileschema/put/responses/FakebodywithfileschemaPutCode200Response.md new file mode 100644 index 00000000000..7de1a2829fb --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakebodywithfileschema/put/responses/FakebodywithfileschemaPutCode200Response.md @@ -0,0 +1,17 @@ +# FakebodywithfileschemaPutCode200Response + +public class FakebodywithfileschemaPutCode200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) + +A class (extended from the $ref class) that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [FakebodywithfileschemaPutCode200Response.FakebodywithfileschemaPutCode200Response1](#fakebodywithfileschemaputcode200response1)
class that deserializes responses | + +## FakebodywithfileschemaPutCode200Response1 +public static class FakebodywithfileschemaPutCode200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
+ +a class that deserializes responses, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/FakebodywithqueryparamsPut.md b/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/FakebodywithqueryparamsPut.md new file mode 100644 index 00000000000..df5797b9558 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/FakebodywithqueryparamsPut.md @@ -0,0 +1,246 @@ +# FakebodywithqueryparamsPut + +public class FakebodywithqueryparamsPut + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Put](#put)
The class that has a put method to call the endpoint | +| interface | [BodyWithQueryParamsOperation](#bodywithqueryparamsoperation)
The interface that has a bodyWithQueryParams method to call the endpoint | +| static class | [PutRequest](#putrequest)
The final request inputs class | +| static class | [PutNullableRequest](#putnullablerequest)
The initial request inputs class | +| static class | [Put00RequestBuilder](#put00requestbuilder)
A builder for the request input class | +| static class | [Put01RequestBuilder](#put01requestbuilder)
A builder for the request input class | +| static class | [Put10RequestBuilder](#put10requestbuilder)
A builder for the request input class | +| static class | [PutRequestBuilder](#putrequestbuilder)
A builder for the request input class | + +## Put +public static class Put extends ApiClient.ApiClient1 implements PutOperation
+ +a class that allows one to call the endpoint using a method named put + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.FakebodywithqueryparamsPutRequestBody; +import org.openapijsonschematools.client.components.schemas.User; +import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.FakebodywithqueryparamsPutQueryParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.responses.FakebodywithqueryparamsPutCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakebodywithqueryparams.FakebodywithqueryparamsPut; +import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.FakebodywithqueryparamsPutResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakebodywithqueryparamsPut.Put apiClient = new FakebodywithqueryparamsPut.Put(apiConfiguration, schemaConfiguration); + + +User1BoxedMap requestBodyPayload = + User.User1.validateAndBox( + new User.UserMapBuilder() + .id(1L) + + .username("a") + + .firstName("a") + + .lastName("a") + + .email("a") + + .password("a") + + .phone("a") + + .userStatus(1) + + .objectWithNoDeclaredPropsNullable(null) + + .build(), + schemaConfiguration +); +FakebodywithqueryparamsPut.SealedRequestBody requestBody = new FakebodywithqueryparamsPut.ApplicationjsonRequestBody(requestBodyPayload); + +// Map validation +FakebodywithqueryparamsPutQueryParameters.FakebodywithqueryparamsPutQueryParametersMap queryParameters = + FakebodywithqueryparamsPutQueryParameters.FakebodywithqueryparamsPutQueryParameters1.validate( + new FakebodywithqueryparamsPutQueryParameters.FakebodywithqueryparamsPutQueryParametersMapBuilder() + .query("a") + + .build(), + schemaConfiguration +); + +var request = new FakebodywithqueryparamsPut.PutRequestBuilder() + .requestBody(requestBody) + .queryParameters(queryParameters) + .build(); + +FakebodywithqueryparamsPutResponses.EndpointResponse response; +try { + response = apiClient.put(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakebodywithqueryparamsPutResponses.EndpointFakebodywithqueryparamsPutCode200Response castResponse = (FakebodywithqueryparamsPutResponses.EndpointFakebodywithqueryparamsPutCode200Response) response; +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Put(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakebodywithqueryparamsPutResponses.EndpointResponse](../../paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutResponses.md#endpointresponse) | put([PutRequest](#putrequest) request) | + +## BodyWithQueryParamsOperation +public interface BodyWithQueryParamsOperation
+ +an interface that allows one to call the endpoint using a method named bodyWithQueryParams by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakebodywithqueryparamsPutResponses.EndpointResponse](../../paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutResponses.md#endpointresponse) | bodyWithQueryParams([PutRequest](#putrequest) request) | + +## PutRequest +public static class PutRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakebodywithqueryparamsPutRequestBody.SealedRequestBody](../../paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutRequestBody.md#sealedrequestbody) | requestBody | +| [FakebodywithqueryparamsPutQueryParameters.FakebodywithqueryparamsPutQueryParametersMap](../../paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutQueryParameters.md#fakebodywithqueryparamsputqueryparametersmap) | queryParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PutNullableRequest +public static class PutNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakebodywithqueryparamsPutRequestBody.@Nullable SealedRequestBody](../../paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutRequestBody.md#sealedrequestbody) | requestBody | +| [FakebodywithqueryparamsPutQueryParameters.@Nullable FakebodywithqueryparamsPutQueryParametersMap](../../paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutQueryParameters.md#fakebodywithqueryparamsputqueryparametersmap) | queryParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| @Nullable Duration | timeout | + +## Put00RequestBuilder +public static class Put00RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Put00RequestBuilder(Put00RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PutRequest](#putrequest) | build()
Returns the request input used to call an endpoint method | +| [Put00RequestBuilder](#put00requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Put00RequestBuilder](#put00requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## Put01RequestBuilder +public static class Put01RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Put01RequestBuilder(Put01RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Put00RequestBuilder](#put00requestbuilder) | queryParameters([FakebodywithqueryparamsPutQueryParametersFakebodywithqueryparamsPutQueryParametersMap](../../paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutQueryParameters.md#fakebodywithqueryparamsputqueryparametersmap) queryParameters)
sets the property | + +## Put10RequestBuilder +public static class Put10RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Put10RequestBuilder(Put10RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Put00RequestBuilder](#put00requestbuilder) | requestBody([FakebodywithqueryparamsPutRequestBody.SealedRequestBody](../../paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutRequestBody.md#sealedrequestbody) requestBody)
sets the property | + +## PutRequestBuilder +public static class PutRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PutRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Put01RequestBuilder](#put01requestbuilder) | requestBody([FakebodywithqueryparamsPutRequestBody.SealedRequestBody](../../paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutRequestBody.md#sealedrequestbody) requestBody)
sets the property | +| [Put10RequestBuilder](#put10requestbuilder) | queryParameters([FakebodywithqueryparamsPutQueryParametersFakebodywithqueryparamsPutQueryParametersMap](../../paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutQueryParameters.md#fakebodywithqueryparamsputqueryparametersmap) queryParameters)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/Put.md b/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/Put.md deleted file mode 100644 index b1bb899b5a5..00000000000 --- a/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/Put.md +++ /dev/null @@ -1,235 +0,0 @@ -# Put - -public class Put - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Put1](#put1)
The class that has a put method to call the endpoint | -| static class | [PutRequest](#putrequest)
The final request inputs class | -| static class | [PutNullableRequest](#putnullablerequest)
The initial request inputs class | -| static class | [Put00RequestBuilder](#put00requestbuilder)
A builder for the request input class | -| static class | [Put01RequestBuilder](#put01requestbuilder)
A builder for the request input class | -| static class | [Put10RequestBuilder](#put10requestbuilder)
A builder for the request input class | -| static class | [PutRequestBuilder](#putrequestbuilder)
A builder for the request input class | - -## Put1 -public static class Put1 extends ApiClient.ApiClient1 implements PutOperation
- -a class that allows one to call the endpoint using a method named put - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.RequestBody; -import org.openapijsonschematools.client.components.schemas.User; -import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.QueryParameters; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakebodywithqueryparams.Put; -import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Put.Put1 apiClient = new Put.Put1(apiConfiguration, schemaConfiguration); - - -User1BoxedMap requestBodyPayload = - User.User1.validateAndBox( - new User.UserMapBuilder() - .id(1L) - - .username("a") - - .firstName("a") - - .lastName("a") - - .email("a") - - .password("a") - - .phone("a") - - .userStatus(1) - - .objectWithNoDeclaredPropsNullable(null) - - .build(), - schemaConfiguration -); -Put.SealedRequestBody requestBody = new Put.ApplicationjsonRequestBody(requestBodyPayload); - -// Map validation -QueryParameters.QueryParametersMap queryParameters = - QueryParameters.QueryParameters1.validate( - new QueryParameters.QueryParametersMapBuilder() - .query("a") - - .build(), - schemaConfiguration -); - -var request = new PutRequestBuilder() - .requestBody(requestBody) - .queryParameters(queryParameters) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.put(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Put1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakebodywithqueryparams/put/Responses.md#endpointresponse) | put([PutRequest](#putrequest) request) | - -## PutRequest -public static class PutRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.SealedRequestBody](../../paths/fakebodywithqueryparams/put/RequestBody.md#sealedrequestbody) | requestBody | -| [QueryParameters.QueryParametersMap](../../paths/fakebodywithqueryparams/put/QueryParameters.md#queryparametersmap) | queryParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PutNullableRequest -public static class PutNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fakebodywithqueryparams/put/RequestBody.md#sealedrequestbody) | requestBody | -| [QueryParameters.@Nullable QueryParametersMap](../../paths/fakebodywithqueryparams/put/QueryParameters.md#queryparametersmap) | queryParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| @Nullable Duration | timeout | - -## Put00RequestBuilder -public static class Put00RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Put00RequestBuilder(Put00RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PutRequest](#putrequest) | build()
Returns the request input used to call an endpoint method | -| [Put00RequestBuilder](#put00requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Put00RequestBuilder](#put00requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## Put01RequestBuilder -public static class Put01RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Put01RequestBuilder(Put01RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Put00RequestBuilder](#put00requestbuilder) | queryParameters([QueryParametersQueryParametersMap](../../paths/fakebodywithqueryparams/put/QueryParameters.md#queryparametersmap) queryParameters)
sets the property | - -## Put10RequestBuilder -public static class Put10RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Put10RequestBuilder(Put10RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Put00RequestBuilder](#put00requestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/fakebodywithqueryparams/put/RequestBody.md#sealedrequestbody) requestBody)
sets the property | - -## PutRequestBuilder -public static class PutRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PutRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Put01RequestBuilder](#put01requestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/fakebodywithqueryparams/put/RequestBody.md#sealedrequestbody) requestBody)
sets the property | -| [Put10RequestBuilder](#put10requestbuilder) | queryParameters([QueryParametersQueryParametersMap](../../paths/fakebodywithqueryparams/put/QueryParameters.md#queryparametersmap) queryParameters)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutQueryParameters.md b/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutQueryParameters.md new file mode 100644 index 00000000000..2820848ff8d --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutQueryParameters.md @@ -0,0 +1,268 @@ +# FakebodywithqueryparamsPutQueryParameters +public class FakebodywithqueryparamsPutQueryParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [FakebodywithqueryparamsPutQueryParameters.FakebodywithqueryparamsPutQueryParameters1Boxed](#fakebodywithqueryparamsputqueryparameters1boxed)
sealed interface for validated payloads | +| record | [FakebodywithqueryparamsPutQueryParameters.FakebodywithqueryparamsPutQueryParameters1BoxedMap](#fakebodywithqueryparamsputqueryparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [FakebodywithqueryparamsPutQueryParameters.FakebodywithqueryparamsPutQueryParameters1](#fakebodywithqueryparamsputqueryparameters1)
schema class | +| static class | [FakebodywithqueryparamsPutQueryParameters.FakebodywithqueryparamsPutQueryParametersMapBuilder](#fakebodywithqueryparamsputqueryparametersmapbuilder)
builder for Map payloads | +| static class | [FakebodywithqueryparamsPutQueryParameters.FakebodywithqueryparamsPutQueryParametersMap](#fakebodywithqueryparamsputqueryparametersmap)
output class for Map payloads | +| sealed interface | [FakebodywithqueryparamsPutQueryParameters.FakebodywithqueryparamsPutadditionalPropertiesBoxed](#fakebodywithqueryparamsputadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [FakebodywithqueryparamsPutQueryParameters.FakebodywithqueryparamsPutadditionalPropertiesBoxedVoid](#fakebodywithqueryparamsputadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [FakebodywithqueryparamsPutQueryParameters.FakebodywithqueryparamsPutadditionalPropertiesBoxedBoolean](#fakebodywithqueryparamsputadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [FakebodywithqueryparamsPutQueryParameters.FakebodywithqueryparamsPutadditionalPropertiesBoxedNumber](#fakebodywithqueryparamsputadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [FakebodywithqueryparamsPutQueryParameters.FakebodywithqueryparamsPutadditionalPropertiesBoxedString](#fakebodywithqueryparamsputadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [FakebodywithqueryparamsPutQueryParameters.FakebodywithqueryparamsPutadditionalPropertiesBoxedList](#fakebodywithqueryparamsputadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [FakebodywithqueryparamsPutQueryParameters.FakebodywithqueryparamsPutadditionalPropertiesBoxedMap](#fakebodywithqueryparamsputadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [FakebodywithqueryparamsPutQueryParameters.FakebodywithqueryparamsPutadditionalProperties](#fakebodywithqueryparamsputadditionalproperties)
schema class | + +## FakebodywithqueryparamsPutQueryParameters1Boxed +public sealed interface FakebodywithqueryparamsPutQueryParameters1Boxed
+permits
+[FakebodywithqueryparamsPutQueryParameters1BoxedMap](#fakebodywithqueryparamsputqueryparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## FakebodywithqueryparamsPutQueryParameters1BoxedMap +public record FakebodywithqueryparamsPutQueryParameters1BoxedMap
+implements [FakebodywithqueryparamsPutQueryParameters1Boxed](#fakebodywithqueryparamsputqueryparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakebodywithqueryparamsPutQueryParameters1BoxedMap([FakebodywithqueryparamsPutQueryParametersMap](#fakebodywithqueryparamsputqueryparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakebodywithqueryparamsPutQueryParametersMap](#fakebodywithqueryparamsputqueryparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakebodywithqueryparamsPutQueryParameters1 +public static class FakebodywithqueryparamsPutQueryParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.FakebodywithqueryparamsPutQueryParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +FakebodywithqueryparamsPutQueryParameters.FakebodywithqueryparamsPutQueryParametersMap validatedPayload = + FakebodywithqueryparamsPutQueryParameters.FakebodywithqueryparamsPutQueryParameters1.validate( + new FakebodywithqueryparamsPutQueryParameters.FakebodywithqueryparamsPutQueryParametersMapBuilder() + .query("a") + + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("query", [Schema0.Schema01.class](../../../paths/fakebodywithqueryparams/put/parameters/parameter0/Schema0.md#schema01))
)
| +| Set | required = Set.of(
    "query"
)
| +| Class | additionalProperties = [FakebodywithqueryparamsPutadditionalProperties.class](#fakebodywithqueryparamsputadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakebodywithqueryparamsPutQueryParametersMap](#fakebodywithqueryparamsputqueryparametersmap) | validate([Map<?, ?>](#fakebodywithqueryparamsputqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [FakebodywithqueryparamsPutQueryParameters1BoxedMap](#fakebodywithqueryparamsputqueryparameters1boxedmap) | validateAndBox([Map<?, ?>](#fakebodywithqueryparamsputqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [FakebodywithqueryparamsPutQueryParameters1Boxed](#fakebodywithqueryparamsputqueryparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## FakebodywithqueryparamsPutQueryParametersMap0Builder +public class FakebodywithqueryparamsPutQueryParametersMap0Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakebodywithqueryparamsPutQueryParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | + +## FakebodywithqueryparamsPutQueryParametersMapBuilder +public class FakebodywithqueryparamsPutQueryParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakebodywithqueryparamsPutQueryParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakebodywithqueryparamsPutQueryParametersMap0Builder](#fakebodywithqueryparamsputqueryparametersmap0builder) | query(String value) | + +## FakebodywithqueryparamsPutQueryParametersMap +public static class FakebodywithqueryparamsPutQueryParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [FakebodywithqueryparamsPutQueryParametersMap](#fakebodywithqueryparamsputqueryparametersmap) | of([Map](#fakebodywithqueryparamsputqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| String | query()
| + +## FakebodywithqueryparamsPutadditionalPropertiesBoxed +public sealed interface FakebodywithqueryparamsPutadditionalPropertiesBoxed
+permits
+[FakebodywithqueryparamsPutadditionalPropertiesBoxedVoid](#fakebodywithqueryparamsputadditionalpropertiesboxedvoid), +[FakebodywithqueryparamsPutadditionalPropertiesBoxedBoolean](#fakebodywithqueryparamsputadditionalpropertiesboxedboolean), +[FakebodywithqueryparamsPutadditionalPropertiesBoxedNumber](#fakebodywithqueryparamsputadditionalpropertiesboxednumber), +[FakebodywithqueryparamsPutadditionalPropertiesBoxedString](#fakebodywithqueryparamsputadditionalpropertiesboxedstring), +[FakebodywithqueryparamsPutadditionalPropertiesBoxedList](#fakebodywithqueryparamsputadditionalpropertiesboxedlist), +[FakebodywithqueryparamsPutadditionalPropertiesBoxedMap](#fakebodywithqueryparamsputadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## FakebodywithqueryparamsPutadditionalPropertiesBoxedVoid +public record FakebodywithqueryparamsPutadditionalPropertiesBoxedVoid
+implements [FakebodywithqueryparamsPutadditionalPropertiesBoxed](#fakebodywithqueryparamsputadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakebodywithqueryparamsPutadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakebodywithqueryparamsPutadditionalPropertiesBoxedBoolean +public record FakebodywithqueryparamsPutadditionalPropertiesBoxedBoolean
+implements [FakebodywithqueryparamsPutadditionalPropertiesBoxed](#fakebodywithqueryparamsputadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakebodywithqueryparamsPutadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakebodywithqueryparamsPutadditionalPropertiesBoxedNumber +public record FakebodywithqueryparamsPutadditionalPropertiesBoxedNumber
+implements [FakebodywithqueryparamsPutadditionalPropertiesBoxed](#fakebodywithqueryparamsputadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakebodywithqueryparamsPutadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakebodywithqueryparamsPutadditionalPropertiesBoxedString +public record FakebodywithqueryparamsPutadditionalPropertiesBoxedString
+implements [FakebodywithqueryparamsPutadditionalPropertiesBoxed](#fakebodywithqueryparamsputadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakebodywithqueryparamsPutadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakebodywithqueryparamsPutadditionalPropertiesBoxedList +public record FakebodywithqueryparamsPutadditionalPropertiesBoxedList
+implements [FakebodywithqueryparamsPutadditionalPropertiesBoxed](#fakebodywithqueryparamsputadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakebodywithqueryparamsPutadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakebodywithqueryparamsPutadditionalPropertiesBoxedMap +public record FakebodywithqueryparamsPutadditionalPropertiesBoxedMap
+implements [FakebodywithqueryparamsPutadditionalPropertiesBoxed](#fakebodywithqueryparamsputadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakebodywithqueryparamsPutadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakebodywithqueryparamsPutadditionalProperties +public static class FakebodywithqueryparamsPutadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutRequestBody.md b/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutRequestBody.md new file mode 100644 index 00000000000..676dc92b904 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutRequestBody.md @@ -0,0 +1,90 @@ +# FakebodywithqueryparamsPutRequestBody + +public class FakebodywithqueryparamsPutRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakebodywithqueryparamsPutRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakebodywithqueryparamsPutRequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| static class | [FakebodywithqueryparamsPutRequestBody.FakebodywithqueryparamsPutRequestBody1](#fakebodywithqueryparamsputrequestbody1)
class that serializes request bodies | +| sealed interface | [FakebodywithqueryparamsPutRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [FakebodywithqueryparamsPutRequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakebodywithqueryparams/put/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakebodywithqueryparams/put/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## FakebodywithqueryparamsPutRequestBody1 +public static class FakebodywithqueryparamsPutRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakebodywithqueryparamsPutRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = true
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[ApplicationjsonRequestBody](#applicationjsonrequestbody) + +sealed interface that stores request contentType + validated schema data + +## ApplicationjsonRequestBody +public record ApplicationjsonRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonRequestBody(ApplicationjsonSchema.[User1Boxed](../../../components/schemas/User.md#user1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "application/json" | +| ApplicationjsonSchema.[User1Boxed](../../../components/schemas/User.md#user1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutResponses.md b/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutResponses.md new file mode 100644 index 00000000000..beeea9503ca --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutResponses.md @@ -0,0 +1,29 @@ +# FakebodywithqueryparamsPutResponses + +public class FakebodywithqueryparamsPutResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakebodywithqueryparamsPutCode200Response](#endpointfakebodywithqueryparamsputcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakebodywithqueryparamsPutCode200Response](#endpointfakebodywithqueryparamsputcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakebodywithqueryparamsPutCode200Response +public record EndpointFakebodywithqueryparamsPutCode200Response( + HttpResponse response, + Void body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/QueryParameters.md b/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/QueryParameters.md deleted file mode 100644 index 73898106516..00000000000 --- a/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/QueryParameters.md +++ /dev/null @@ -1,268 +0,0 @@ -# QueryParameters -public class QueryParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [QueryParameters.QueryParameters1Boxed](#queryparameters1boxed)
sealed interface for validated payloads | -| record | [QueryParameters.QueryParameters1BoxedMap](#queryparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [QueryParameters.QueryParameters1](#queryparameters1)
schema class | -| static class | [QueryParameters.QueryParametersMapBuilder](#queryparametersmapbuilder)
builder for Map payloads | -| static class | [QueryParameters.QueryParametersMap](#queryparametersmap)
output class for Map payloads | -| sealed interface | [QueryParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [QueryParameters.AdditionalProperties](#additionalproperties)
schema class | - -## QueryParameters1Boxed -public sealed interface QueryParameters1Boxed
-permits
-[QueryParameters1BoxedMap](#queryparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## QueryParameters1BoxedMap -public record QueryParameters1BoxedMap
-implements [QueryParameters1Boxed](#queryparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParameters1BoxedMap([QueryParametersMap](#queryparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap](#queryparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## QueryParameters1 -public static class QueryParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.QueryParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -QueryParameters.QueryParametersMap validatedPayload = - QueryParameters.QueryParameters1.validate( - new QueryParameters.QueryParametersMapBuilder() - .query("a") - - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("query", [Schema0.Schema01.class](../../../paths/fakebodywithqueryparams/put/parameters/parameter0/Schema0.md#schema01))
)
| -| Set | required = Set.of(
    "query"
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap](#queryparametersmap) | validate([Map<?, ?>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [QueryParameters1BoxedMap](#queryparameters1boxedmap) | validateAndBox([Map<?, ?>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [QueryParameters1Boxed](#queryparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## QueryParametersMap0Builder -public class QueryParametersMap0Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | - -## QueryParametersMapBuilder -public class QueryParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap0Builder](#queryparametersmap0builder) | query(String value) | - -## QueryParametersMap -public static class QueryParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [QueryParametersMap](#queryparametersmap) | of([Map](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| String | query()
| - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/RequestBody.md b/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/RequestBody.md deleted file mode 100644 index bbaa1842a70..00000000000 --- a/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/RequestBody.md +++ /dev/null @@ -1,90 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakebodywithqueryparams/put/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakebodywithqueryparams/put/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = true
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[ApplicationjsonRequestBody](#applicationjsonrequestbody) - -sealed interface that stores request contentType + validated schema data - -## ApplicationjsonRequestBody -public record ApplicationjsonRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonRequestBody(ApplicationjsonSchema.[User1Boxed](../../../components/schemas/User.md#user1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "application/json" | -| ApplicationjsonSchema.[User1Boxed](../../../components/schemas/User.md#user1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/Responses.md b/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/Responses.md deleted file mode 100644 index d4bf4fdb8f5..00000000000 --- a/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/responses/Code200Response.md deleted file mode 100644 index e89c75b2e12..00000000000 --- a/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/responses/Code200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# Code200Response - -public class Code200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) - -A class (extended from the $ref class) that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## Code200Response1 -public static class Code200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
- -a class that deserializes responses, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/responses/FakebodywithqueryparamsPutCode200Response.md b/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/responses/FakebodywithqueryparamsPutCode200Response.md new file mode 100644 index 00000000000..e6bbeac0a7b --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakebodywithqueryparams/put/responses/FakebodywithqueryparamsPutCode200Response.md @@ -0,0 +1,17 @@ +# FakebodywithqueryparamsPutCode200Response + +public class FakebodywithqueryparamsPutCode200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) + +A class (extended from the $ref class) that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [FakebodywithqueryparamsPutCode200Response.FakebodywithqueryparamsPutCode200Response1](#fakebodywithqueryparamsputcode200response1)
class that deserializes responses | + +## FakebodywithqueryparamsPutCode200Response1 +public static class FakebodywithqueryparamsPutCode200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
+ +a class that deserializes responses, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/FakecasesensitiveparamsPut.md b/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/FakecasesensitiveparamsPut.md new file mode 100644 index 00000000000..b101573c846 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/FakecasesensitiveparamsPut.md @@ -0,0 +1,186 @@ +# FakecasesensitiveparamsPut + +public class FakecasesensitiveparamsPut + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Put](#put)
The class that has a put method to call the endpoint | +| interface | [CaseSensitiveParamsOperation](#casesensitiveparamsoperation)
The interface that has a caseSensitiveParams method to call the endpoint | +| static class | [PutRequest](#putrequest)
The final request inputs class | +| static class | [PutNullableRequest](#putnullablerequest)
The initial request inputs class | +| static class | [Put0RequestBuilder](#put0requestbuilder)
A builder for the request input class | +| static class | [PutRequestBuilder](#putrequestbuilder)
A builder for the request input class | + +## Put +public static class Put extends ApiClient.ApiClient1 implements PutOperation
+ +a class that allows one to call the endpoint using a method named put + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.FakecasesensitiveparamsPutQueryParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.responses.FakecasesensitiveparamsPutCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakecasesensitiveparams.FakecasesensitiveparamsPut; +import org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.FakecasesensitiveparamsPutResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakecasesensitiveparamsPut.Put apiClient = new FakecasesensitiveparamsPut.Put(apiConfiguration, schemaConfiguration); + + +// Map validation +FakecasesensitiveparamsPutQueryParameters.FakecasesensitiveparamsPutQueryParametersMap queryParameters = + FakecasesensitiveparamsPutQueryParameters.FakecasesensitiveparamsPutQueryParameters1.validate( + new FakecasesensitiveparamsPutQueryParameters.FakecasesensitiveparamsPutQueryParametersMapBuilder() + .SomeVar("a") + + .someVar("a") + + .some_var("a") + + .build(), + schemaConfiguration +); + +var request = new FakecasesensitiveparamsPut.PutRequestBuilder() + .queryParameters(queryParameters) + .build(); + +FakecasesensitiveparamsPutResponses.EndpointResponse response; +try { + response = apiClient.put(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakecasesensitiveparamsPutResponses.EndpointFakecasesensitiveparamsPutCode200Response castResponse = (FakecasesensitiveparamsPutResponses.EndpointFakecasesensitiveparamsPutCode200Response) response; +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Put(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakecasesensitiveparamsPutResponses.EndpointResponse](../../paths/fakecasesensitiveparams/put/FakecasesensitiveparamsPutResponses.md#endpointresponse) | put([PutRequest](#putrequest) request) | + +## CaseSensitiveParamsOperation +public interface CaseSensitiveParamsOperation
+ +an interface that allows one to call the endpoint using a method named caseSensitiveParams by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakecasesensitiveparamsPutResponses.EndpointResponse](../../paths/fakecasesensitiveparams/put/FakecasesensitiveparamsPutResponses.md#endpointresponse) | caseSensitiveParams([PutRequest](#putrequest) request) | + +## PutRequest +public static class PutRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakecasesensitiveparamsPutQueryParameters.FakecasesensitiveparamsPutQueryParametersMap](../../paths/fakecasesensitiveparams/put/FakecasesensitiveparamsPutQueryParameters.md#fakecasesensitiveparamsputqueryparametersmap) | queryParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PutNullableRequest +public static class PutNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakecasesensitiveparamsPutQueryParameters.@Nullable FakecasesensitiveparamsPutQueryParametersMap](../../paths/fakecasesensitiveparams/put/FakecasesensitiveparamsPutQueryParameters.md#fakecasesensitiveparamsputqueryparametersmap) | queryParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| @Nullable Duration | timeout | + +## Put0RequestBuilder +public static class Put0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Put0RequestBuilder(Put0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PutRequest](#putrequest) | build()
Returns the request input used to call an endpoint method | +| [Put0RequestBuilder](#put0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Put0RequestBuilder](#put0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## PutRequestBuilder +public static class PutRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PutRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Put0RequestBuilder](#put0requestbuilder) | queryParameters([FakecasesensitiveparamsPutQueryParametersFakecasesensitiveparamsPutQueryParametersMap](../../paths/fakecasesensitiveparams/put/FakecasesensitiveparamsPutQueryParameters.md#fakecasesensitiveparamsputqueryparametersmap) queryParameters)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/Put.md b/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/Put.md deleted file mode 100644 index 7e8b7e8933a..00000000000 --- a/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/Put.md +++ /dev/null @@ -1,175 +0,0 @@ -# Put - -public class Put - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Put1](#put1)
The class that has a put method to call the endpoint | -| static class | [PutRequest](#putrequest)
The final request inputs class | -| static class | [PutNullableRequest](#putnullablerequest)
The initial request inputs class | -| static class | [Put0RequestBuilder](#put0requestbuilder)
A builder for the request input class | -| static class | [PutRequestBuilder](#putrequestbuilder)
A builder for the request input class | - -## Put1 -public static class Put1 extends ApiClient.ApiClient1 implements PutOperation
- -a class that allows one to call the endpoint using a method named put - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.QueryParameters; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakecasesensitiveparams.Put; -import org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Put.Put1 apiClient = new Put.Put1(apiConfiguration, schemaConfiguration); - - -// Map validation -QueryParameters.QueryParametersMap queryParameters = - QueryParameters.QueryParameters1.validate( - new QueryParameters.QueryParametersMapBuilder() - .SomeVar("a") - - .someVar("a") - - .some_var("a") - - .build(), - schemaConfiguration -); - -var request = new PutRequestBuilder() - .queryParameters(queryParameters) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.put(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Put1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakecasesensitiveparams/put/Responses.md#endpointresponse) | put([PutRequest](#putrequest) request) | - -## PutRequest -public static class PutRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [QueryParameters.QueryParametersMap](../../paths/fakecasesensitiveparams/put/QueryParameters.md#queryparametersmap) | queryParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PutNullableRequest -public static class PutNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [QueryParameters.@Nullable QueryParametersMap](../../paths/fakecasesensitiveparams/put/QueryParameters.md#queryparametersmap) | queryParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| @Nullable Duration | timeout | - -## Put0RequestBuilder -public static class Put0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Put0RequestBuilder(Put0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PutRequest](#putrequest) | build()
Returns the request input used to call an endpoint method | -| [Put0RequestBuilder](#put0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Put0RequestBuilder](#put0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## PutRequestBuilder -public static class PutRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PutRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Put0RequestBuilder](#put0requestbuilder) | queryParameters([QueryParametersQueryParametersMap](../../paths/fakecasesensitiveparams/put/QueryParameters.md#queryparametersmap) queryParameters)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/FakecasesensitiveparamsPutQueryParameters.md b/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/FakecasesensitiveparamsPutQueryParameters.md new file mode 100644 index 00000000000..5f7234f94b2 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/FakecasesensitiveparamsPutQueryParameters.md @@ -0,0 +1,375 @@ +# FakecasesensitiveparamsPutQueryParameters +public class FakecasesensitiveparamsPutQueryParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [FakecasesensitiveparamsPutQueryParameters.FakecasesensitiveparamsPutQueryParameters1Boxed](#fakecasesensitiveparamsputqueryparameters1boxed)
sealed interface for validated payloads | +| record | [FakecasesensitiveparamsPutQueryParameters.FakecasesensitiveparamsPutQueryParameters1BoxedMap](#fakecasesensitiveparamsputqueryparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [FakecasesensitiveparamsPutQueryParameters.FakecasesensitiveparamsPutQueryParameters1](#fakecasesensitiveparamsputqueryparameters1)
schema class | +| static class | [FakecasesensitiveparamsPutQueryParameters.FakecasesensitiveparamsPutQueryParametersMapBuilder](#fakecasesensitiveparamsputqueryparametersmapbuilder)
builder for Map payloads | +| static class | [FakecasesensitiveparamsPutQueryParameters.FakecasesensitiveparamsPutQueryParametersMap](#fakecasesensitiveparamsputqueryparametersmap)
output class for Map payloads | +| sealed interface | [FakecasesensitiveparamsPutQueryParameters.FakecasesensitiveparamsPutadditionalPropertiesBoxed](#fakecasesensitiveparamsputadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [FakecasesensitiveparamsPutQueryParameters.FakecasesensitiveparamsPutadditionalPropertiesBoxedVoid](#fakecasesensitiveparamsputadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [FakecasesensitiveparamsPutQueryParameters.FakecasesensitiveparamsPutadditionalPropertiesBoxedBoolean](#fakecasesensitiveparamsputadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [FakecasesensitiveparamsPutQueryParameters.FakecasesensitiveparamsPutadditionalPropertiesBoxedNumber](#fakecasesensitiveparamsputadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [FakecasesensitiveparamsPutQueryParameters.FakecasesensitiveparamsPutadditionalPropertiesBoxedString](#fakecasesensitiveparamsputadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [FakecasesensitiveparamsPutQueryParameters.FakecasesensitiveparamsPutadditionalPropertiesBoxedList](#fakecasesensitiveparamsputadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [FakecasesensitiveparamsPutQueryParameters.FakecasesensitiveparamsPutadditionalPropertiesBoxedMap](#fakecasesensitiveparamsputadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [FakecasesensitiveparamsPutQueryParameters.FakecasesensitiveparamsPutadditionalProperties](#fakecasesensitiveparamsputadditionalproperties)
schema class | + +## FakecasesensitiveparamsPutQueryParameters1Boxed +public sealed interface FakecasesensitiveparamsPutQueryParameters1Boxed
+permits
+[FakecasesensitiveparamsPutQueryParameters1BoxedMap](#fakecasesensitiveparamsputqueryparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## FakecasesensitiveparamsPutQueryParameters1BoxedMap +public record FakecasesensitiveparamsPutQueryParameters1BoxedMap
+implements [FakecasesensitiveparamsPutQueryParameters1Boxed](#fakecasesensitiveparamsputqueryparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakecasesensitiveparamsPutQueryParameters1BoxedMap([FakecasesensitiveparamsPutQueryParametersMap](#fakecasesensitiveparamsputqueryparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakecasesensitiveparamsPutQueryParametersMap](#fakecasesensitiveparamsputqueryparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakecasesensitiveparamsPutQueryParameters1 +public static class FakecasesensitiveparamsPutQueryParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.FakecasesensitiveparamsPutQueryParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +FakecasesensitiveparamsPutQueryParameters.FakecasesensitiveparamsPutQueryParametersMap validatedPayload = + FakecasesensitiveparamsPutQueryParameters.FakecasesensitiveparamsPutQueryParameters1.validate( + new FakecasesensitiveparamsPutQueryParameters.FakecasesensitiveparamsPutQueryParametersMapBuilder() + .SomeVar("a") + + .someVar("a") + + .some_var("a") + + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("someVar", [Schema0.Schema01.class](../../../paths/fakecasesensitiveparams/put/parameters/parameter0/Schema0.md#schema01)),
    new PropertyEntry("some_var", [Schema2.Schema21.class](../../../paths/fakecasesensitiveparams/put/parameters/parameter2/Schema2.md#schema21)),
    new PropertyEntry("SomeVar", [Schema1.Schema11.class](../../../paths/fakecasesensitiveparams/put/parameters/parameter1/Schema1.md#schema11))
)
| +| Set | required = Set.of(
    "SomeVar",
    "someVar",
    "some_var"
)
| +| Class | additionalProperties = [FakecasesensitiveparamsPutadditionalProperties.class](#fakecasesensitiveparamsputadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakecasesensitiveparamsPutQueryParametersMap](#fakecasesensitiveparamsputqueryparametersmap) | validate([Map<?, ?>](#fakecasesensitiveparamsputqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [FakecasesensitiveparamsPutQueryParameters1BoxedMap](#fakecasesensitiveparamsputqueryparameters1boxedmap) | validateAndBox([Map<?, ?>](#fakecasesensitiveparamsputqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [FakecasesensitiveparamsPutQueryParameters1Boxed](#fakecasesensitiveparamsputqueryparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## FakecasesensitiveparamsPutQueryParametersMap000Builder +public class FakecasesensitiveparamsPutQueryParametersMap000Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakecasesensitiveparamsPutQueryParametersMap000Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | + +## FakecasesensitiveparamsPutQueryParametersMap001Builder +public class FakecasesensitiveparamsPutQueryParametersMap001Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakecasesensitiveparamsPutQueryParametersMap001Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakecasesensitiveparamsPutQueryParametersMap000Builder](#fakecasesensitiveparamsputqueryparametersmap000builder) | some_var(String value) | + +## FakecasesensitiveparamsPutQueryParametersMap010Builder +public class FakecasesensitiveparamsPutQueryParametersMap010Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakecasesensitiveparamsPutQueryParametersMap010Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakecasesensitiveparamsPutQueryParametersMap000Builder](#fakecasesensitiveparamsputqueryparametersmap000builder) | someVar(String value) | + +## FakecasesensitiveparamsPutQueryParametersMap011Builder +public class FakecasesensitiveparamsPutQueryParametersMap011Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakecasesensitiveparamsPutQueryParametersMap011Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakecasesensitiveparamsPutQueryParametersMap001Builder](#fakecasesensitiveparamsputqueryparametersmap001builder) | someVar(String value) | +| [FakecasesensitiveparamsPutQueryParametersMap010Builder](#fakecasesensitiveparamsputqueryparametersmap010builder) | some_var(String value) | + +## FakecasesensitiveparamsPutQueryParametersMap100Builder +public class FakecasesensitiveparamsPutQueryParametersMap100Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakecasesensitiveparamsPutQueryParametersMap100Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakecasesensitiveparamsPutQueryParametersMap000Builder](#fakecasesensitiveparamsputqueryparametersmap000builder) | SomeVar(String value) | + +## FakecasesensitiveparamsPutQueryParametersMap101Builder +public class FakecasesensitiveparamsPutQueryParametersMap101Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakecasesensitiveparamsPutQueryParametersMap101Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakecasesensitiveparamsPutQueryParametersMap001Builder](#fakecasesensitiveparamsputqueryparametersmap001builder) | SomeVar(String value) | +| [FakecasesensitiveparamsPutQueryParametersMap100Builder](#fakecasesensitiveparamsputqueryparametersmap100builder) | some_var(String value) | + +## FakecasesensitiveparamsPutQueryParametersMap110Builder +public class FakecasesensitiveparamsPutQueryParametersMap110Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakecasesensitiveparamsPutQueryParametersMap110Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakecasesensitiveparamsPutQueryParametersMap010Builder](#fakecasesensitiveparamsputqueryparametersmap010builder) | SomeVar(String value) | +| [FakecasesensitiveparamsPutQueryParametersMap100Builder](#fakecasesensitiveparamsputqueryparametersmap100builder) | someVar(String value) | + +## FakecasesensitiveparamsPutQueryParametersMapBuilder +public class FakecasesensitiveparamsPutQueryParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakecasesensitiveparamsPutQueryParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakecasesensitiveparamsPutQueryParametersMap011Builder](#fakecasesensitiveparamsputqueryparametersmap011builder) | SomeVar(String value) | +| [FakecasesensitiveparamsPutQueryParametersMap101Builder](#fakecasesensitiveparamsputqueryparametersmap101builder) | someVar(String value) | +| [FakecasesensitiveparamsPutQueryParametersMap110Builder](#fakecasesensitiveparamsputqueryparametersmap110builder) | some_var(String value) | + +## FakecasesensitiveparamsPutQueryParametersMap +public static class FakecasesensitiveparamsPutQueryParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [FakecasesensitiveparamsPutQueryParametersMap](#fakecasesensitiveparamsputqueryparametersmap) | of([Map](#fakecasesensitiveparamsputqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| String | SomeVar()
| +| String | someVar()
| +| String | some_var()
| + +## FakecasesensitiveparamsPutadditionalPropertiesBoxed +public sealed interface FakecasesensitiveparamsPutadditionalPropertiesBoxed
+permits
+[FakecasesensitiveparamsPutadditionalPropertiesBoxedVoid](#fakecasesensitiveparamsputadditionalpropertiesboxedvoid), +[FakecasesensitiveparamsPutadditionalPropertiesBoxedBoolean](#fakecasesensitiveparamsputadditionalpropertiesboxedboolean), +[FakecasesensitiveparamsPutadditionalPropertiesBoxedNumber](#fakecasesensitiveparamsputadditionalpropertiesboxednumber), +[FakecasesensitiveparamsPutadditionalPropertiesBoxedString](#fakecasesensitiveparamsputadditionalpropertiesboxedstring), +[FakecasesensitiveparamsPutadditionalPropertiesBoxedList](#fakecasesensitiveparamsputadditionalpropertiesboxedlist), +[FakecasesensitiveparamsPutadditionalPropertiesBoxedMap](#fakecasesensitiveparamsputadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## FakecasesensitiveparamsPutadditionalPropertiesBoxedVoid +public record FakecasesensitiveparamsPutadditionalPropertiesBoxedVoid
+implements [FakecasesensitiveparamsPutadditionalPropertiesBoxed](#fakecasesensitiveparamsputadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakecasesensitiveparamsPutadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakecasesensitiveparamsPutadditionalPropertiesBoxedBoolean +public record FakecasesensitiveparamsPutadditionalPropertiesBoxedBoolean
+implements [FakecasesensitiveparamsPutadditionalPropertiesBoxed](#fakecasesensitiveparamsputadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakecasesensitiveparamsPutadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakecasesensitiveparamsPutadditionalPropertiesBoxedNumber +public record FakecasesensitiveparamsPutadditionalPropertiesBoxedNumber
+implements [FakecasesensitiveparamsPutadditionalPropertiesBoxed](#fakecasesensitiveparamsputadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakecasesensitiveparamsPutadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakecasesensitiveparamsPutadditionalPropertiesBoxedString +public record FakecasesensitiveparamsPutadditionalPropertiesBoxedString
+implements [FakecasesensitiveparamsPutadditionalPropertiesBoxed](#fakecasesensitiveparamsputadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakecasesensitiveparamsPutadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakecasesensitiveparamsPutadditionalPropertiesBoxedList +public record FakecasesensitiveparamsPutadditionalPropertiesBoxedList
+implements [FakecasesensitiveparamsPutadditionalPropertiesBoxed](#fakecasesensitiveparamsputadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakecasesensitiveparamsPutadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakecasesensitiveparamsPutadditionalPropertiesBoxedMap +public record FakecasesensitiveparamsPutadditionalPropertiesBoxedMap
+implements [FakecasesensitiveparamsPutadditionalPropertiesBoxed](#fakecasesensitiveparamsputadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakecasesensitiveparamsPutadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakecasesensitiveparamsPutadditionalProperties +public static class FakecasesensitiveparamsPutadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/FakecasesensitiveparamsPutResponses.md b/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/FakecasesensitiveparamsPutResponses.md new file mode 100644 index 00000000000..aec4af1f778 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/FakecasesensitiveparamsPutResponses.md @@ -0,0 +1,29 @@ +# FakecasesensitiveparamsPutResponses + +public class FakecasesensitiveparamsPutResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakecasesensitiveparamsPutCode200Response](#endpointfakecasesensitiveparamsputcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakecasesensitiveparamsPutCode200Response](#endpointfakecasesensitiveparamsputcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakecasesensitiveparamsPutCode200Response +public record EndpointFakecasesensitiveparamsPutCode200Response( + HttpResponse response, + Void body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/QueryParameters.md b/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/QueryParameters.md deleted file mode 100644 index f374bd91398..00000000000 --- a/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/QueryParameters.md +++ /dev/null @@ -1,375 +0,0 @@ -# QueryParameters -public class QueryParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [QueryParameters.QueryParameters1Boxed](#queryparameters1boxed)
sealed interface for validated payloads | -| record | [QueryParameters.QueryParameters1BoxedMap](#queryparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [QueryParameters.QueryParameters1](#queryparameters1)
schema class | -| static class | [QueryParameters.QueryParametersMapBuilder](#queryparametersmapbuilder)
builder for Map payloads | -| static class | [QueryParameters.QueryParametersMap](#queryparametersmap)
output class for Map payloads | -| sealed interface | [QueryParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [QueryParameters.AdditionalProperties](#additionalproperties)
schema class | - -## QueryParameters1Boxed -public sealed interface QueryParameters1Boxed
-permits
-[QueryParameters1BoxedMap](#queryparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## QueryParameters1BoxedMap -public record QueryParameters1BoxedMap
-implements [QueryParameters1Boxed](#queryparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParameters1BoxedMap([QueryParametersMap](#queryparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap](#queryparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## QueryParameters1 -public static class QueryParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.QueryParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -QueryParameters.QueryParametersMap validatedPayload = - QueryParameters.QueryParameters1.validate( - new QueryParameters.QueryParametersMapBuilder() - .SomeVar("a") - - .someVar("a") - - .some_var("a") - - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("someVar", [Schema0.Schema01.class](../../../paths/fakecasesensitiveparams/put/parameters/parameter0/Schema0.md#schema01)),
    new PropertyEntry("some_var", [Schema2.Schema21.class](../../../paths/fakecasesensitiveparams/put/parameters/parameter2/Schema2.md#schema21)),
    new PropertyEntry("SomeVar", [Schema1.Schema11.class](../../../paths/fakecasesensitiveparams/put/parameters/parameter1/Schema1.md#schema11))
)
| -| Set | required = Set.of(
    "SomeVar",
    "someVar",
    "some_var"
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap](#queryparametersmap) | validate([Map<?, ?>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [QueryParameters1BoxedMap](#queryparameters1boxedmap) | validateAndBox([Map<?, ?>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [QueryParameters1Boxed](#queryparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## QueryParametersMap000Builder -public class QueryParametersMap000Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap000Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | - -## QueryParametersMap001Builder -public class QueryParametersMap001Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap001Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000Builder](#queryparametersmap000builder) | some_var(String value) | - -## QueryParametersMap010Builder -public class QueryParametersMap010Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap010Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000Builder](#queryparametersmap000builder) | someVar(String value) | - -## QueryParametersMap011Builder -public class QueryParametersMap011Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap011Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap001Builder](#queryparametersmap001builder) | someVar(String value) | -| [QueryParametersMap010Builder](#queryparametersmap010builder) | some_var(String value) | - -## QueryParametersMap100Builder -public class QueryParametersMap100Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap100Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000Builder](#queryparametersmap000builder) | SomeVar(String value) | - -## QueryParametersMap101Builder -public class QueryParametersMap101Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap101Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap001Builder](#queryparametersmap001builder) | SomeVar(String value) | -| [QueryParametersMap100Builder](#queryparametersmap100builder) | some_var(String value) | - -## QueryParametersMap110Builder -public class QueryParametersMap110Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap110Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap010Builder](#queryparametersmap010builder) | SomeVar(String value) | -| [QueryParametersMap100Builder](#queryparametersmap100builder) | someVar(String value) | - -## QueryParametersMapBuilder -public class QueryParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap011Builder](#queryparametersmap011builder) | SomeVar(String value) | -| [QueryParametersMap101Builder](#queryparametersmap101builder) | someVar(String value) | -| [QueryParametersMap110Builder](#queryparametersmap110builder) | some_var(String value) | - -## QueryParametersMap -public static class QueryParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [QueryParametersMap](#queryparametersmap) | of([Map](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| String | SomeVar()
| -| String | someVar()
| -| String | some_var()
| - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/Responses.md b/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/Responses.md deleted file mode 100644 index d4bf4fdb8f5..00000000000 --- a/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/responses/Code200Response.md deleted file mode 100644 index e89c75b2e12..00000000000 --- a/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/responses/Code200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# Code200Response - -public class Code200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) - -A class (extended from the $ref class) that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## Code200Response1 -public static class Code200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
- -a class that deserializes responses, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/responses/FakecasesensitiveparamsPutCode200Response.md b/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/responses/FakecasesensitiveparamsPutCode200Response.md new file mode 100644 index 00000000000..2ec9adb95bd --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakecasesensitiveparams/put/responses/FakecasesensitiveparamsPutCode200Response.md @@ -0,0 +1,17 @@ +# FakecasesensitiveparamsPutCode200Response + +public class FakecasesensitiveparamsPutCode200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) + +A class (extended from the $ref class) that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [FakecasesensitiveparamsPutCode200Response.FakecasesensitiveparamsPutCode200Response1](#fakecasesensitiveparamsputcode200response1)
class that deserializes responses | + +## FakecasesensitiveparamsPutCode200Response1 +public static class FakecasesensitiveparamsPutCode200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
+ +a class that deserializes responses, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/fakeclassnametest/FakeclassnametestPatch.md b/samples/client/petstore/java/docs/paths/fakeclassnametest/FakeclassnametestPatch.md new file mode 100644 index 00000000000..590a7635755 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeclassnametest/FakeclassnametestPatch.md @@ -0,0 +1,200 @@ +# FakeclassnametestPatch + +public class FakeclassnametestPatch + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Patch](#patch)
The class that has a patch method to call the endpoint | +| interface | [ClassnameOperation](#classnameoperation)
The interface that has a classname method to call the endpoint | +| static class | [PatchRequest](#patchrequest)
The final request inputs class | +| static class | [PatchNullableRequest](#patchnullablerequest)
The initial request inputs class | +| static class | [Patch0RequestBuilder](#patch0requestbuilder)
A builder for the request input class | +| static class | [PatchRequestBuilder](#patchrequestbuilder)
A builder for the request input class | + +## Patch +public static class Patch extends ApiClient.ApiClient1 implements PatchOperation
+ +a class that allows one to call the endpoint using a method named patch + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeclassnametest.patch.FakeclassnametestPatchSecurityInfo; +import org.openapijsonschematools.client.paths.fakeclassnametest.patch.FakeclassnametestPatchRequestBody; +import org.openapijsonschematools.client.components.schemas.Client; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.ApiKeyQuery; +import org.openapijsonschematools.client.paths.fakeclassnametest.patch.responses.FakeclassnametestPatchCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeclassnametest.FakeclassnametestPatch; +import org.openapijsonschematools.client.paths.fakeclassnametest.patch.FakeclassnametestPatchResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new ApiKeyQuery("someApiKey"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .fakeclassnametestPatchSecurityRequirementObject0SecurityIndex(FakeclassnametestPatchSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakeclassnametestPatch.Patch apiClient = new FakeclassnametestPatch.Patch(apiConfiguration, schemaConfiguration); + + +Client1BoxedMap requestBodyPayload = + Client.Client1.validateAndBox( + new Client.ClientMapBuilder1() + .client("a") + + .build(), + schemaConfiguration +); +FakeclassnametestPatchRequestBody.SealedRequestBody requestBody = new FakeclassnametestPatchRequestBody.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new FakeclassnametestPatch.PatchRequestBuilder() + .requestBody(requestBody) + .build(); + +FakeclassnametestPatchResponses.EndpointResponse response; +try { + response = apiClient.patch(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeclassnametestPatchResponses.EndpointFakeclassnametestPatchCode200Response castResponse = (FakeclassnametestPatchResponses.EndpointFakeclassnametestPatchCode200Response) response; +FakeclassnametestPatchCode200Response.ApplicationjsonResponseBody deserializedBody = (FakeclassnametestPatchCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Patch(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeclassnametestPatchResponses.EndpointResponse](../../paths/fakeclassnametest/patch/FakeclassnametestPatchResponses.md#endpointresponse) | patch([PatchRequest](#patchrequest) request) | + +## ClassnameOperation +public interface ClassnameOperation
+ +an interface that allows one to call the endpoint using a method named classname by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeclassnametestPatchResponses.EndpointResponse](../../paths/fakeclassnametest/patch/FakeclassnametestPatchResponses.md#endpointresponse) | classname([PatchRequest](#patchrequest) request) | + +## PatchRequest +public static class PatchRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakeclassnametestPatchRequestBody.SealedRequestBody](../../paths/fakeclassnametest/patch/FakeclassnametestPatchRequestBody.md#sealedrequestbody) | requestBody | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| [FakeclassnametestPatchSecurityInfo.@Nullable SecurityIndex](../../paths/fakeclassnametest/patch/FakeclassnametestPatchSecurityInfo.md#securityindex) | securityIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PatchNullableRequest +public static class PatchNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakeclassnametestPatchRequestBody.@Nullable SealedRequestBody](../../paths/fakeclassnametest/patch/FakeclassnametestPatchRequestBody.md#sealedrequestbody) | requestBody | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| [FakeclassnametestPatchSecurityInfo.@Nullable SecurityIndex](../../paths/fakeclassnametest/patch/FakeclassnametestPatchSecurityInfo.md#securityindex) | securityIndex | +| @Nullable Duration | timeout | + +## Patch0RequestBuilder +public static class Patch0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Patch0RequestBuilder(Patch0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PatchRequest](#patchrequest) | build()
Returns the request input used to call an endpoint method | +| [Patch0RequestBuilder](#patch0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Patch0RequestBuilder](#patch0requestbuilder) | securityIndex([FakeclassnametestPatchSecurityInfo.SecurityIndex](../../paths/fakeclassnametest/patch/FakeclassnametestPatchSecurityInfo.md#securityindex) securityIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Patch0RequestBuilder](#patch0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## PatchRequestBuilder +public static class PatchRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PatchRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Patch0RequestBuilder](#patch0requestbuilder) | requestBody([FakeclassnametestPatchRequestBody.SealedRequestBody](../../paths/fakeclassnametest/patch/FakeclassnametestPatchRequestBody.md#sealedrequestbody) requestBody)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakeclassnametest/Patch.md b/samples/client/petstore/java/docs/paths/fakeclassnametest/Patch.md deleted file mode 100644 index 4fec21e62e9..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeclassnametest/Patch.md +++ /dev/null @@ -1,189 +0,0 @@ -# Patch - -public class Patch - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Patch1](#patch1)
The class that has a patch method to call the endpoint | -| static class | [PatchRequest](#patchrequest)
The final request inputs class | -| static class | [PatchNullableRequest](#patchnullablerequest)
The initial request inputs class | -| static class | [Patch0RequestBuilder](#patch0requestbuilder)
A builder for the request input class | -| static class | [PatchRequestBuilder](#patchrequestbuilder)
A builder for the request input class | - -## Patch1 -public static class Patch1 extends ApiClient.ApiClient1 implements PatchOperation
- -a class that allows one to call the endpoint using a method named patch - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakeclassnametest.patch.FakeclassnametestPatchSecurityInfo; -import org.openapijsonschematools.client.paths.fakeclassnametest.patch.RequestBody; -import org.openapijsonschematools.client.components.schemas.Client; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.securityschemes.SecurityScheme; -import org.openapijsonschematools.client.components.securityschemes.ApiKeyQuery; -import org.openapijsonschematools.client.paths.fakeclassnametest.patch.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakeclassnametest.Patch; -import org.openapijsonschematools.client.paths.fakeclassnametest.patch.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -List securitySchemes = new ArrayList(); -securitySchemes.add( - new ApiKeyQuery("someApiKey"); -); -ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() - .fakeclassnametestPatchSecurityRequirementObject0SecurityIndex(FakeclassnametestPatchSecurityRequirementObject0.SecurityIndex.SECURITY_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - securitySchemes, - securityIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Patch.Patch1 apiClient = new Patch.Patch1(apiConfiguration, schemaConfiguration); - - -Client1BoxedMap requestBodyPayload = - Client.Client1.validateAndBox( - new Client.ClientMapBuilder1() - .client("a") - - .build(), - schemaConfiguration -); -RequestBody.SealedRequestBody requestBody = new RequestBody.ApplicationjsonRequestBody(requestBodyPayload); - -var request = new PatchRequestBuilder() - .requestBody(requestBody) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.patch(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -Code200Response.ApplicationjsonResponseBody deserializedBody = (Code200Response.ApplicationjsonResponseBody) castResponse.body; -// handle deserialized body here -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Patch1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakeclassnametest/patch/Responses.md#endpointresponse) | patch([PatchRequest](#patchrequest) request) | - -## PatchRequest -public static class PatchRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.SealedRequestBody](../../paths/fakeclassnametest/patch/RequestBody.md#sealedrequestbody) | requestBody | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| [FakeclassnametestPatchSecurityInfo.@Nullable SecurityIndex](../../paths/fakeclassnametest/patch/FakeclassnametestPatchSecurityInfo.md#securityindex) | securityIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PatchNullableRequest -public static class PatchNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fakeclassnametest/patch/RequestBody.md#sealedrequestbody) | requestBody | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| [FakeclassnametestPatchSecurityInfo.@Nullable SecurityIndex](../../paths/fakeclassnametest/patch/FakeclassnametestPatchSecurityInfo.md#securityindex) | securityIndex | -| @Nullable Duration | timeout | - -## Patch0RequestBuilder -public static class Patch0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Patch0RequestBuilder(Patch0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PatchRequest](#patchrequest) | build()
Returns the request input used to call an endpoint method | -| [Patch0RequestBuilder](#patch0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Patch0RequestBuilder](#patch0requestbuilder) | securityIndex([FakeclassnametestPatchSecurityInfo.SecurityIndex](../../paths/fakeclassnametest/patch/FakeclassnametestPatchSecurityInfo.md#securityindex) securityIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Patch0RequestBuilder](#patch0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## PatchRequestBuilder -public static class PatchRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PatchRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Patch0RequestBuilder](#patch0requestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/fakeclassnametest/patch/RequestBody.md#sealedrequestbody) requestBody)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakeclassnametest/patch/FakeclassnametestPatchRequestBody.md b/samples/client/petstore/java/docs/paths/fakeclassnametest/patch/FakeclassnametestPatchRequestBody.md new file mode 100644 index 00000000000..ee0772ceed2 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeclassnametest/patch/FakeclassnametestPatchRequestBody.md @@ -0,0 +1,17 @@ +# FakeclassnametestPatchRequestBody + +public class FakeclassnametestPatchRequestBody extends [Client](../../../components/requestbodies/Client.md) + +A class (extended from the $ref class) that contains necessary nested request body classes +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [FakeclassnametestPatchRequestBody.FakeclassnametestPatchRequestBody1](#fakeclassnametestpatchrequestbody1)
class that serializes request bodies | + +## FakeclassnametestPatchRequestBody1 +public static class FakeclassnametestPatchRequestBody1 extends [Client1](../../../components/requestbodies/Client.md#client1)
+ +a class that serializes SealedRequestBody request bodies, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/fakeclassnametest/patch/FakeclassnametestPatchResponses.md b/samples/client/petstore/java/docs/paths/fakeclassnametest/patch/FakeclassnametestPatchResponses.md new file mode 100644 index 00000000000..a8397a692e6 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeclassnametest/patch/FakeclassnametestPatchResponses.md @@ -0,0 +1,29 @@ +# FakeclassnametestPatchResponses + +public class FakeclassnametestPatchResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakeclassnametestPatchCode200Response](#endpointfakeclassnametestpatchcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakeclassnametestPatchCode200Response](#endpointfakeclassnametestpatchcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakeclassnametestPatchCode200Response +public record EndpointFakeclassnametestPatchCode200Response( + HttpResponse response, + [FakeclassnametestPatchCode200Response.SealedResponseBody](../../../paths/fakeclassnametest/patch/responses/FakeclassnametestPatchCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakeclassnametest/patch/RequestBody.md b/samples/client/petstore/java/docs/paths/fakeclassnametest/patch/RequestBody.md deleted file mode 100644 index 72d0a1a3ced..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeclassnametest/patch/RequestBody.md +++ /dev/null @@ -1,17 +0,0 @@ -# RequestBody - -public class RequestBody extends [Client](../../../components/requestbodies/Client.md) - -A class (extended from the $ref class) that contains necessary nested request body classes -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | - -## RequestBody1 -public static class RequestBody1 extends [Client1](../../../components/requestbodies/Client.md#client1)
- -a class that serializes SealedRequestBody request bodies, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/fakeclassnametest/patch/Responses.md b/samples/client/petstore/java/docs/paths/fakeclassnametest/patch/Responses.md deleted file mode 100644 index 7f0b34ec46b..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeclassnametest/patch/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/fakeclassnametest/patch/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakeclassnametest/patch/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakeclassnametest/patch/responses/Code200Response.md deleted file mode 100644 index 40e3e4d6357..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeclassnametest/patch/responses/Code200Response.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakeclassnametest/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakeclassnametest/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.[Client1Boxed](../../../../components/schemas/Client.md#client1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.[Client1Boxed](../../../../components/schemas/Client.md#client1boxed) | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakeclassnametest/patch/responses/FakeclassnametestPatchCode200Response.md b/samples/client/petstore/java/docs/paths/fakeclassnametest/patch/responses/FakeclassnametestPatchCode200Response.md new file mode 100644 index 00000000000..7ece775356e --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeclassnametest/patch/responses/FakeclassnametestPatchCode200Response.md @@ -0,0 +1,87 @@ +# FakeclassnametestPatchCode200Response + +public class FakeclassnametestPatchCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakeclassnametestPatchCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakeclassnametestPatchCode200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakeclassnametestPatchCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakeclassnametestPatchCode200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [FakeclassnametestPatchCode200Response.FakeclassnametestPatchCode200Response1](#fakeclassnametestpatchcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakeclassnametest/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakeclassnametest/patch/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.[Client1Boxed](../../../../components/schemas/Client.md#client1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.[Client1Boxed](../../../../components/schemas/Client.md#client1boxed) | body()
returns the body passed in in the constructor | + +## FakeclassnametestPatchCode200Response1 +public static class FakeclassnametestPatchCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeclassnametestPatchCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/Delete.md b/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/Delete.md deleted file mode 100644 index add571b8591..00000000000 --- a/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/Delete.md +++ /dev/null @@ -1,175 +0,0 @@ -# Delete - -public class Delete - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Delete1](#delete1)
The class that has a delete method to call the endpoint | -| static class | [DeleteRequest](#deleterequest)
The final request inputs class | -| static class | [DeleteNullableRequest](#deletenullablerequest)
The initial request inputs class | -| static class | [Delete0RequestBuilder](#delete0requestbuilder)
A builder for the request input class | -| static class | [DeleteRequestBuilder](#deleterequestbuilder)
A builder for the request input class | - -## Delete1 -public static class Delete1 extends ApiClient.ApiClient1 implements DeleteOperation
- -a class that allows one to call the endpoint using a method named delete - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.PathParameters; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.responses.Code200Response; -import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.responses.CodedefaultResponse; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakedeletecoffeeid.Delete; -import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Delete.Delete1 apiClient = new Delete.Delete1(apiConfiguration, schemaConfiguration); - - -// Map validation -PathParameters.PathParametersMap pathParameters = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .id("a") - - .build(), - schemaConfiguration -); - -var request = new DeleteRequestBuilder() - .pathParameters(pathParameters) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.delete(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -if (response instanceof Responses.EndpointCode200Response castResponse) { -} else { - Responses.EndpointCodedefaultResponse castResponse = (Responses.EndpointCodedefaultResponse) response; -} -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Delete1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakedeletecoffeeid/delete/Responses.md#endpointresponse) | delete([DeleteRequest](#deleterequest) request) | - -## DeleteRequest -public static class DeleteRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [PathParameters.PathParametersMap](../../paths/fakedeletecoffeeid/delete/PathParameters.md#pathparametersmap) | pathParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## DeleteNullableRequest -public static class DeleteNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [PathParameters.@Nullable PathParametersMap](../../paths/fakedeletecoffeeid/delete/PathParameters.md#pathparametersmap) | pathParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| @Nullable Duration | timeout | - -## Delete0RequestBuilder -public static class Delete0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Delete0RequestBuilder(Delete0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [DeleteRequest](#deleterequest) | build()
Returns the request input used to call an endpoint method | -| [Delete0RequestBuilder](#delete0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Delete0RequestBuilder](#delete0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## DeleteRequestBuilder -public static class DeleteRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| DeleteRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Delete0RequestBuilder](#delete0requestbuilder) | pathParameters([PathParametersPathParametersMap](../../paths/fakedeletecoffeeid/delete/PathParameters.md#pathparametersmap) pathParameters)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/FakedeletecoffeeidDelete.md b/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/FakedeletecoffeeidDelete.md new file mode 100644 index 00000000000..1baea52750a --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/FakedeletecoffeeidDelete.md @@ -0,0 +1,186 @@ +# FakedeletecoffeeidDelete + +public class FakedeletecoffeeidDelete + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Delete](#delete)
The class that has a delete method to call the endpoint | +| interface | [DeleteCoffeeOperation](#deletecoffeeoperation)
The interface that has a deleteCoffee method to call the endpoint | +| static class | [DeleteRequest](#deleterequest)
The final request inputs class | +| static class | [DeleteNullableRequest](#deletenullablerequest)
The initial request inputs class | +| static class | [Delete0RequestBuilder](#delete0requestbuilder)
A builder for the request input class | +| static class | [DeleteRequestBuilder](#deleterequestbuilder)
A builder for the request input class | + +## Delete +public static class Delete extends ApiClient.ApiClient1 implements DeleteOperation
+ +a class that allows one to call the endpoint using a method named delete + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.FakedeletecoffeeidDeletePathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.responses.FakedeletecoffeeidDeleteCode200Response; +import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.responses.FakedeletecoffeeidDeleteCodedefaultResponse; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakedeletecoffeeid.FakedeletecoffeeidDelete; +import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.FakedeletecoffeeidDeleteResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakedeletecoffeeidDelete.Delete apiClient = new FakedeletecoffeeidDelete.Delete(apiConfiguration, schemaConfiguration); + + +// Map validation +FakedeletecoffeeidDeletePathParameters.FakedeletecoffeeidDeletePathParametersMap pathParameters = + FakedeletecoffeeidDeletePathParameters.FakedeletecoffeeidDeletePathParameters1.validate( + new FakedeletecoffeeidDeletePathParameters.FakedeletecoffeeidDeletePathParametersMapBuilder() + .id("a") + + .build(), + schemaConfiguration +); + +var request = new FakedeletecoffeeidDelete.DeleteRequestBuilder() + .pathParameters(pathParameters) + .build(); + +FakedeletecoffeeidDeleteResponses.EndpointResponse response; +try { + response = apiClient.delete(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +if (response instanceof FakedeletecoffeeidDeleteResponses.EndpointFakedeletecoffeeidDeleteCode200Response castResponse) { +} else { + FakedeletecoffeeidDeleteResponses.EndpointFakedeletecoffeeidDeleteCodedefaultResponse castResponse = (FakedeletecoffeeidDeleteResponses.EndpointFakedeletecoffeeidDeleteCodedefaultResponse) response; +} +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Delete(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakedeletecoffeeidDeleteResponses.EndpointResponse](../../paths/fakedeletecoffeeid/delete/FakedeletecoffeeidDeleteResponses.md#endpointresponse) | delete([DeleteRequest](#deleterequest) request) | + +## DeleteCoffeeOperation +public interface DeleteCoffeeOperation
+ +an interface that allows one to call the endpoint using a method named deleteCoffee by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakedeletecoffeeidDeleteResponses.EndpointResponse](../../paths/fakedeletecoffeeid/delete/FakedeletecoffeeidDeleteResponses.md#endpointresponse) | deleteCoffee([DeleteRequest](#deleterequest) request) | + +## DeleteRequest +public static class DeleteRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakedeletecoffeeidDeletePathParameters.FakedeletecoffeeidDeletePathParametersMap](../../paths/fakedeletecoffeeid/delete/FakedeletecoffeeidDeletePathParameters.md#fakedeletecoffeeiddeletepathparametersmap) | pathParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## DeleteNullableRequest +public static class DeleteNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakedeletecoffeeidDeletePathParameters.@Nullable FakedeletecoffeeidDeletePathParametersMap](../../paths/fakedeletecoffeeid/delete/FakedeletecoffeeidDeletePathParameters.md#fakedeletecoffeeiddeletepathparametersmap) | pathParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| @Nullable Duration | timeout | + +## Delete0RequestBuilder +public static class Delete0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Delete0RequestBuilder(Delete0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [DeleteRequest](#deleterequest) | build()
Returns the request input used to call an endpoint method | +| [Delete0RequestBuilder](#delete0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Delete0RequestBuilder](#delete0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## DeleteRequestBuilder +public static class DeleteRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| DeleteRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Delete0RequestBuilder](#delete0requestbuilder) | pathParameters([FakedeletecoffeeidDeletePathParametersFakedeletecoffeeidDeletePathParametersMap](../../paths/fakedeletecoffeeid/delete/FakedeletecoffeeidDeletePathParameters.md#fakedeletecoffeeiddeletepathparametersmap) pathParameters)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/delete/FakedeletecoffeeidDeletePathParameters.md b/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/delete/FakedeletecoffeeidDeletePathParameters.md new file mode 100644 index 00000000000..eb755ab6b0d --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/delete/FakedeletecoffeeidDeletePathParameters.md @@ -0,0 +1,268 @@ +# FakedeletecoffeeidDeletePathParameters +public class FakedeletecoffeeidDeletePathParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [FakedeletecoffeeidDeletePathParameters.FakedeletecoffeeidDeletePathParameters1Boxed](#fakedeletecoffeeiddeletepathparameters1boxed)
sealed interface for validated payloads | +| record | [FakedeletecoffeeidDeletePathParameters.FakedeletecoffeeidDeletePathParameters1BoxedMap](#fakedeletecoffeeiddeletepathparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [FakedeletecoffeeidDeletePathParameters.FakedeletecoffeeidDeletePathParameters1](#fakedeletecoffeeiddeletepathparameters1)
schema class | +| static class | [FakedeletecoffeeidDeletePathParameters.FakedeletecoffeeidDeletePathParametersMapBuilder](#fakedeletecoffeeiddeletepathparametersmapbuilder)
builder for Map payloads | +| static class | [FakedeletecoffeeidDeletePathParameters.FakedeletecoffeeidDeletePathParametersMap](#fakedeletecoffeeiddeletepathparametersmap)
output class for Map payloads | +| sealed interface | [FakedeletecoffeeidDeletePathParameters.FakedeletecoffeeidDeleteadditionalPropertiesBoxed](#fakedeletecoffeeiddeleteadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [FakedeletecoffeeidDeletePathParameters.FakedeletecoffeeidDeleteadditionalPropertiesBoxedVoid](#fakedeletecoffeeiddeleteadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [FakedeletecoffeeidDeletePathParameters.FakedeletecoffeeidDeleteadditionalPropertiesBoxedBoolean](#fakedeletecoffeeiddeleteadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [FakedeletecoffeeidDeletePathParameters.FakedeletecoffeeidDeleteadditionalPropertiesBoxedNumber](#fakedeletecoffeeiddeleteadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [FakedeletecoffeeidDeletePathParameters.FakedeletecoffeeidDeleteadditionalPropertiesBoxedString](#fakedeletecoffeeiddeleteadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [FakedeletecoffeeidDeletePathParameters.FakedeletecoffeeidDeleteadditionalPropertiesBoxedList](#fakedeletecoffeeiddeleteadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [FakedeletecoffeeidDeletePathParameters.FakedeletecoffeeidDeleteadditionalPropertiesBoxedMap](#fakedeletecoffeeiddeleteadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [FakedeletecoffeeidDeletePathParameters.FakedeletecoffeeidDeleteadditionalProperties](#fakedeletecoffeeiddeleteadditionalproperties)
schema class | + +## FakedeletecoffeeidDeletePathParameters1Boxed +public sealed interface FakedeletecoffeeidDeletePathParameters1Boxed
+permits
+[FakedeletecoffeeidDeletePathParameters1BoxedMap](#fakedeletecoffeeiddeletepathparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## FakedeletecoffeeidDeletePathParameters1BoxedMap +public record FakedeletecoffeeidDeletePathParameters1BoxedMap
+implements [FakedeletecoffeeidDeletePathParameters1Boxed](#fakedeletecoffeeiddeletepathparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakedeletecoffeeidDeletePathParameters1BoxedMap([FakedeletecoffeeidDeletePathParametersMap](#fakedeletecoffeeiddeletepathparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakedeletecoffeeidDeletePathParametersMap](#fakedeletecoffeeiddeletepathparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakedeletecoffeeidDeletePathParameters1 +public static class FakedeletecoffeeidDeletePathParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.FakedeletecoffeeidDeletePathParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +FakedeletecoffeeidDeletePathParameters.FakedeletecoffeeidDeletePathParametersMap validatedPayload = + FakedeletecoffeeidDeletePathParameters.FakedeletecoffeeidDeletePathParameters1.validate( + new FakedeletecoffeeidDeletePathParameters.FakedeletecoffeeidDeletePathParametersMapBuilder() + .id("a") + + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("id", [Schema0.Schema01.class](../../../paths/fakedeletecoffeeid/delete/parameters/parameter0/Schema0.md#schema01))
)
| +| Set | required = Set.of(
    "id"
)
| +| Class | additionalProperties = [FakedeletecoffeeidDeleteadditionalProperties.class](#fakedeletecoffeeiddeleteadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakedeletecoffeeidDeletePathParametersMap](#fakedeletecoffeeiddeletepathparametersmap) | validate([Map<?, ?>](#fakedeletecoffeeiddeletepathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [FakedeletecoffeeidDeletePathParameters1BoxedMap](#fakedeletecoffeeiddeletepathparameters1boxedmap) | validateAndBox([Map<?, ?>](#fakedeletecoffeeiddeletepathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [FakedeletecoffeeidDeletePathParameters1Boxed](#fakedeletecoffeeiddeletepathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## FakedeletecoffeeidDeletePathParametersMap0Builder +public class FakedeletecoffeeidDeletePathParametersMap0Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakedeletecoffeeidDeletePathParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | + +## FakedeletecoffeeidDeletePathParametersMapBuilder +public class FakedeletecoffeeidDeletePathParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakedeletecoffeeidDeletePathParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakedeletecoffeeidDeletePathParametersMap0Builder](#fakedeletecoffeeiddeletepathparametersmap0builder) | id(String value) | + +## FakedeletecoffeeidDeletePathParametersMap +public static class FakedeletecoffeeidDeletePathParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [FakedeletecoffeeidDeletePathParametersMap](#fakedeletecoffeeiddeletepathparametersmap) | of([Map](#fakedeletecoffeeiddeletepathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| String | id()
| + +## FakedeletecoffeeidDeleteadditionalPropertiesBoxed +public sealed interface FakedeletecoffeeidDeleteadditionalPropertiesBoxed
+permits
+[FakedeletecoffeeidDeleteadditionalPropertiesBoxedVoid](#fakedeletecoffeeiddeleteadditionalpropertiesboxedvoid), +[FakedeletecoffeeidDeleteadditionalPropertiesBoxedBoolean](#fakedeletecoffeeiddeleteadditionalpropertiesboxedboolean), +[FakedeletecoffeeidDeleteadditionalPropertiesBoxedNumber](#fakedeletecoffeeiddeleteadditionalpropertiesboxednumber), +[FakedeletecoffeeidDeleteadditionalPropertiesBoxedString](#fakedeletecoffeeiddeleteadditionalpropertiesboxedstring), +[FakedeletecoffeeidDeleteadditionalPropertiesBoxedList](#fakedeletecoffeeiddeleteadditionalpropertiesboxedlist), +[FakedeletecoffeeidDeleteadditionalPropertiesBoxedMap](#fakedeletecoffeeiddeleteadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## FakedeletecoffeeidDeleteadditionalPropertiesBoxedVoid +public record FakedeletecoffeeidDeleteadditionalPropertiesBoxedVoid
+implements [FakedeletecoffeeidDeleteadditionalPropertiesBoxed](#fakedeletecoffeeiddeleteadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakedeletecoffeeidDeleteadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakedeletecoffeeidDeleteadditionalPropertiesBoxedBoolean +public record FakedeletecoffeeidDeleteadditionalPropertiesBoxedBoolean
+implements [FakedeletecoffeeidDeleteadditionalPropertiesBoxed](#fakedeletecoffeeiddeleteadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakedeletecoffeeidDeleteadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakedeletecoffeeidDeleteadditionalPropertiesBoxedNumber +public record FakedeletecoffeeidDeleteadditionalPropertiesBoxedNumber
+implements [FakedeletecoffeeidDeleteadditionalPropertiesBoxed](#fakedeletecoffeeiddeleteadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakedeletecoffeeidDeleteadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakedeletecoffeeidDeleteadditionalPropertiesBoxedString +public record FakedeletecoffeeidDeleteadditionalPropertiesBoxedString
+implements [FakedeletecoffeeidDeleteadditionalPropertiesBoxed](#fakedeletecoffeeiddeleteadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakedeletecoffeeidDeleteadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakedeletecoffeeidDeleteadditionalPropertiesBoxedList +public record FakedeletecoffeeidDeleteadditionalPropertiesBoxedList
+implements [FakedeletecoffeeidDeleteadditionalPropertiesBoxed](#fakedeletecoffeeiddeleteadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakedeletecoffeeidDeleteadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakedeletecoffeeidDeleteadditionalPropertiesBoxedMap +public record FakedeletecoffeeidDeleteadditionalPropertiesBoxedMap
+implements [FakedeletecoffeeidDeleteadditionalPropertiesBoxed](#fakedeletecoffeeiddeleteadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakedeletecoffeeidDeleteadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakedeletecoffeeidDeleteadditionalProperties +public static class FakedeletecoffeeidDeleteadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/delete/FakedeletecoffeeidDeleteResponses.md b/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/delete/FakedeletecoffeeidDeleteResponses.md new file mode 100644 index 00000000000..a3a6107c9ae --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/delete/FakedeletecoffeeidDeleteResponses.md @@ -0,0 +1,40 @@ +# FakedeletecoffeeidDeleteResponses + +public class FakedeletecoffeeidDeleteResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakedeletecoffeeidDeleteCode200Response](#endpointfakedeletecoffeeiddeletecode200response)
the response for 200 | +| record | [EndpointFakedeletecoffeeidDeleteCodedefaultResponse](#endpointfakedeletecoffeeiddeletecodedefaultresponse)
the response for default | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakedeletecoffeeidDeleteCode200Response](#endpointfakedeletecoffeeiddeletecode200response), +[EndpointFakedeletecoffeeidDeleteCodedefaultResponse](#endpointfakedeletecoffeeiddeletecodedefaultresponse) + +a sealed interface that stores endpoint responses + +## EndpointFakedeletecoffeeidDeleteCode200Response +public record EndpointFakedeletecoffeeidDeleteCode200Response( + HttpResponse response, + Void body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + +## EndpointFakedeletecoffeeidDeleteCodedefaultResponse +public record EndpointFakedeletecoffeeidDeleteCodedefaultResponse( + HttpResponse response, + Void body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/delete/PathParameters.md b/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/delete/PathParameters.md deleted file mode 100644 index 7f4d342867e..00000000000 --- a/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/delete/PathParameters.md +++ /dev/null @@ -1,268 +0,0 @@ -# PathParameters -public class PathParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [PathParameters.PathParameters1Boxed](#pathparameters1boxed)
sealed interface for validated payloads | -| record | [PathParameters.PathParameters1BoxedMap](#pathparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.PathParameters1](#pathparameters1)
schema class | -| static class | [PathParameters.PathParametersMapBuilder](#pathparametersmapbuilder)
builder for Map payloads | -| static class | [PathParameters.PathParametersMap](#pathparametersmap)
output class for Map payloads | -| sealed interface | [PathParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [PathParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [PathParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [PathParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [PathParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [PathParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [PathParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.AdditionalProperties](#additionalproperties)
schema class | - -## PathParameters1Boxed -public sealed interface PathParameters1Boxed
-permits
-[PathParameters1BoxedMap](#pathparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## PathParameters1BoxedMap -public record PathParameters1BoxedMap
-implements [PathParameters1Boxed](#pathparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParameters1BoxedMap([PathParametersMap](#pathparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## PathParameters1 -public static class PathParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.PathParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -PathParameters.PathParametersMap validatedPayload = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .id("a") - - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("id", [Schema0.Schema01.class](../../../paths/fakedeletecoffeeid/delete/parameters/parameter0/Schema0.md#schema01))
)
| -| Set | required = Set.of(
    "id"
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | validate([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1BoxedMap](#pathparameters1boxedmap) | validateAndBox([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1Boxed](#pathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## PathParametersMap0Builder -public class PathParametersMap0Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | - -## PathParametersMapBuilder -public class PathParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap0Builder](#pathparametersmap0builder) | id(String value) | - -## PathParametersMap -public static class PathParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [PathParametersMap](#pathparametersmap) | of([Map](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| String | id()
| - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/delete/Responses.md b/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/delete/Responses.md deleted file mode 100644 index 2f4191ea902..00000000000 --- a/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/delete/Responses.md +++ /dev/null @@ -1,40 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | -| record | [EndpointCodedefaultResponse](#endpointcodedefaultresponse)
the response for default | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response), -[EndpointCodedefaultResponse](#endpointcodedefaultresponse) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - -## EndpointCodedefaultResponse -public record EndpointCodedefaultResponse( - HttpResponse response, - Void body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/delete/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/delete/responses/Code200Response.md deleted file mode 100644 index e89c75b2e12..00000000000 --- a/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/delete/responses/Code200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# Code200Response - -public class Code200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) - -A class (extended from the $ref class) that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## Code200Response1 -public static class Code200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
- -a class that deserializes responses, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/delete/responses/CodedefaultResponse.md b/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/delete/responses/CodedefaultResponse.md deleted file mode 100644 index c2dd3d15c8b..00000000000 --- a/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/delete/responses/CodedefaultResponse.md +++ /dev/null @@ -1,32 +0,0 @@ -# CodedefaultResponse - -public class CodedefaultResponse - -A class that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [CodedefaultResponse.CodedefaultResponse1](#codedefaultresponse1)
class that deserializes responses | - -## CodedefaultResponse1 -public static class CodedefaultResponse1
-extends ResponseDeserializer - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| CodedefaultResponse1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = MapUtils.makeMap(
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/delete/responses/FakedeletecoffeeidDeleteCode200Response.md b/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/delete/responses/FakedeletecoffeeidDeleteCode200Response.md new file mode 100644 index 00000000000..6c115aadfcf --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/delete/responses/FakedeletecoffeeidDeleteCode200Response.md @@ -0,0 +1,17 @@ +# FakedeletecoffeeidDeleteCode200Response + +public class FakedeletecoffeeidDeleteCode200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) + +A class (extended from the $ref class) that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [FakedeletecoffeeidDeleteCode200Response.FakedeletecoffeeidDeleteCode200Response1](#fakedeletecoffeeiddeletecode200response1)
class that deserializes responses | + +## FakedeletecoffeeidDeleteCode200Response1 +public static class FakedeletecoffeeidDeleteCode200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
+ +a class that deserializes responses, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/delete/responses/FakedeletecoffeeidDeleteCodedefaultResponse.md b/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/delete/responses/FakedeletecoffeeidDeleteCodedefaultResponse.md new file mode 100644 index 00000000000..452d7bdc061 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakedeletecoffeeid/delete/responses/FakedeletecoffeeidDeleteCodedefaultResponse.md @@ -0,0 +1,32 @@ +# FakedeletecoffeeidDeleteCodedefaultResponse + +public class FakedeletecoffeeidDeleteCodedefaultResponse + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [FakedeletecoffeeidDeleteCodedefaultResponse.FakedeletecoffeeidDeleteCodedefaultResponse1](#fakedeletecoffeeiddeletecodedefaultresponse1)
class that deserializes responses | + +## FakedeletecoffeeidDeleteCodedefaultResponse1 +public static class FakedeletecoffeeidDeleteCodedefaultResponse1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakedeletecoffeeidDeleteCodedefaultResponse1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakehealth/FakehealthGet.md b/samples/client/petstore/java/docs/paths/fakehealth/FakehealthGet.md new file mode 100644 index 00000000000..7588058f9d5 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakehealth/FakehealthGet.md @@ -0,0 +1,141 @@ +# FakehealthGet + +public class FakehealthGet + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Get](#get)
The class that has a get method to call the endpoint | +| interface | [FakeHealthGetOperation](#fakehealthgetoperation)
The interface that has a fakeHealthGet method to call the endpoint | +| static class | [GetRequest](#getrequest)
The request inputs class | +| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | + +## Get +public static class Get extends ApiClient.ApiClient1 implements GetOperation
+ +a class that allows one to call the endpoint using a method named get + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakehealth.get.responses.FakehealthGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakehealth.FakehealthGet; +import org.openapijsonschematools.client.paths.fakehealth.get.FakehealthGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakehealthGet.Get apiClient = new FakehealthGet.Get(apiConfiguration, schemaConfiguration); + + +var request = new FakehealthGet.GetRequestBuilder().build(); + +FakehealthGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakehealthGetResponses.EndpointFakehealthGetCode200Response castResponse = (FakehealthGetResponses.EndpointFakehealthGetCode200Response) response; +FakehealthGetCode200Response.ApplicationjsonResponseBody deserializedBody = (FakehealthGetCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakehealthGetResponses.EndpointResponse](../../paths/fakehealth/get/FakehealthGetResponses.md#endpointresponse) | get([GetRequest](#getrequest) request) | + +## FakeHealthGetOperation +public interface FakeHealthGetOperation
+ +an interface that allows one to call the endpoint using a method named fakeHealthGet by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakehealthGetResponses.EndpointResponse](../../paths/fakehealth/get/FakehealthGetResponses.md#endpointresponse) | fakeHealthGet([GetRequest](#getrequest) request) | + +## GetRequest +public static class GetRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## GetRequestBuilder +public static class GetRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| GetRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | +| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakehealth/Get.md b/samples/client/petstore/java/docs/paths/fakehealth/Get.md deleted file mode 100644 index 599ca6ae6c0..00000000000 --- a/samples/client/petstore/java/docs/paths/fakehealth/Get.md +++ /dev/null @@ -1,130 +0,0 @@ -# Get - -public class Get - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Get1](#get1)
The class that has a get method to call the endpoint | -| static class | [GetRequest](#getrequest)
The request inputs class | -| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | - -## Get1 -public static class Get1 extends ApiClient.ApiClient1 implements GetOperation
- -a class that allows one to call the endpoint using a method named get - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakehealth.get.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakehealth.Get; -import org.openapijsonschematools.client.paths.fakehealth.get.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Get.Get1 apiClient = new Get.Get1(apiConfiguration, schemaConfiguration); - - -var request = new GetRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.get(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -Code200Response.ApplicationjsonResponseBody deserializedBody = (Code200Response.ApplicationjsonResponseBody) castResponse.body; -// handle deserialized body here -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakehealth/get/Responses.md#endpointresponse) | get([GetRequest](#getrequest) request) | - -## GetRequest -public static class GetRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## GetRequestBuilder -public static class GetRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| GetRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | -| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakehealth/get/FakehealthGetResponses.md b/samples/client/petstore/java/docs/paths/fakehealth/get/FakehealthGetResponses.md new file mode 100644 index 00000000000..1e9033aabea --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakehealth/get/FakehealthGetResponses.md @@ -0,0 +1,29 @@ +# FakehealthGetResponses + +public class FakehealthGetResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakehealthGetCode200Response](#endpointfakehealthgetcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakehealthGetCode200Response](#endpointfakehealthgetcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakehealthGetCode200Response +public record EndpointFakehealthGetCode200Response( + HttpResponse response, + [FakehealthGetCode200Response.SealedResponseBody](../../../paths/fakehealth/get/responses/FakehealthGetCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakehealth/get/Responses.md b/samples/client/petstore/java/docs/paths/fakehealth/get/Responses.md deleted file mode 100644 index 212897f60f6..00000000000 --- a/samples/client/petstore/java/docs/paths/fakehealth/get/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/fakehealth/get/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakehealth/get/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakehealth/get/responses/Code200Response.md deleted file mode 100644 index aa198ccee86..00000000000 --- a/samples/client/petstore/java/docs/paths/fakehealth/get/responses/Code200Response.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakehealth/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakehealth/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.[HealthCheckResult1Boxed](../../../../components/schemas/HealthCheckResult.md#healthcheckresult1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.[HealthCheckResult1Boxed](../../../../components/schemas/HealthCheckResult.md#healthcheckresult1boxed) | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakehealth/get/responses/FakehealthGetCode200Response.md b/samples/client/petstore/java/docs/paths/fakehealth/get/responses/FakehealthGetCode200Response.md new file mode 100644 index 00000000000..5e1134ff388 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakehealth/get/responses/FakehealthGetCode200Response.md @@ -0,0 +1,87 @@ +# FakehealthGetCode200Response + +public class FakehealthGetCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakehealthGetCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakehealthGetCode200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakehealthGetCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakehealthGetCode200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [FakehealthGetCode200Response.FakehealthGetCode200Response1](#fakehealthgetcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakehealth/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakehealth/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.[HealthCheckResult1Boxed](../../../../components/schemas/HealthCheckResult.md#healthcheckresult1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.[HealthCheckResult1Boxed](../../../../components/schemas/HealthCheckResult.md#healthcheckresult1boxed) | body()
returns the body passed in in the constructor | + +## FakehealthGetCode200Response1 +public static class FakehealthGetCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakehealthGetCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakeinlineadditionalproperties/FakeinlineadditionalpropertiesPost.md b/samples/client/petstore/java/docs/paths/fakeinlineadditionalproperties/FakeinlineadditionalpropertiesPost.md new file mode 100644 index 00000000000..49893d5b8b4 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeinlineadditionalproperties/FakeinlineadditionalpropertiesPost.md @@ -0,0 +1,183 @@ +# FakeinlineadditionalpropertiesPost + +public class FakeinlineadditionalpropertiesPost + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Post](#post)
The class that has a post method to call the endpoint | +| interface | [InlineAdditionalPropertiesOperation](#inlineadditionalpropertiesoperation)
The interface that has a inlineAdditionalProperties method to call the endpoint | +| static class | [PostRequest](#postrequest)
The final request inputs class | +| static class | [PostNullableRequest](#postnullablerequest)
The initial request inputs class | +| static class | [Post0RequestBuilder](#post0requestbuilder)
A builder for the request input class | +| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | + +## Post +public static class Post extends ApiClient.ApiClient1 implements PostOperation
+ +a class that allows one to call the endpoint using a method named post + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post.FakeinlineadditionalpropertiesPostRequestBody; +import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post.requestbody.content.applicationjson.ApplicationjsonSchema; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post.responses.FakeinlineadditionalpropertiesPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.FakeinlineadditionalpropertiesPost; +import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post.FakeinlineadditionalpropertiesPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakeinlineadditionalpropertiesPost.Post apiClient = new FakeinlineadditionalpropertiesPost.Post(apiConfiguration, schemaConfiguration); + + +ApplicationjsonSchema1BoxedMap requestBodyPayload = + ApplicationjsonSchema.ApplicationjsonSchema1.validateAndBox( + new ApplicationjsonSchema.ApplicationjsonSchemaMapBuilder() + .additionalProperty("someAdditionalProperty", "a") + + .build(), + schemaConfiguration +); +FakeinlineadditionalpropertiesPost.SealedRequestBody requestBody = new FakeinlineadditionalpropertiesPost.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new FakeinlineadditionalpropertiesPost.PostRequestBuilder() + .requestBody(requestBody) + .build(); + +FakeinlineadditionalpropertiesPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeinlineadditionalpropertiesPostResponses.EndpointFakeinlineadditionalpropertiesPostCode200Response castResponse = (FakeinlineadditionalpropertiesPostResponses.EndpointFakeinlineadditionalpropertiesPostCode200Response) response; +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeinlineadditionalpropertiesPostResponses.EndpointResponse](../../paths/fakeinlineadditionalproperties/post/FakeinlineadditionalpropertiesPostResponses.md#endpointresponse) | post([PostRequest](#postrequest) request) | + +## InlineAdditionalPropertiesOperation +public interface InlineAdditionalPropertiesOperation
+ +an interface that allows one to call the endpoint using a method named inlineAdditionalProperties by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeinlineadditionalpropertiesPostResponses.EndpointResponse](../../paths/fakeinlineadditionalproperties/post/FakeinlineadditionalpropertiesPostResponses.md#endpointresponse) | inlineAdditionalProperties([PostRequest](#postrequest) request) | + +## PostRequest +public static class PostRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakeinlineadditionalpropertiesPostRequestBody.SealedRequestBody](../../paths/fakeinlineadditionalproperties/post/FakeinlineadditionalpropertiesPostRequestBody.md#sealedrequestbody) | requestBody | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PostNullableRequest +public static class PostNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakeinlineadditionalpropertiesPostRequestBody.@Nullable SealedRequestBody](../../paths/fakeinlineadditionalproperties/post/FakeinlineadditionalpropertiesPostRequestBody.md#sealedrequestbody) | requestBody | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| @Nullable Duration | timeout | + +## Post0RequestBuilder +public static class Post0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post0RequestBuilder(Post0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | +| [Post0RequestBuilder](#post0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Post0RequestBuilder](#post0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## PostRequestBuilder +public static class PostRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PostRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Post0RequestBuilder](#post0requestbuilder) | requestBody([FakeinlineadditionalpropertiesPostRequestBody.SealedRequestBody](../../paths/fakeinlineadditionalproperties/post/FakeinlineadditionalpropertiesPostRequestBody.md#sealedrequestbody) requestBody)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakeinlineadditionalproperties/Post.md b/samples/client/petstore/java/docs/paths/fakeinlineadditionalproperties/Post.md deleted file mode 100644 index 23787504db8..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeinlineadditionalproperties/Post.md +++ /dev/null @@ -1,172 +0,0 @@ -# Post - -public class Post - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Post1](#post1)
The class that has a post method to call the endpoint | -| static class | [PostRequest](#postrequest)
The final request inputs class | -| static class | [PostNullableRequest](#postnullablerequest)
The initial request inputs class | -| static class | [Post0RequestBuilder](#post0requestbuilder)
A builder for the request input class | -| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | - -## Post1 -public static class Post1 extends ApiClient.ApiClient1 implements PostOperation
- -a class that allows one to call the endpoint using a method named post - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post.RequestBody; -import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post.requestbody.content.applicationjson.ApplicationjsonSchema; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.Post; -import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Post.Post1 apiClient = new Post.Post1(apiConfiguration, schemaConfiguration); - - -ApplicationjsonSchema1BoxedMap requestBodyPayload = - ApplicationjsonSchema.ApplicationjsonSchema1.validateAndBox( - new ApplicationjsonSchema.ApplicationjsonSchemaMapBuilder() - .additionalProperty("someAdditionalProperty", "a") - - .build(), - schemaConfiguration -); -Post.SealedRequestBody requestBody = new Post.ApplicationjsonRequestBody(requestBodyPayload); - -var request = new PostRequestBuilder() - .requestBody(requestBody) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.post(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakeinlineadditionalproperties/post/Responses.md#endpointresponse) | post([PostRequest](#postrequest) request) | - -## PostRequest -public static class PostRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.SealedRequestBody](../../paths/fakeinlineadditionalproperties/post/RequestBody.md#sealedrequestbody) | requestBody | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PostNullableRequest -public static class PostNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fakeinlineadditionalproperties/post/RequestBody.md#sealedrequestbody) | requestBody | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| @Nullable Duration | timeout | - -## Post0RequestBuilder -public static class Post0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post0RequestBuilder(Post0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | -| [Post0RequestBuilder](#post0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Post0RequestBuilder](#post0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## PostRequestBuilder -public static class PostRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PostRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Post0RequestBuilder](#post0requestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/fakeinlineadditionalproperties/post/RequestBody.md#sealedrequestbody) requestBody)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakeinlineadditionalproperties/post/FakeinlineadditionalpropertiesPostRequestBody.md b/samples/client/petstore/java/docs/paths/fakeinlineadditionalproperties/post/FakeinlineadditionalpropertiesPostRequestBody.md new file mode 100644 index 00000000000..8f6e8ff9a1d --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeinlineadditionalproperties/post/FakeinlineadditionalpropertiesPostRequestBody.md @@ -0,0 +1,90 @@ +# FakeinlineadditionalpropertiesPostRequestBody + +public class FakeinlineadditionalpropertiesPostRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakeinlineadditionalpropertiesPostRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakeinlineadditionalpropertiesPostRequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| static class | [FakeinlineadditionalpropertiesPostRequestBody.FakeinlineadditionalpropertiesPostRequestBody1](#fakeinlineadditionalpropertiespostrequestbody1)
class that serializes request bodies | +| sealed interface | [FakeinlineadditionalpropertiesPostRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [FakeinlineadditionalpropertiesPostRequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakeinlineadditionalproperties/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakeinlineadditionalproperties/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## FakeinlineadditionalpropertiesPostRequestBody1 +public static class FakeinlineadditionalpropertiesPostRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeinlineadditionalpropertiesPostRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = true
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[ApplicationjsonRequestBody](#applicationjsonrequestbody) + +sealed interface that stores request contentType + validated schema data + +## ApplicationjsonRequestBody +public record ApplicationjsonRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonRequestBody(ApplicationjsonSchema.[ApplicationjsonSchema1Boxed](../../../paths/fakeinlineadditionalproperties/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "application/json" | +| ApplicationjsonSchema.[ApplicationjsonSchema1Boxed](../../../paths/fakeinlineadditionalproperties/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakeinlineadditionalproperties/post/FakeinlineadditionalpropertiesPostResponses.md b/samples/client/petstore/java/docs/paths/fakeinlineadditionalproperties/post/FakeinlineadditionalpropertiesPostResponses.md new file mode 100644 index 00000000000..604668bd4c2 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeinlineadditionalproperties/post/FakeinlineadditionalpropertiesPostResponses.md @@ -0,0 +1,29 @@ +# FakeinlineadditionalpropertiesPostResponses + +public class FakeinlineadditionalpropertiesPostResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakeinlineadditionalpropertiesPostCode200Response](#endpointfakeinlineadditionalpropertiespostcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakeinlineadditionalpropertiesPostCode200Response](#endpointfakeinlineadditionalpropertiespostcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakeinlineadditionalpropertiesPostCode200Response +public record EndpointFakeinlineadditionalpropertiesPostCode200Response( + HttpResponse response, + Void body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakeinlineadditionalproperties/post/RequestBody.md b/samples/client/petstore/java/docs/paths/fakeinlineadditionalproperties/post/RequestBody.md deleted file mode 100644 index a7b497c88fa..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeinlineadditionalproperties/post/RequestBody.md +++ /dev/null @@ -1,90 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakeinlineadditionalproperties/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakeinlineadditionalproperties/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = true
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[ApplicationjsonRequestBody](#applicationjsonrequestbody) - -sealed interface that stores request contentType + validated schema data - -## ApplicationjsonRequestBody -public record ApplicationjsonRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonRequestBody(ApplicationjsonSchema.[ApplicationjsonSchema1Boxed](../../../paths/fakeinlineadditionalproperties/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "application/json" | -| ApplicationjsonSchema.[ApplicationjsonSchema1Boxed](../../../paths/fakeinlineadditionalproperties/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakeinlineadditionalproperties/post/Responses.md b/samples/client/petstore/java/docs/paths/fakeinlineadditionalproperties/post/Responses.md deleted file mode 100644 index d4bf4fdb8f5..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeinlineadditionalproperties/post/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakeinlineadditionalproperties/post/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakeinlineadditionalproperties/post/responses/Code200Response.md deleted file mode 100644 index e89c75b2e12..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeinlineadditionalproperties/post/responses/Code200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# Code200Response - -public class Code200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) - -A class (extended from the $ref class) that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## Code200Response1 -public static class Code200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
- -a class that deserializes responses, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/fakeinlineadditionalproperties/post/responses/FakeinlineadditionalpropertiesPostCode200Response.md b/samples/client/petstore/java/docs/paths/fakeinlineadditionalproperties/post/responses/FakeinlineadditionalpropertiesPostCode200Response.md new file mode 100644 index 00000000000..2c23bf79f3b --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeinlineadditionalproperties/post/responses/FakeinlineadditionalpropertiesPostCode200Response.md @@ -0,0 +1,17 @@ +# FakeinlineadditionalpropertiesPostCode200Response + +public class FakeinlineadditionalpropertiesPostCode200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) + +A class (extended from the $ref class) that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [FakeinlineadditionalpropertiesPostCode200Response.FakeinlineadditionalpropertiesPostCode200Response1](#fakeinlineadditionalpropertiespostcode200response1)
class that deserializes responses | + +## FakeinlineadditionalpropertiesPostCode200Response1 +public static class FakeinlineadditionalpropertiesPostCode200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
+ +a class that deserializes responses, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/fakeinlinecomposition/FakeinlinecompositionPost.md b/samples/client/petstore/java/docs/paths/fakeinlinecomposition/FakeinlinecompositionPost.md new file mode 100644 index 00000000000..954a304f276 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeinlinecomposition/FakeinlinecompositionPost.md @@ -0,0 +1,152 @@ +# FakeinlinecompositionPost + +public class FakeinlinecompositionPost + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Post](#post)
The class that has a post method to call the endpoint | +| interface | [InlineCompositionOperation](#inlinecompositionoperation)
The interface that has a inlineComposition method to call the endpoint | +| static class | [PostRequest](#postrequest)
The request inputs class | +| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | + +## Post +public static class Post extends ApiClient.ApiClient1 implements PostOperation
+ +a class that allows one to call the endpoint using a method named post + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.FakeinlinecompositionPostRequestBody; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.requestbody.content.applicationjson.ApplicationjsonSchema; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.FakeinlinecompositionPostQueryParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.responses.FakeinlinecompositionPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.FakeinlinecompositionPost; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.FakeinlinecompositionPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakeinlinecompositionPost.Post apiClient = new FakeinlinecompositionPost.Post(apiConfiguration, schemaConfiguration); + + +var request = new FakeinlinecompositionPost.PostRequestBuilder().build(); + +FakeinlinecompositionPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeinlinecompositionPostResponses.EndpointFakeinlinecompositionPostCode200Response castResponse = (FakeinlinecompositionPostResponses.EndpointFakeinlinecompositionPostCode200Response) response; +if (castResponse.body instanceof FakeinlinecompositionPostCode200Response.ApplicationjsonResponseBody deserializedBody) { + // handle deserialized body here +} else { + FakeinlinecompositionPostCode200Response.MultipartformdataResponseBody deserializedBody = (FakeinlinecompositionPostCode200Response.MultipartformdataResponseBody) castResponse.body; + // handle deserialized body here +} +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeinlinecompositionPostResponses.EndpointResponse](../../paths/fakeinlinecomposition/post/FakeinlinecompositionPostResponses.md#endpointresponse) | post([PostRequest](#postrequest) request) | + +## InlineCompositionOperation +public interface InlineCompositionOperation
+ +an interface that allows one to call the endpoint using a method named inlineComposition by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeinlinecompositionPostResponses.EndpointResponse](../../paths/fakeinlinecomposition/post/FakeinlinecompositionPostResponses.md#endpointresponse) | inlineComposition([PostRequest](#postrequest) request) | + +## PostRequest +public static class PostRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakeinlinecompositionPostRequestBody.@Nullable SealedRequestBody](../../paths/fakeinlinecomposition/post/FakeinlinecompositionPostRequestBody.md#sealedrequestbody) | requestBody
optional | +| [FakeinlinecompositionPostQueryParameters.@Nullable FakeinlinecompositionPostQueryParametersMap](../../paths/fakeinlinecomposition/post/FakeinlinecompositionPostQueryParameters.md#fakeinlinecompositionpostqueryparametersmap) | queryParameters
optional | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PostRequestBuilder +public static class PostRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PostRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | +| [PostRequestBuilder](#postrequestbuilder) | requestBody([FakeinlinecompositionPostRequestBody.SealedRequestBody](../../paths/fakeinlinecomposition/post/FakeinlinecompositionPostRequestBody.md#sealedrequestbody) requestBody)
sets the optional property | +| [PostRequestBuilder](#postrequestbuilder) | queryParameters([FakeinlinecompositionPostQueryParametersFakeinlinecompositionPostQueryParametersMap](../../paths/fakeinlinecomposition/post/FakeinlinecompositionPostQueryParameters.md#fakeinlinecompositionpostqueryparametersmap) queryParameters)
sets the optional property | +| [PostRequestBuilder](#postrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [PostRequestBuilder](#postrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakeinlinecomposition/Post.md b/samples/client/petstore/java/docs/paths/fakeinlinecomposition/Post.md deleted file mode 100644 index e2d3daaae41..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeinlinecomposition/Post.md +++ /dev/null @@ -1,141 +0,0 @@ -# Post - -public class Post - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Post1](#post1)
The class that has a post method to call the endpoint | -| static class | [PostRequest](#postrequest)
The request inputs class | -| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | - -## Post1 -public static class Post1 extends ApiClient.ApiClient1 implements PostOperation
- -a class that allows one to call the endpoint using a method named post - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.RequestBody; -import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.requestbody.content.applicationjson.ApplicationjsonSchema; -import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.QueryParameters; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakeinlinecomposition.Post; -import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Post.Post1 apiClient = new Post.Post1(apiConfiguration, schemaConfiguration); - - -var request = new PostRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.post(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -if (castResponse.body instanceof Code200Response.ApplicationjsonResponseBody deserializedBody) { - // handle deserialized body here -} else { - Code200Response.MultipartformdataResponseBody deserializedBody = (Code200Response.MultipartformdataResponseBody) castResponse.body; - // handle deserialized body here -} -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakeinlinecomposition/post/Responses.md#endpointresponse) | post([PostRequest](#postrequest) request) | - -## PostRequest -public static class PostRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fakeinlinecomposition/post/RequestBody.md#sealedrequestbody) | requestBody
optional | -| [QueryParameters.@Nullable QueryParametersMap](../../paths/fakeinlinecomposition/post/QueryParameters.md#queryparametersmap) | queryParameters
optional | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PostRequestBuilder -public static class PostRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PostRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | -| [PostRequestBuilder](#postrequestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/fakeinlinecomposition/post/RequestBody.md#sealedrequestbody) requestBody)
sets the optional property | -| [PostRequestBuilder](#postrequestbuilder) | queryParameters([QueryParametersQueryParametersMap](../../paths/fakeinlinecomposition/post/QueryParameters.md#queryparametersmap) queryParameters)
sets the optional property | -| [PostRequestBuilder](#postrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [PostRequestBuilder](#postrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/FakeinlinecompositionPostQueryParameters.md b/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/FakeinlinecompositionPostQueryParameters.md new file mode 100644 index 00000000000..c741dbb86a4 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/FakeinlinecompositionPostQueryParameters.md @@ -0,0 +1,264 @@ +# FakeinlinecompositionPostQueryParameters +public class FakeinlinecompositionPostQueryParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [FakeinlinecompositionPostQueryParameters.FakeinlinecompositionPostQueryParameters1Boxed](#fakeinlinecompositionpostqueryparameters1boxed)
sealed interface for validated payloads | +| record | [FakeinlinecompositionPostQueryParameters.FakeinlinecompositionPostQueryParameters1BoxedMap](#fakeinlinecompositionpostqueryparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [FakeinlinecompositionPostQueryParameters.FakeinlinecompositionPostQueryParameters1](#fakeinlinecompositionpostqueryparameters1)
schema class | +| static class | [FakeinlinecompositionPostQueryParameters.FakeinlinecompositionPostQueryParametersMapBuilder](#fakeinlinecompositionpostqueryparametersmapbuilder)
builder for Map payloads | +| static class | [FakeinlinecompositionPostQueryParameters.FakeinlinecompositionPostQueryParametersMap](#fakeinlinecompositionpostqueryparametersmap)
output class for Map payloads | +| sealed interface | [FakeinlinecompositionPostQueryParameters.FakeinlinecompositionPostadditionalPropertiesBoxed](#fakeinlinecompositionpostadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [FakeinlinecompositionPostQueryParameters.FakeinlinecompositionPostadditionalPropertiesBoxedVoid](#fakeinlinecompositionpostadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [FakeinlinecompositionPostQueryParameters.FakeinlinecompositionPostadditionalPropertiesBoxedBoolean](#fakeinlinecompositionpostadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [FakeinlinecompositionPostQueryParameters.FakeinlinecompositionPostadditionalPropertiesBoxedNumber](#fakeinlinecompositionpostadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [FakeinlinecompositionPostQueryParameters.FakeinlinecompositionPostadditionalPropertiesBoxedString](#fakeinlinecompositionpostadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [FakeinlinecompositionPostQueryParameters.FakeinlinecompositionPostadditionalPropertiesBoxedList](#fakeinlinecompositionpostadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [FakeinlinecompositionPostQueryParameters.FakeinlinecompositionPostadditionalPropertiesBoxedMap](#fakeinlinecompositionpostadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [FakeinlinecompositionPostQueryParameters.FakeinlinecompositionPostadditionalProperties](#fakeinlinecompositionpostadditionalproperties)
schema class | + +## FakeinlinecompositionPostQueryParameters1Boxed +public sealed interface FakeinlinecompositionPostQueryParameters1Boxed
+permits
+[FakeinlinecompositionPostQueryParameters1BoxedMap](#fakeinlinecompositionpostqueryparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## FakeinlinecompositionPostQueryParameters1BoxedMap +public record FakeinlinecompositionPostQueryParameters1BoxedMap
+implements [FakeinlinecompositionPostQueryParameters1Boxed](#fakeinlinecompositionpostqueryparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeinlinecompositionPostQueryParameters1BoxedMap([FakeinlinecompositionPostQueryParametersMap](#fakeinlinecompositionpostqueryparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeinlinecompositionPostQueryParametersMap](#fakeinlinecompositionpostqueryparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeinlinecompositionPostQueryParameters1 +public static class FakeinlinecompositionPostQueryParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.FakeinlinecompositionPostQueryParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +FakeinlinecompositionPostQueryParameters.FakeinlinecompositionPostQueryParametersMap validatedPayload = + FakeinlinecompositionPostQueryParameters.FakeinlinecompositionPostQueryParameters1.validate( + new FakeinlinecompositionPostQueryParameters.FakeinlinecompositionPostQueryParametersMapBuilder() + .compositionInProperty( + MapUtils.makeMap( + ) + ) + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("compositionAtRoot", [Schema0.Schema01.class](../../../paths/fakeinlinecomposition/post/parameters/parameter0/Schema0.md#schema01)),
    new PropertyEntry("compositionInProperty", [Schema1.Schema11.class](../../../paths/fakeinlinecomposition/post/parameters/parameter1/Schema1.md#schema11))
)
| +| Class | additionalProperties = [FakeinlinecompositionPostadditionalProperties.class](#fakeinlinecompositionpostadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeinlinecompositionPostQueryParametersMap](#fakeinlinecompositionpostqueryparametersmap) | validate([Map<?, ?>](#fakeinlinecompositionpostqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [FakeinlinecompositionPostQueryParameters1BoxedMap](#fakeinlinecompositionpostqueryparameters1boxedmap) | validateAndBox([Map<?, ?>](#fakeinlinecompositionpostqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [FakeinlinecompositionPostQueryParameters1Boxed](#fakeinlinecompositionpostqueryparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## FakeinlinecompositionPostQueryParametersMapBuilder +public class FakeinlinecompositionPostQueryParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeinlinecompositionPostQueryParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | +| [FakeinlinecompositionPostQueryParametersMapBuilder](#fakeinlinecompositionpostqueryparametersmapbuilder) | compositionAtRoot(Void value) | +| [FakeinlinecompositionPostQueryParametersMapBuilder](#fakeinlinecompositionpostqueryparametersmapbuilder) | compositionAtRoot(boolean value) | +| [FakeinlinecompositionPostQueryParametersMapBuilder](#fakeinlinecompositionpostqueryparametersmapbuilder) | compositionAtRoot(String value) | +| [FakeinlinecompositionPostQueryParametersMapBuilder](#fakeinlinecompositionpostqueryparametersmapbuilder) | compositionAtRoot(int value) | +| [FakeinlinecompositionPostQueryParametersMapBuilder](#fakeinlinecompositionpostqueryparametersmapbuilder) | compositionAtRoot(float value) | +| [FakeinlinecompositionPostQueryParametersMapBuilder](#fakeinlinecompositionpostqueryparametersmapbuilder) | compositionAtRoot(long value) | +| [FakeinlinecompositionPostQueryParametersMapBuilder](#fakeinlinecompositionpostqueryparametersmapbuilder) | compositionAtRoot(double value) | +| [FakeinlinecompositionPostQueryParametersMapBuilder](#fakeinlinecompositionpostqueryparametersmapbuilder) | compositionAtRoot(List value) | +| [FakeinlinecompositionPostQueryParametersMapBuilder](#fakeinlinecompositionpostqueryparametersmapbuilder) | compositionAtRoot(Map value) | +| [FakeinlinecompositionPostQueryParametersMapBuilder](#fakeinlinecompositionpostqueryparametersmapbuilder) | compositionInProperty(Map value) | + +## FakeinlinecompositionPostQueryParametersMap +public static class FakeinlinecompositionPostQueryParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [FakeinlinecompositionPostQueryParametersMap](#fakeinlinecompositionpostqueryparametersmap) | of([Map](#fakeinlinecompositionpostqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| @Nullable Object | compositionAtRoot()
[optional] | +| [Schema1.SchemaMap1](../../../paths/fakeinlinecomposition/post/parameters/parameter1/Schema1.md#schemamap1) | compositionInProperty()
[optional] | + +## FakeinlinecompositionPostadditionalPropertiesBoxed +public sealed interface FakeinlinecompositionPostadditionalPropertiesBoxed
+permits
+[FakeinlinecompositionPostadditionalPropertiesBoxedVoid](#fakeinlinecompositionpostadditionalpropertiesboxedvoid), +[FakeinlinecompositionPostadditionalPropertiesBoxedBoolean](#fakeinlinecompositionpostadditionalpropertiesboxedboolean), +[FakeinlinecompositionPostadditionalPropertiesBoxedNumber](#fakeinlinecompositionpostadditionalpropertiesboxednumber), +[FakeinlinecompositionPostadditionalPropertiesBoxedString](#fakeinlinecompositionpostadditionalpropertiesboxedstring), +[FakeinlinecompositionPostadditionalPropertiesBoxedList](#fakeinlinecompositionpostadditionalpropertiesboxedlist), +[FakeinlinecompositionPostadditionalPropertiesBoxedMap](#fakeinlinecompositionpostadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## FakeinlinecompositionPostadditionalPropertiesBoxedVoid +public record FakeinlinecompositionPostadditionalPropertiesBoxedVoid
+implements [FakeinlinecompositionPostadditionalPropertiesBoxed](#fakeinlinecompositionpostadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeinlinecompositionPostadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeinlinecompositionPostadditionalPropertiesBoxedBoolean +public record FakeinlinecompositionPostadditionalPropertiesBoxedBoolean
+implements [FakeinlinecompositionPostadditionalPropertiesBoxed](#fakeinlinecompositionpostadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeinlinecompositionPostadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeinlinecompositionPostadditionalPropertiesBoxedNumber +public record FakeinlinecompositionPostadditionalPropertiesBoxedNumber
+implements [FakeinlinecompositionPostadditionalPropertiesBoxed](#fakeinlinecompositionpostadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeinlinecompositionPostadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeinlinecompositionPostadditionalPropertiesBoxedString +public record FakeinlinecompositionPostadditionalPropertiesBoxedString
+implements [FakeinlinecompositionPostadditionalPropertiesBoxed](#fakeinlinecompositionpostadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeinlinecompositionPostadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeinlinecompositionPostadditionalPropertiesBoxedList +public record FakeinlinecompositionPostadditionalPropertiesBoxedList
+implements [FakeinlinecompositionPostadditionalPropertiesBoxed](#fakeinlinecompositionpostadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeinlinecompositionPostadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeinlinecompositionPostadditionalPropertiesBoxedMap +public record FakeinlinecompositionPostadditionalPropertiesBoxedMap
+implements [FakeinlinecompositionPostadditionalPropertiesBoxed](#fakeinlinecompositionpostadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeinlinecompositionPostadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeinlinecompositionPostadditionalProperties +public static class FakeinlinecompositionPostadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/FakeinlinecompositionPostRequestBody.md b/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/FakeinlinecompositionPostRequestBody.md new file mode 100644 index 00000000000..33420abb4b9 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/FakeinlinecompositionPostRequestBody.md @@ -0,0 +1,128 @@ +# FakeinlinecompositionPostRequestBody + +public class FakeinlinecompositionPostRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakeinlinecompositionPostRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakeinlinecompositionPostRequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| record | [FakeinlinecompositionPostRequestBody.MultipartformdataMediaType](#multipartformdatamediatype)
record storing schema + encoding for a specific contentType | +| static class | [FakeinlinecompositionPostRequestBody.FakeinlinecompositionPostRequestBody1](#fakeinlinecompositionpostrequestbody1)
class that serializes request bodies | +| sealed interface | [FakeinlinecompositionPostRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [FakeinlinecompositionPostRequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | +| record | [FakeinlinecompositionPostRequestBody.MultipartformdataRequestBody](#multipartformdatarequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype), +[MultipartformdataMediaType](#multipartformdatamediatype) + +sealed interface that stores schema and encoding info + + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakeinlinecomposition/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakeinlinecomposition/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## MultipartformdataMediaType +public record MultipartformdataMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[MultipartformdataSchema.MultipartformdataSchema1](../../../paths/fakeinlinecomposition/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| MultipartformdataMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [MultipartformdataSchema.MultipartformdataSchema1](../../../paths/fakeinlinecomposition/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## FakeinlinecompositionPostRequestBody1 +public static class FakeinlinecompositionPostRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeinlinecompositionPostRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = false
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)()),
    new AbstractMap.SimpleEntry<>("multipart/form-data", new [MultipartformdataMediaType](#multipartformdatamediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[ApplicationjsonRequestBody](#applicationjsonrequestbody), +[MultipartformdataRequestBody](#multipartformdatarequestbody) + +sealed interface that stores request contentType + validated schema data + +## ApplicationjsonRequestBody +public record ApplicationjsonRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonRequestBody(ApplicationjsonSchema.[ApplicationjsonSchema1Boxed](../../../paths/fakeinlinecomposition/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "application/json" | +| ApplicationjsonSchema.[ApplicationjsonSchema1Boxed](../../../paths/fakeinlinecomposition/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1boxed) | body()
returns the body passed in in the constructor | +## MultipartformdataRequestBody +public record MultipartformdataRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="multipart/form-data" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| MultipartformdataRequestBody(MultipartformdataSchema.[MultipartformdataSchema1Boxed](../../../paths/fakeinlinecomposition/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "multipart/form-data" | +| MultipartformdataSchema.[MultipartformdataSchema1Boxed](../../../paths/fakeinlinecomposition/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/FakeinlinecompositionPostResponses.md b/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/FakeinlinecompositionPostResponses.md new file mode 100644 index 00000000000..86492517c79 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/FakeinlinecompositionPostResponses.md @@ -0,0 +1,29 @@ +# FakeinlinecompositionPostResponses + +public class FakeinlinecompositionPostResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakeinlinecompositionPostCode200Response](#endpointfakeinlinecompositionpostcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakeinlinecompositionPostCode200Response](#endpointfakeinlinecompositionpostcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakeinlinecompositionPostCode200Response +public record EndpointFakeinlinecompositionPostCode200Response( + HttpResponse response, + [FakeinlinecompositionPostCode200Response.SealedResponseBody](../../../paths/fakeinlinecomposition/post/responses/FakeinlinecompositionPostCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/QueryParameters.md b/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/QueryParameters.md deleted file mode 100644 index 49af6fa33c5..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/QueryParameters.md +++ /dev/null @@ -1,264 +0,0 @@ -# QueryParameters -public class QueryParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [QueryParameters.QueryParameters1Boxed](#queryparameters1boxed)
sealed interface for validated payloads | -| record | [QueryParameters.QueryParameters1BoxedMap](#queryparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [QueryParameters.QueryParameters1](#queryparameters1)
schema class | -| static class | [QueryParameters.QueryParametersMapBuilder](#queryparametersmapbuilder)
builder for Map payloads | -| static class | [QueryParameters.QueryParametersMap](#queryparametersmap)
output class for Map payloads | -| sealed interface | [QueryParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [QueryParameters.AdditionalProperties](#additionalproperties)
schema class | - -## QueryParameters1Boxed -public sealed interface QueryParameters1Boxed
-permits
-[QueryParameters1BoxedMap](#queryparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## QueryParameters1BoxedMap -public record QueryParameters1BoxedMap
-implements [QueryParameters1Boxed](#queryparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParameters1BoxedMap([QueryParametersMap](#queryparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap](#queryparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## QueryParameters1 -public static class QueryParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.QueryParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -QueryParameters.QueryParametersMap validatedPayload = - QueryParameters.QueryParameters1.validate( - new QueryParameters.QueryParametersMapBuilder() - .compositionInProperty( - MapUtils.makeMap( - ) - ) - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("compositionAtRoot", [Schema0.Schema01.class](../../../paths/fakeinlinecomposition/post/parameters/parameter0/Schema0.md#schema01)),
    new PropertyEntry("compositionInProperty", [Schema1.Schema11.class](../../../paths/fakeinlinecomposition/post/parameters/parameter1/Schema1.md#schema11))
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap](#queryparametersmap) | validate([Map<?, ?>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [QueryParameters1BoxedMap](#queryparameters1boxedmap) | validateAndBox([Map<?, ?>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [QueryParameters1Boxed](#queryparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## QueryParametersMapBuilder -public class QueryParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | compositionAtRoot(Void value) | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | compositionAtRoot(boolean value) | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | compositionAtRoot(String value) | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | compositionAtRoot(int value) | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | compositionAtRoot(float value) | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | compositionAtRoot(long value) | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | compositionAtRoot(double value) | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | compositionAtRoot(List value) | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | compositionAtRoot(Map value) | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | compositionInProperty(Map value) | - -## QueryParametersMap -public static class QueryParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [QueryParametersMap](#queryparametersmap) | of([Map](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| @Nullable Object | compositionAtRoot()
[optional] | -| [Schema1.SchemaMap1](../../../paths/fakeinlinecomposition/post/parameters/parameter1/Schema1.md#schemamap1) | compositionInProperty()
[optional] | - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/RequestBody.md b/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/RequestBody.md deleted file mode 100644 index 42b8f6dd39d..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/RequestBody.md +++ /dev/null @@ -1,128 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| record | [RequestBody.MultipartformdataMediaType](#multipartformdatamediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | -| record | [RequestBody.MultipartformdataRequestBody](#multipartformdatarequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype), -[MultipartformdataMediaType](#multipartformdatamediatype) - -sealed interface that stores schema and encoding info - - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakeinlinecomposition/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakeinlinecomposition/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## MultipartformdataMediaType -public record MultipartformdataMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[MultipartformdataSchema.MultipartformdataSchema1](../../../paths/fakeinlinecomposition/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| MultipartformdataMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [MultipartformdataSchema.MultipartformdataSchema1](../../../paths/fakeinlinecomposition/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = false
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)()),
    new AbstractMap.SimpleEntry<>("multipart/form-data", new [MultipartformdataMediaType](#multipartformdatamediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[ApplicationjsonRequestBody](#applicationjsonrequestbody), -[MultipartformdataRequestBody](#multipartformdatarequestbody) - -sealed interface that stores request contentType + validated schema data - -## ApplicationjsonRequestBody -public record ApplicationjsonRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonRequestBody(ApplicationjsonSchema.[ApplicationjsonSchema1Boxed](../../../paths/fakeinlinecomposition/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "application/json" | -| ApplicationjsonSchema.[ApplicationjsonSchema1Boxed](../../../paths/fakeinlinecomposition/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1boxed) | body()
returns the body passed in in the constructor | -## MultipartformdataRequestBody -public record MultipartformdataRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="multipart/form-data" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| MultipartformdataRequestBody(MultipartformdataSchema.[MultipartformdataSchema1Boxed](../../../paths/fakeinlinecomposition/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "multipart/form-data" | -| MultipartformdataSchema.[MultipartformdataSchema1Boxed](../../../paths/fakeinlinecomposition/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/Responses.md b/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/Responses.md deleted file mode 100644 index 22c31a7494d..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/fakeinlinecomposition/post/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/responses/Code200Response.md deleted file mode 100644 index b3b6180ef97..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/responses/Code200Response.md +++ /dev/null @@ -1,123 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| record | [Code200Response.MultipartformdataMediaType](#multipartformdatamediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| record | [Code200Response.MultipartformdataResponseBody](#multipartformdataresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype), -[MultipartformdataMediaType](#multipartformdatamediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakeinlinecomposition/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakeinlinecomposition/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## MultipartformdataMediaType -public record MultipartformdataMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[MultipartformdataSchema.MultipartformdataSchema1](../../../../paths/fakeinlinecomposition/post/responses/code200response/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| MultipartformdataMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [MultipartformdataSchema.MultipartformdataSchema1](../../../../paths/fakeinlinecomposition/post/responses/code200response/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody), -[MultipartformdataResponseBody](#multipartformdataresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.[ApplicationjsonSchema1Boxed](../../../../paths/fakeinlinecomposition/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.[ApplicationjsonSchema1Boxed](../../../../paths/fakeinlinecomposition/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1boxed) | body()
returns the body passed in in the constructor | -## MultipartformdataResponseBody -public record MultipartformdataResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="multipart/form-data" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| MultipartformdataResponseBody(MultipartformdataSchema.[MultipartformdataSchema1Boxed](../../../../paths/fakeinlinecomposition/post/responses/code200response/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| MultipartformdataSchema.[MultipartformdataSchema1Boxed](../../../../paths/fakeinlinecomposition/post/responses/code200response/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1boxed) | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)()),
    new AbstractMap.SimpleEntry<>("multipart/form-data", new [MultipartformdataMediaType](#multipartformdatamediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/responses/FakeinlinecompositionPostCode200Response.md b/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/responses/FakeinlinecompositionPostCode200Response.md new file mode 100644 index 00000000000..786ddf56087 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeinlinecomposition/post/responses/FakeinlinecompositionPostCode200Response.md @@ -0,0 +1,123 @@ +# FakeinlinecompositionPostCode200Response + +public class FakeinlinecompositionPostCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakeinlinecompositionPostCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakeinlinecompositionPostCode200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| record | [FakeinlinecompositionPostCode200Response.MultipartformdataMediaType](#multipartformdatamediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakeinlinecompositionPostCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakeinlinecompositionPostCode200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| record | [FakeinlinecompositionPostCode200Response.MultipartformdataResponseBody](#multipartformdataresponsebody)
implements sealed interface to store response body | +| static class | [FakeinlinecompositionPostCode200Response.FakeinlinecompositionPostCode200Response1](#fakeinlinecompositionpostcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype), +[MultipartformdataMediaType](#multipartformdatamediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakeinlinecomposition/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakeinlinecomposition/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## MultipartformdataMediaType +public record MultipartformdataMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[MultipartformdataSchema.MultipartformdataSchema1](../../../../paths/fakeinlinecomposition/post/responses/code200response/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| MultipartformdataMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [MultipartformdataSchema.MultipartformdataSchema1](../../../../paths/fakeinlinecomposition/post/responses/code200response/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody), +[MultipartformdataResponseBody](#multipartformdataresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.[ApplicationjsonSchema1Boxed](../../../../paths/fakeinlinecomposition/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.[ApplicationjsonSchema1Boxed](../../../../paths/fakeinlinecomposition/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1boxed) | body()
returns the body passed in in the constructor | +## MultipartformdataResponseBody +public record MultipartformdataResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="multipart/form-data" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| MultipartformdataResponseBody(MultipartformdataSchema.[MultipartformdataSchema1Boxed](../../../../paths/fakeinlinecomposition/post/responses/code200response/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| MultipartformdataSchema.[MultipartformdataSchema1Boxed](../../../../paths/fakeinlinecomposition/post/responses/code200response/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1boxed) | body()
returns the body passed in in the constructor | + +## FakeinlinecompositionPostCode200Response1 +public static class FakeinlinecompositionPostCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeinlinecompositionPostCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)()),
    new AbstractMap.SimpleEntry<>("multipart/form-data", new [MultipartformdataMediaType](#multipartformdatamediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakejsonformdata/FakejsonformdataGet.md b/samples/client/petstore/java/docs/paths/fakejsonformdata/FakejsonformdataGet.md new file mode 100644 index 00000000000..671a070557f --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakejsonformdata/FakejsonformdataGet.md @@ -0,0 +1,143 @@ +# FakejsonformdataGet + +public class FakejsonformdataGet + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Get](#get)
The class that has a get method to call the endpoint | +| interface | [JsonFormDataOperation](#jsonformdataoperation)
The interface that has a jsonFormData method to call the endpoint | +| static class | [GetRequest](#getrequest)
The request inputs class | +| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | + +## Get +public static class Get extends ApiClient.ApiClient1 implements GetOperation
+ +a class that allows one to call the endpoint using a method named get + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakejsonformdata.get.FakejsonformdataGetRequestBody; +import org.openapijsonschematools.client.paths.fakejsonformdata.get.requestbody.content.applicationxwwwformurlencoded.ApplicationxwwwformurlencodedSchema; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakejsonformdata.get.responses.FakejsonformdataGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakejsonformdata.FakejsonformdataGet; +import org.openapijsonschematools.client.paths.fakejsonformdata.get.FakejsonformdataGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakejsonformdataGet.Get apiClient = new FakejsonformdataGet.Get(apiConfiguration, schemaConfiguration); + + +var request = new FakejsonformdataGet.GetRequestBuilder().build(); + +FakejsonformdataGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakejsonformdataGetResponses.EndpointFakejsonformdataGetCode200Response castResponse = (FakejsonformdataGetResponses.EndpointFakejsonformdataGetCode200Response) response; +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakejsonformdataGetResponses.EndpointResponse](../../paths/fakejsonformdata/get/FakejsonformdataGetResponses.md#endpointresponse) | get([GetRequest](#getrequest) request) | + +## JsonFormDataOperation +public interface JsonFormDataOperation
+ +an interface that allows one to call the endpoint using a method named jsonFormData by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakejsonformdataGetResponses.EndpointResponse](../../paths/fakejsonformdata/get/FakejsonformdataGetResponses.md#endpointresponse) | jsonFormData([GetRequest](#getrequest) request) | + +## GetRequest +public static class GetRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakejsonformdataGetRequestBody.@Nullable SealedRequestBody](../../paths/fakejsonformdata/get/FakejsonformdataGetRequestBody.md#sealedrequestbody) | requestBody
optional | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## GetRequestBuilder +public static class GetRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| GetRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | +| [GetRequestBuilder](#getrequestbuilder) | requestBody([FakejsonformdataGetRequestBody.SealedRequestBody](../../paths/fakejsonformdata/get/FakejsonformdataGetRequestBody.md#sealedrequestbody) requestBody)
sets the optional property | +| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakejsonformdata/Get.md b/samples/client/petstore/java/docs/paths/fakejsonformdata/Get.md deleted file mode 100644 index 4baac6db8d2..00000000000 --- a/samples/client/petstore/java/docs/paths/fakejsonformdata/Get.md +++ /dev/null @@ -1,132 +0,0 @@ -# Get - -public class Get - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Get1](#get1)
The class that has a get method to call the endpoint | -| static class | [GetRequest](#getrequest)
The request inputs class | -| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | - -## Get1 -public static class Get1 extends ApiClient.ApiClient1 implements GetOperation
- -a class that allows one to call the endpoint using a method named get - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakejsonformdata.get.RequestBody; -import org.openapijsonschematools.client.paths.fakejsonformdata.get.requestbody.content.applicationxwwwformurlencoded.ApplicationxwwwformurlencodedSchema; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakejsonformdata.get.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakejsonformdata.Get; -import org.openapijsonschematools.client.paths.fakejsonformdata.get.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Get.Get1 apiClient = new Get.Get1(apiConfiguration, schemaConfiguration); - - -var request = new GetRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.get(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakejsonformdata/get/Responses.md#endpointresponse) | get([GetRequest](#getrequest) request) | - -## GetRequest -public static class GetRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fakejsonformdata/get/RequestBody.md#sealedrequestbody) | requestBody
optional | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## GetRequestBuilder -public static class GetRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| GetRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | -| [GetRequestBuilder](#getrequestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/fakejsonformdata/get/RequestBody.md#sealedrequestbody) requestBody)
sets the optional property | -| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakejsonformdata/get/FakejsonformdataGetRequestBody.md b/samples/client/petstore/java/docs/paths/fakejsonformdata/get/FakejsonformdataGetRequestBody.md new file mode 100644 index 00000000000..da678f85003 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakejsonformdata/get/FakejsonformdataGetRequestBody.md @@ -0,0 +1,90 @@ +# FakejsonformdataGetRequestBody + +public class FakejsonformdataGetRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakejsonformdataGetRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakejsonformdataGetRequestBody.ApplicationxwwwformurlencodedMediaType](#applicationxwwwformurlencodedmediatype)
record storing schema + encoding for a specific contentType | +| static class | [FakejsonformdataGetRequestBody.FakejsonformdataGetRequestBody1](#fakejsonformdatagetrequestbody1)
class that serializes request bodies | +| sealed interface | [FakejsonformdataGetRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [FakejsonformdataGetRequestBody.ApplicationxwwwformurlencodedRequestBody](#applicationxwwwformurlencodedrequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationxwwwformurlencodedMediaType](#applicationxwwwformurlencodedmediatype) + +sealed interface that stores schema and encoding info + + +## ApplicationxwwwformurlencodedMediaType +public record ApplicationxwwwformurlencodedMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1](../../../paths/fakejsonformdata/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationxwwwformurlencodedMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1](../../../paths/fakejsonformdata/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## FakejsonformdataGetRequestBody1 +public static class FakejsonformdataGetRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakejsonformdataGetRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = false
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/x-www-form-urlencoded", new [ApplicationxwwwformurlencodedMediaType](#applicationxwwwformurlencodedmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[ApplicationxwwwformurlencodedRequestBody](#applicationxwwwformurlencodedrequestbody) + +sealed interface that stores request contentType + validated schema data + +## ApplicationxwwwformurlencodedRequestBody +public record ApplicationxwwwformurlencodedRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="application/x-www-form-urlencoded" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationxwwwformurlencodedRequestBody(ApplicationxwwwformurlencodedSchema.[ApplicationxwwwformurlencodedSchema1Boxed](../../../paths/fakejsonformdata/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "application/x-www-form-urlencoded" | +| ApplicationxwwwformurlencodedSchema.[ApplicationxwwwformurlencodedSchema1Boxed](../../../paths/fakejsonformdata/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakejsonformdata/get/FakejsonformdataGetResponses.md b/samples/client/petstore/java/docs/paths/fakejsonformdata/get/FakejsonformdataGetResponses.md new file mode 100644 index 00000000000..89354bae3a3 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakejsonformdata/get/FakejsonformdataGetResponses.md @@ -0,0 +1,29 @@ +# FakejsonformdataGetResponses + +public class FakejsonformdataGetResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakejsonformdataGetCode200Response](#endpointfakejsonformdatagetcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakejsonformdataGetCode200Response](#endpointfakejsonformdatagetcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakejsonformdataGetCode200Response +public record EndpointFakejsonformdataGetCode200Response( + HttpResponse response, + Void body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakejsonformdata/get/RequestBody.md b/samples/client/petstore/java/docs/paths/fakejsonformdata/get/RequestBody.md deleted file mode 100644 index e90d97b831b..00000000000 --- a/samples/client/petstore/java/docs/paths/fakejsonformdata/get/RequestBody.md +++ /dev/null @@ -1,90 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.ApplicationxwwwformurlencodedMediaType](#applicationxwwwformurlencodedmediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.ApplicationxwwwformurlencodedRequestBody](#applicationxwwwformurlencodedrequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationxwwwformurlencodedMediaType](#applicationxwwwformurlencodedmediatype) - -sealed interface that stores schema and encoding info - - -## ApplicationxwwwformurlencodedMediaType -public record ApplicationxwwwformurlencodedMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1](../../../paths/fakejsonformdata/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationxwwwformurlencodedMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1](../../../paths/fakejsonformdata/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = false
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/x-www-form-urlencoded", new [ApplicationxwwwformurlencodedMediaType](#applicationxwwwformurlencodedmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[ApplicationxwwwformurlencodedRequestBody](#applicationxwwwformurlencodedrequestbody) - -sealed interface that stores request contentType + validated schema data - -## ApplicationxwwwformurlencodedRequestBody -public record ApplicationxwwwformurlencodedRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="application/x-www-form-urlencoded" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationxwwwformurlencodedRequestBody(ApplicationxwwwformurlencodedSchema.[ApplicationxwwwformurlencodedSchema1Boxed](../../../paths/fakejsonformdata/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "application/x-www-form-urlencoded" | -| ApplicationxwwwformurlencodedSchema.[ApplicationxwwwformurlencodedSchema1Boxed](../../../paths/fakejsonformdata/get/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakejsonformdata/get/Responses.md b/samples/client/petstore/java/docs/paths/fakejsonformdata/get/Responses.md deleted file mode 100644 index d4bf4fdb8f5..00000000000 --- a/samples/client/petstore/java/docs/paths/fakejsonformdata/get/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakejsonformdata/get/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakejsonformdata/get/responses/Code200Response.md deleted file mode 100644 index e89c75b2e12..00000000000 --- a/samples/client/petstore/java/docs/paths/fakejsonformdata/get/responses/Code200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# Code200Response - -public class Code200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) - -A class (extended from the $ref class) that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## Code200Response1 -public static class Code200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
- -a class that deserializes responses, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/fakejsonformdata/get/responses/FakejsonformdataGetCode200Response.md b/samples/client/petstore/java/docs/paths/fakejsonformdata/get/responses/FakejsonformdataGetCode200Response.md new file mode 100644 index 00000000000..c7ae900e122 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakejsonformdata/get/responses/FakejsonformdataGetCode200Response.md @@ -0,0 +1,17 @@ +# FakejsonformdataGetCode200Response + +public class FakejsonformdataGetCode200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) + +A class (extended from the $ref class) that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [FakejsonformdataGetCode200Response.FakejsonformdataGetCode200Response1](#fakejsonformdatagetcode200response1)
class that deserializes responses | + +## FakejsonformdataGetCode200Response1 +public static class FakejsonformdataGetCode200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
+ +a class that deserializes responses, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/fakejsonpatch/FakejsonpatchPatch.md b/samples/client/petstore/java/docs/paths/fakejsonpatch/FakejsonpatchPatch.md new file mode 100644 index 00000000000..5ec7d39f004 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakejsonpatch/FakejsonpatchPatch.md @@ -0,0 +1,143 @@ +# FakejsonpatchPatch + +public class FakejsonpatchPatch + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Patch](#patch)
The class that has a patch method to call the endpoint | +| interface | [JsonPatchOperation](#jsonpatchoperation)
The interface that has a jsonPatch method to call the endpoint | +| static class | [PatchRequest](#patchrequest)
The request inputs class | +| static class | [PatchRequestBuilder](#patchrequestbuilder)
A builder for the request input class | + +## Patch +public static class Patch extends ApiClient.ApiClient1 implements PatchOperation
+ +a class that allows one to call the endpoint using a method named patch + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakejsonpatch.patch.FakejsonpatchPatchRequestBody; +import org.openapijsonschematools.client.components.schemas.JSONPatchRequest; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakejsonpatch.patch.responses.FakejsonpatchPatchCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakejsonpatch.FakejsonpatchPatch; +import org.openapijsonschematools.client.paths.fakejsonpatch.patch.FakejsonpatchPatchResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakejsonpatchPatch.Patch apiClient = new FakejsonpatchPatch.Patch(apiConfiguration, schemaConfiguration); + + +var request = new FakejsonpatchPatch.PatchRequestBuilder().build(); + +FakejsonpatchPatchResponses.EndpointResponse response; +try { + response = apiClient.patch(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakejsonpatchPatchResponses.EndpointFakejsonpatchPatchCode200Response castResponse = (FakejsonpatchPatchResponses.EndpointFakejsonpatchPatchCode200Response) response; +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Patch(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakejsonpatchPatchResponses.EndpointResponse](../../paths/fakejsonpatch/patch/FakejsonpatchPatchResponses.md#endpointresponse) | patch([PatchRequest](#patchrequest) request) | + +## JsonPatchOperation +public interface JsonPatchOperation
+ +an interface that allows one to call the endpoint using a method named jsonPatch by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakejsonpatchPatchResponses.EndpointResponse](../../paths/fakejsonpatch/patch/FakejsonpatchPatchResponses.md#endpointresponse) | jsonPatch([PatchRequest](#patchrequest) request) | + +## PatchRequest +public static class PatchRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakejsonpatchPatchRequestBody.@Nullable SealedRequestBody](../../paths/fakejsonpatch/patch/FakejsonpatchPatchRequestBody.md#sealedrequestbody) | requestBody
optional | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PatchRequestBuilder +public static class PatchRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PatchRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PatchRequest](#patchrequest) | build()
Returns the request input used to call an endpoint method | +| [PatchRequestBuilder](#patchrequestbuilder) | requestBody([FakejsonpatchPatchRequestBody.SealedRequestBody](../../paths/fakejsonpatch/patch/FakejsonpatchPatchRequestBody.md#sealedrequestbody) requestBody)
sets the optional property | +| [PatchRequestBuilder](#patchrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [PatchRequestBuilder](#patchrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakejsonpatch/Patch.md b/samples/client/petstore/java/docs/paths/fakejsonpatch/Patch.md deleted file mode 100644 index 71e68b2f798..00000000000 --- a/samples/client/petstore/java/docs/paths/fakejsonpatch/Patch.md +++ /dev/null @@ -1,132 +0,0 @@ -# Patch - -public class Patch - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Patch1](#patch1)
The class that has a patch method to call the endpoint | -| static class | [PatchRequest](#patchrequest)
The request inputs class | -| static class | [PatchRequestBuilder](#patchrequestbuilder)
A builder for the request input class | - -## Patch1 -public static class Patch1 extends ApiClient.ApiClient1 implements PatchOperation
- -a class that allows one to call the endpoint using a method named patch - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakejsonpatch.patch.RequestBody; -import org.openapijsonschematools.client.components.schemas.JSONPatchRequest; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakejsonpatch.patch.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakejsonpatch.Patch; -import org.openapijsonschematools.client.paths.fakejsonpatch.patch.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Patch.Patch1 apiClient = new Patch.Patch1(apiConfiguration, schemaConfiguration); - - -var request = new PatchRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.patch(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Patch1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakejsonpatch/patch/Responses.md#endpointresponse) | patch([PatchRequest](#patchrequest) request) | - -## PatchRequest -public static class PatchRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fakejsonpatch/patch/RequestBody.md#sealedrequestbody) | requestBody
optional | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PatchRequestBuilder -public static class PatchRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PatchRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PatchRequest](#patchrequest) | build()
Returns the request input used to call an endpoint method | -| [PatchRequestBuilder](#patchrequestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/fakejsonpatch/patch/RequestBody.md#sealedrequestbody) requestBody)
sets the optional property | -| [PatchRequestBuilder](#patchrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [PatchRequestBuilder](#patchrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakejsonpatch/patch/FakejsonpatchPatchRequestBody.md b/samples/client/petstore/java/docs/paths/fakejsonpatch/patch/FakejsonpatchPatchRequestBody.md new file mode 100644 index 00000000000..1b5ffa82e1b --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakejsonpatch/patch/FakejsonpatchPatchRequestBody.md @@ -0,0 +1,90 @@ +# FakejsonpatchPatchRequestBody + +public class FakejsonpatchPatchRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakejsonpatchPatchRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakejsonpatchPatchRequestBody.ApplicationjsonpatchjsonMediaType](#applicationjsonpatchjsonmediatype)
record storing schema + encoding for a specific contentType | +| static class | [FakejsonpatchPatchRequestBody.FakejsonpatchPatchRequestBody1](#fakejsonpatchpatchrequestbody1)
class that serializes request bodies | +| sealed interface | [FakejsonpatchPatchRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [FakejsonpatchPatchRequestBody.ApplicationjsonpatchjsonRequestBody](#applicationjsonpatchjsonrequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonpatchjsonMediaType](#applicationjsonpatchjsonmediatype) + +sealed interface that stores schema and encoding info + + +## ApplicationjsonpatchjsonMediaType +public record ApplicationjsonpatchjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonpatchjsonSchema.ApplicationjsonpatchjsonSchema1](../../../paths/fakejsonpatch/patch/requestbody/content/applicationjsonpatchjson/ApplicationjsonpatchjsonSchema.md#applicationjsonpatchjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonpatchjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonpatchjsonSchema.ApplicationjsonpatchjsonSchema1](../../../paths/fakejsonpatch/patch/requestbody/content/applicationjsonpatchjson/ApplicationjsonpatchjsonSchema.md#applicationjsonpatchjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## FakejsonpatchPatchRequestBody1 +public static class FakejsonpatchPatchRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakejsonpatchPatchRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = false
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json-patch+json", new [ApplicationjsonpatchjsonMediaType](#applicationjsonpatchjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[ApplicationjsonpatchjsonRequestBody](#applicationjsonpatchjsonrequestbody) + +sealed interface that stores request contentType + validated schema data + +## ApplicationjsonpatchjsonRequestBody +public record ApplicationjsonpatchjsonRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="application/json-patch+json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonpatchjsonRequestBody(ApplicationjsonpatchjsonSchema.[JSONPatchRequest1Boxed](../../../components/schemas/JSONPatchRequest.md#jsonpatchrequest1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "application/json-patch+json" | +| ApplicationjsonpatchjsonSchema.[JSONPatchRequest1Boxed](../../../components/schemas/JSONPatchRequest.md#jsonpatchrequest1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakejsonpatch/patch/FakejsonpatchPatchResponses.md b/samples/client/petstore/java/docs/paths/fakejsonpatch/patch/FakejsonpatchPatchResponses.md new file mode 100644 index 00000000000..c0ece525307 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakejsonpatch/patch/FakejsonpatchPatchResponses.md @@ -0,0 +1,29 @@ +# FakejsonpatchPatchResponses + +public class FakejsonpatchPatchResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakejsonpatchPatchCode200Response](#endpointfakejsonpatchpatchcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakejsonpatchPatchCode200Response](#endpointfakejsonpatchpatchcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakejsonpatchPatchCode200Response +public record EndpointFakejsonpatchPatchCode200Response( + HttpResponse response, + Void body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakejsonpatch/patch/RequestBody.md b/samples/client/petstore/java/docs/paths/fakejsonpatch/patch/RequestBody.md deleted file mode 100644 index 8f4044c6273..00000000000 --- a/samples/client/petstore/java/docs/paths/fakejsonpatch/patch/RequestBody.md +++ /dev/null @@ -1,90 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.ApplicationjsonpatchjsonMediaType](#applicationjsonpatchjsonmediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.ApplicationjsonpatchjsonRequestBody](#applicationjsonpatchjsonrequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonpatchjsonMediaType](#applicationjsonpatchjsonmediatype) - -sealed interface that stores schema and encoding info - - -## ApplicationjsonpatchjsonMediaType -public record ApplicationjsonpatchjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonpatchjsonSchema.ApplicationjsonpatchjsonSchema1](../../../paths/fakejsonpatch/patch/requestbody/content/applicationjsonpatchjson/ApplicationjsonpatchjsonSchema.md#applicationjsonpatchjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonpatchjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonpatchjsonSchema.ApplicationjsonpatchjsonSchema1](../../../paths/fakejsonpatch/patch/requestbody/content/applicationjsonpatchjson/ApplicationjsonpatchjsonSchema.md#applicationjsonpatchjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = false
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json-patch+json", new [ApplicationjsonpatchjsonMediaType](#applicationjsonpatchjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[ApplicationjsonpatchjsonRequestBody](#applicationjsonpatchjsonrequestbody) - -sealed interface that stores request contentType + validated schema data - -## ApplicationjsonpatchjsonRequestBody -public record ApplicationjsonpatchjsonRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="application/json-patch+json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonpatchjsonRequestBody(ApplicationjsonpatchjsonSchema.[JSONPatchRequest1Boxed](../../../components/schemas/JSONPatchRequest.md#jsonpatchrequest1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "application/json-patch+json" | -| ApplicationjsonpatchjsonSchema.[JSONPatchRequest1Boxed](../../../components/schemas/JSONPatchRequest.md#jsonpatchrequest1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakejsonpatch/patch/Responses.md b/samples/client/petstore/java/docs/paths/fakejsonpatch/patch/Responses.md deleted file mode 100644 index d4bf4fdb8f5..00000000000 --- a/samples/client/petstore/java/docs/paths/fakejsonpatch/patch/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakejsonpatch/patch/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakejsonpatch/patch/responses/Code200Response.md deleted file mode 100644 index e89c75b2e12..00000000000 --- a/samples/client/petstore/java/docs/paths/fakejsonpatch/patch/responses/Code200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# Code200Response - -public class Code200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) - -A class (extended from the $ref class) that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## Code200Response1 -public static class Code200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
- -a class that deserializes responses, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/fakejsonpatch/patch/responses/FakejsonpatchPatchCode200Response.md b/samples/client/petstore/java/docs/paths/fakejsonpatch/patch/responses/FakejsonpatchPatchCode200Response.md new file mode 100644 index 00000000000..72f6aff6618 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakejsonpatch/patch/responses/FakejsonpatchPatchCode200Response.md @@ -0,0 +1,17 @@ +# FakejsonpatchPatchCode200Response + +public class FakejsonpatchPatchCode200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) + +A class (extended from the $ref class) that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [FakejsonpatchPatchCode200Response.FakejsonpatchPatchCode200Response1](#fakejsonpatchpatchcode200response1)
class that deserializes responses | + +## FakejsonpatchPatchCode200Response1 +public static class FakejsonpatchPatchCode200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
+ +a class that deserializes responses, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/fakejsonwithcharset/FakejsonwithcharsetPost.md b/samples/client/petstore/java/docs/paths/fakejsonwithcharset/FakejsonwithcharsetPost.md new file mode 100644 index 00000000000..c59c04d6fb4 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakejsonwithcharset/FakejsonwithcharsetPost.md @@ -0,0 +1,145 @@ +# FakejsonwithcharsetPost + +public class FakejsonwithcharsetPost + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Post](#post)
The class that has a post method to call the endpoint | +| interface | [JsonWithCharsetOperation](#jsonwithcharsetoperation)
The interface that has a jsonWithCharset method to call the endpoint | +| static class | [PostRequest](#postrequest)
The request inputs class | +| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | + +## Post +public static class Post extends ApiClient.ApiClient1 implements PostOperation
+ +a class that allows one to call the endpoint using a method named post + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakejsonwithcharset.post.FakejsonwithcharsetPostRequestBody; +import org.openapijsonschematools.client.paths.fakejsonwithcharset.post.requestbody.content.applicationjsoncharsetutf8.Applicationjsoncharsetutf8Schema; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakejsonwithcharset.post.responses.FakejsonwithcharsetPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakejsonwithcharset.FakejsonwithcharsetPost; +import org.openapijsonschematools.client.paths.fakejsonwithcharset.post.FakejsonwithcharsetPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakejsonwithcharsetPost.Post apiClient = new FakejsonwithcharsetPost.Post(apiConfiguration, schemaConfiguration); + + +var request = new FakejsonwithcharsetPost.PostRequestBuilder().build(); + +FakejsonwithcharsetPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakejsonwithcharsetPostResponses.EndpointFakejsonwithcharsetPostCode200Response castResponse = (FakejsonwithcharsetPostResponses.EndpointFakejsonwithcharsetPostCode200Response) response; +FakejsonwithcharsetPostCode200Response.Applicationjsoncharsetutf8ResponseBody deserializedBody = (FakejsonwithcharsetPostCode200Response.Applicationjsoncharsetutf8ResponseBody) castResponse.body; +// handle deserialized body here +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakejsonwithcharsetPostResponses.EndpointResponse](../../paths/fakejsonwithcharset/post/FakejsonwithcharsetPostResponses.md#endpointresponse) | post([PostRequest](#postrequest) request) | + +## JsonWithCharsetOperation +public interface JsonWithCharsetOperation
+ +an interface that allows one to call the endpoint using a method named jsonWithCharset by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakejsonwithcharsetPostResponses.EndpointResponse](../../paths/fakejsonwithcharset/post/FakejsonwithcharsetPostResponses.md#endpointresponse) | jsonWithCharset([PostRequest](#postrequest) request) | + +## PostRequest +public static class PostRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakejsonwithcharsetPostRequestBody.@Nullable SealedRequestBody](../../paths/fakejsonwithcharset/post/FakejsonwithcharsetPostRequestBody.md#sealedrequestbody) | requestBody
optional | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PostRequestBuilder +public static class PostRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PostRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | +| [PostRequestBuilder](#postrequestbuilder) | requestBody([FakejsonwithcharsetPostRequestBody.SealedRequestBody](../../paths/fakejsonwithcharset/post/FakejsonwithcharsetPostRequestBody.md#sealedrequestbody) requestBody)
sets the optional property | +| [PostRequestBuilder](#postrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [PostRequestBuilder](#postrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakejsonwithcharset/Post.md b/samples/client/petstore/java/docs/paths/fakejsonwithcharset/Post.md deleted file mode 100644 index 53835ba8607..00000000000 --- a/samples/client/petstore/java/docs/paths/fakejsonwithcharset/Post.md +++ /dev/null @@ -1,134 +0,0 @@ -# Post - -public class Post - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Post1](#post1)
The class that has a post method to call the endpoint | -| static class | [PostRequest](#postrequest)
The request inputs class | -| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | - -## Post1 -public static class Post1 extends ApiClient.ApiClient1 implements PostOperation
- -a class that allows one to call the endpoint using a method named post - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakejsonwithcharset.post.RequestBody; -import org.openapijsonschematools.client.paths.fakejsonwithcharset.post.requestbody.content.applicationjsoncharsetutf8.Applicationjsoncharsetutf8Schema; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakejsonwithcharset.post.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakejsonwithcharset.Post; -import org.openapijsonschematools.client.paths.fakejsonwithcharset.post.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Post.Post1 apiClient = new Post.Post1(apiConfiguration, schemaConfiguration); - - -var request = new PostRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.post(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -Code200Response.Applicationjsoncharsetutf8ResponseBody deserializedBody = (Code200Response.Applicationjsoncharsetutf8ResponseBody) castResponse.body; -// handle deserialized body here -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakejsonwithcharset/post/Responses.md#endpointresponse) | post([PostRequest](#postrequest) request) | - -## PostRequest -public static class PostRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fakejsonwithcharset/post/RequestBody.md#sealedrequestbody) | requestBody
optional | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PostRequestBuilder -public static class PostRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PostRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | -| [PostRequestBuilder](#postrequestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/fakejsonwithcharset/post/RequestBody.md#sealedrequestbody) requestBody)
sets the optional property | -| [PostRequestBuilder](#postrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [PostRequestBuilder](#postrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakejsonwithcharset/post/FakejsonwithcharsetPostRequestBody.md b/samples/client/petstore/java/docs/paths/fakejsonwithcharset/post/FakejsonwithcharsetPostRequestBody.md new file mode 100644 index 00000000000..5e338880026 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakejsonwithcharset/post/FakejsonwithcharsetPostRequestBody.md @@ -0,0 +1,90 @@ +# FakejsonwithcharsetPostRequestBody + +public class FakejsonwithcharsetPostRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakejsonwithcharsetPostRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakejsonwithcharsetPostRequestBody.Applicationjsoncharsetutf8MediaType](#applicationjsoncharsetutf8mediatype)
record storing schema + encoding for a specific contentType | +| static class | [FakejsonwithcharsetPostRequestBody.FakejsonwithcharsetPostRequestBody1](#fakejsonwithcharsetpostrequestbody1)
class that serializes request bodies | +| sealed interface | [FakejsonwithcharsetPostRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [FakejsonwithcharsetPostRequestBody.Applicationjsoncharsetutf8RequestBody](#applicationjsoncharsetutf8requestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[Applicationjsoncharsetutf8MediaType](#applicationjsoncharsetutf8mediatype) + +sealed interface that stores schema and encoding info + + +## Applicationjsoncharsetutf8MediaType +public record Applicationjsoncharsetutf8MediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1](../../../paths/fakejsonwithcharset/post/requestbody/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.md#applicationjsoncharsetutf8schema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Applicationjsoncharsetutf8MediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1](../../../paths/fakejsonwithcharset/post/requestbody/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.md#applicationjsoncharsetutf8schema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## FakejsonwithcharsetPostRequestBody1 +public static class FakejsonwithcharsetPostRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakejsonwithcharsetPostRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = false
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json; charset=utf-8", new [Applicationjsoncharsetutf8MediaType](#applicationjsoncharsetutf8mediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[Applicationjsoncharsetutf8RequestBody](#applicationjsoncharsetutf8requestbody) + +sealed interface that stores request contentType + validated schema data + +## Applicationjsoncharsetutf8RequestBody +public record Applicationjsoncharsetutf8RequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="application/json; charset=utf-8" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Applicationjsoncharsetutf8RequestBody(Applicationjsoncharsetutf8Schema.AnyTypeJsonSchema1Boxed body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "application/json; charset=utf-8" | +| Applicationjsoncharsetutf8Schema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakejsonwithcharset/post/FakejsonwithcharsetPostResponses.md b/samples/client/petstore/java/docs/paths/fakejsonwithcharset/post/FakejsonwithcharsetPostResponses.md new file mode 100644 index 00000000000..f47d58cd759 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakejsonwithcharset/post/FakejsonwithcharsetPostResponses.md @@ -0,0 +1,29 @@ +# FakejsonwithcharsetPostResponses + +public class FakejsonwithcharsetPostResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakejsonwithcharsetPostCode200Response](#endpointfakejsonwithcharsetpostcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakejsonwithcharsetPostCode200Response](#endpointfakejsonwithcharsetpostcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakejsonwithcharsetPostCode200Response +public record EndpointFakejsonwithcharsetPostCode200Response( + HttpResponse response, + [FakejsonwithcharsetPostCode200Response.SealedResponseBody](../../../paths/fakejsonwithcharset/post/responses/FakejsonwithcharsetPostCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakejsonwithcharset/post/RequestBody.md b/samples/client/petstore/java/docs/paths/fakejsonwithcharset/post/RequestBody.md deleted file mode 100644 index 8e7015ce024..00000000000 --- a/samples/client/petstore/java/docs/paths/fakejsonwithcharset/post/RequestBody.md +++ /dev/null @@ -1,90 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.Applicationjsoncharsetutf8MediaType](#applicationjsoncharsetutf8mediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.Applicationjsoncharsetutf8RequestBody](#applicationjsoncharsetutf8requestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[Applicationjsoncharsetutf8MediaType](#applicationjsoncharsetutf8mediatype) - -sealed interface that stores schema and encoding info - - -## Applicationjsoncharsetutf8MediaType -public record Applicationjsoncharsetutf8MediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1](../../../paths/fakejsonwithcharset/post/requestbody/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.md#applicationjsoncharsetutf8schema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Applicationjsoncharsetutf8MediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1](../../../paths/fakejsonwithcharset/post/requestbody/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.md#applicationjsoncharsetutf8schema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = false
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json; charset=utf-8", new [Applicationjsoncharsetutf8MediaType](#applicationjsoncharsetutf8mediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[Applicationjsoncharsetutf8RequestBody](#applicationjsoncharsetutf8requestbody) - -sealed interface that stores request contentType + validated schema data - -## Applicationjsoncharsetutf8RequestBody -public record Applicationjsoncharsetutf8RequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="application/json; charset=utf-8" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Applicationjsoncharsetutf8RequestBody(Applicationjsoncharsetutf8Schema.AnyTypeJsonSchema1Boxed body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "application/json; charset=utf-8" | -| Applicationjsoncharsetutf8Schema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakejsonwithcharset/post/Responses.md b/samples/client/petstore/java/docs/paths/fakejsonwithcharset/post/Responses.md deleted file mode 100644 index dd3c0337bab..00000000000 --- a/samples/client/petstore/java/docs/paths/fakejsonwithcharset/post/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/fakejsonwithcharset/post/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakejsonwithcharset/post/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakejsonwithcharset/post/responses/Code200Response.md deleted file mode 100644 index 72a307bd8ee..00000000000 --- a/samples/client/petstore/java/docs/paths/fakejsonwithcharset/post/responses/Code200Response.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.Applicationjsoncharsetutf8MediaType](#applicationjsoncharsetutf8mediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.Applicationjsoncharsetutf8ResponseBody](#applicationjsoncharsetutf8responsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[Applicationjsoncharsetutf8MediaType](#applicationjsoncharsetutf8mediatype) - -sealed interface that stores schema and encoding info - -## Applicationjsoncharsetutf8MediaType -public record Applicationjsoncharsetutf8MediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1](../../../../paths/fakejsonwithcharset/post/responses/code200response/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.md#applicationjsoncharsetutf8schema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Applicationjsoncharsetutf8MediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1](../../../../paths/fakejsonwithcharset/post/responses/code200response/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.md#applicationjsoncharsetutf8schema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[Applicationjsoncharsetutf8ResponseBody](#applicationjsoncharsetutf8responsebody) - -sealed interface that stores response body - -## Applicationjsoncharsetutf8ResponseBody -public record Applicationjsoncharsetutf8ResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json; charset=utf-8" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Applicationjsoncharsetutf8ResponseBody(Applicationjsoncharsetutf8Schema.AnyTypeJsonSchema1Boxed body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Applicationjsoncharsetutf8Schema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json; charset=utf-8", new [Applicationjsoncharsetutf8MediaType](#applicationjsoncharsetutf8mediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakejsonwithcharset/post/responses/FakejsonwithcharsetPostCode200Response.md b/samples/client/petstore/java/docs/paths/fakejsonwithcharset/post/responses/FakejsonwithcharsetPostCode200Response.md new file mode 100644 index 00000000000..fe4f16ce9f8 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakejsonwithcharset/post/responses/FakejsonwithcharsetPostCode200Response.md @@ -0,0 +1,87 @@ +# FakejsonwithcharsetPostCode200Response + +public class FakejsonwithcharsetPostCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakejsonwithcharsetPostCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakejsonwithcharsetPostCode200Response.Applicationjsoncharsetutf8MediaType](#applicationjsoncharsetutf8mediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakejsonwithcharsetPostCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakejsonwithcharsetPostCode200Response.Applicationjsoncharsetutf8ResponseBody](#applicationjsoncharsetutf8responsebody)
implements sealed interface to store response body | +| static class | [FakejsonwithcharsetPostCode200Response.FakejsonwithcharsetPostCode200Response1](#fakejsonwithcharsetpostcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[Applicationjsoncharsetutf8MediaType](#applicationjsoncharsetutf8mediatype) + +sealed interface that stores schema and encoding info + +## Applicationjsoncharsetutf8MediaType +public record Applicationjsoncharsetutf8MediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1](../../../../paths/fakejsonwithcharset/post/responses/code200response/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.md#applicationjsoncharsetutf8schema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Applicationjsoncharsetutf8MediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1](../../../../paths/fakejsonwithcharset/post/responses/code200response/content/applicationjsoncharsetutf8/Applicationjsoncharsetutf8Schema.md#applicationjsoncharsetutf8schema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[Applicationjsoncharsetutf8ResponseBody](#applicationjsoncharsetutf8responsebody) + +sealed interface that stores response body + +## Applicationjsoncharsetutf8ResponseBody +public record Applicationjsoncharsetutf8ResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json; charset=utf-8" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Applicationjsoncharsetutf8ResponseBody(Applicationjsoncharsetutf8Schema.AnyTypeJsonSchema1Boxed body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Applicationjsoncharsetutf8Schema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | + +## FakejsonwithcharsetPostCode200Response1 +public static class FakejsonwithcharsetPostCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakejsonwithcharsetPostCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json; charset=utf-8", new [Applicationjsoncharsetutf8MediaType](#applicationjsoncharsetutf8mediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/FakemultiplerequestbodycontenttypesPost.md b/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/FakemultiplerequestbodycontenttypesPost.md new file mode 100644 index 00000000000..cca820c2a0f --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/FakemultiplerequestbodycontenttypesPost.md @@ -0,0 +1,145 @@ +# FakemultiplerequestbodycontenttypesPost + +public class FakemultiplerequestbodycontenttypesPost + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Post](#post)
The class that has a post method to call the endpoint | +| interface | [MultipleRequestBodyContentTypesOperation](#multiplerequestbodycontenttypesoperation)
The interface that has a multipleRequestBodyContentTypes method to call the endpoint | +| static class | [PostRequest](#postrequest)
The request inputs class | +| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | + +## Post +public static class Post extends ApiClient.ApiClient1 implements PostOperation
+ +a class that allows one to call the endpoint using a method named post + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.FakemultiplerequestbodycontenttypesPostRequestBody; +import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.requestbody.content.applicationjson.ApplicationjsonSchema; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.responses.FakemultiplerequestbodycontenttypesPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.FakemultiplerequestbodycontenttypesPost; +import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.FakemultiplerequestbodycontenttypesPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakemultiplerequestbodycontenttypesPost.Post apiClient = new FakemultiplerequestbodycontenttypesPost.Post(apiConfiguration, schemaConfiguration); + + +var request = new FakemultiplerequestbodycontenttypesPost.PostRequestBuilder().build(); + +FakemultiplerequestbodycontenttypesPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakemultiplerequestbodycontenttypesPostResponses.EndpointFakemultiplerequestbodycontenttypesPostCode200Response castResponse = (FakemultiplerequestbodycontenttypesPostResponses.EndpointFakemultiplerequestbodycontenttypesPostCode200Response) response; +FakemultiplerequestbodycontenttypesPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakemultiplerequestbodycontenttypesPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakemultiplerequestbodycontenttypesPostResponses.EndpointResponse](../../paths/fakemultiplerequestbodycontenttypes/post/FakemultiplerequestbodycontenttypesPostResponses.md#endpointresponse) | post([PostRequest](#postrequest) request) | + +## MultipleRequestBodyContentTypesOperation +public interface MultipleRequestBodyContentTypesOperation
+ +an interface that allows one to call the endpoint using a method named multipleRequestBodyContentTypes by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakemultiplerequestbodycontenttypesPostResponses.EndpointResponse](../../paths/fakemultiplerequestbodycontenttypes/post/FakemultiplerequestbodycontenttypesPostResponses.md#endpointresponse) | multipleRequestBodyContentTypes([PostRequest](#postrequest) request) | + +## PostRequest +public static class PostRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakemultiplerequestbodycontenttypesPostRequestBody.@Nullable SealedRequestBody](../../paths/fakemultiplerequestbodycontenttypes/post/FakemultiplerequestbodycontenttypesPostRequestBody.md#sealedrequestbody) | requestBody
optional | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PostRequestBuilder +public static class PostRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PostRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | +| [PostRequestBuilder](#postrequestbuilder) | requestBody([FakemultiplerequestbodycontenttypesPostRequestBody.SealedRequestBody](../../paths/fakemultiplerequestbodycontenttypes/post/FakemultiplerequestbodycontenttypesPostRequestBody.md#sealedrequestbody) requestBody)
sets the optional property | +| [PostRequestBuilder](#postrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [PostRequestBuilder](#postrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/Post.md b/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/Post.md deleted file mode 100644 index 645f512d5e3..00000000000 --- a/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/Post.md +++ /dev/null @@ -1,134 +0,0 @@ -# Post - -public class Post - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Post1](#post1)
The class that has a post method to call the endpoint | -| static class | [PostRequest](#postrequest)
The request inputs class | -| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | - -## Post1 -public static class Post1 extends ApiClient.ApiClient1 implements PostOperation
- -a class that allows one to call the endpoint using a method named post - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.RequestBody; -import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.requestbody.content.applicationjson.ApplicationjsonSchema; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.Post; -import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Post.Post1 apiClient = new Post.Post1(apiConfiguration, schemaConfiguration); - - -var request = new PostRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.post(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -Code200Response.ApplicationjsonResponseBody deserializedBody = (Code200Response.ApplicationjsonResponseBody) castResponse.body; -// handle deserialized body here -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakemultiplerequestbodycontenttypes/post/Responses.md#endpointresponse) | post([PostRequest](#postrequest) request) | - -## PostRequest -public static class PostRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fakemultiplerequestbodycontenttypes/post/RequestBody.md#sealedrequestbody) | requestBody
optional | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PostRequestBuilder -public static class PostRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PostRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | -| [PostRequestBuilder](#postrequestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/fakemultiplerequestbodycontenttypes/post/RequestBody.md#sealedrequestbody) requestBody)
sets the optional property | -| [PostRequestBuilder](#postrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [PostRequestBuilder](#postrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/FakemultiplerequestbodycontenttypesPostRequestBody.md b/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/FakemultiplerequestbodycontenttypesPostRequestBody.md new file mode 100644 index 00000000000..8c3563ecad3 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/FakemultiplerequestbodycontenttypesPostRequestBody.md @@ -0,0 +1,128 @@ +# FakemultiplerequestbodycontenttypesPostRequestBody + +public class FakemultiplerequestbodycontenttypesPostRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakemultiplerequestbodycontenttypesPostRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakemultiplerequestbodycontenttypesPostRequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| record | [FakemultiplerequestbodycontenttypesPostRequestBody.MultipartformdataMediaType](#multipartformdatamediatype)
record storing schema + encoding for a specific contentType | +| static class | [FakemultiplerequestbodycontenttypesPostRequestBody.FakemultiplerequestbodycontenttypesPostRequestBody1](#fakemultiplerequestbodycontenttypespostrequestbody1)
class that serializes request bodies | +| sealed interface | [FakemultiplerequestbodycontenttypesPostRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [FakemultiplerequestbodycontenttypesPostRequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | +| record | [FakemultiplerequestbodycontenttypesPostRequestBody.MultipartformdataRequestBody](#multipartformdatarequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype), +[MultipartformdataMediaType](#multipartformdatamediatype) + +sealed interface that stores schema and encoding info + + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## MultipartformdataMediaType +public record MultipartformdataMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[MultipartformdataSchema.MultipartformdataSchema1](../../../paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| MultipartformdataMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [MultipartformdataSchema.MultipartformdataSchema1](../../../paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## FakemultiplerequestbodycontenttypesPostRequestBody1 +public static class FakemultiplerequestbodycontenttypesPostRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakemultiplerequestbodycontenttypesPostRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = false
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)()),
    new AbstractMap.SimpleEntry<>("multipart/form-data", new [MultipartformdataMediaType](#multipartformdatamediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[ApplicationjsonRequestBody](#applicationjsonrequestbody), +[MultipartformdataRequestBody](#multipartformdatarequestbody) + +sealed interface that stores request contentType + validated schema data + +## ApplicationjsonRequestBody +public record ApplicationjsonRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonRequestBody(ApplicationjsonSchema.[ApplicationjsonSchema1Boxed](../../../paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "application/json" | +| ApplicationjsonSchema.[ApplicationjsonSchema1Boxed](../../../paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1boxed) | body()
returns the body passed in in the constructor | +## MultipartformdataRequestBody +public record MultipartformdataRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="multipart/form-data" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| MultipartformdataRequestBody(MultipartformdataSchema.[MultipartformdataSchema1Boxed](../../../paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "multipart/form-data" | +| MultipartformdataSchema.[MultipartformdataSchema1Boxed](../../../paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/FakemultiplerequestbodycontenttypesPostResponses.md b/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/FakemultiplerequestbodycontenttypesPostResponses.md new file mode 100644 index 00000000000..cb74256a8d0 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/FakemultiplerequestbodycontenttypesPostResponses.md @@ -0,0 +1,29 @@ +# FakemultiplerequestbodycontenttypesPostResponses + +public class FakemultiplerequestbodycontenttypesPostResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakemultiplerequestbodycontenttypesPostCode200Response](#endpointfakemultiplerequestbodycontenttypespostcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakemultiplerequestbodycontenttypesPostCode200Response](#endpointfakemultiplerequestbodycontenttypespostcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakemultiplerequestbodycontenttypesPostCode200Response +public record EndpointFakemultiplerequestbodycontenttypesPostCode200Response( + HttpResponse response, + [FakemultiplerequestbodycontenttypesPostCode200Response.SealedResponseBody](../../../paths/fakemultiplerequestbodycontenttypes/post/responses/FakemultiplerequestbodycontenttypesPostCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/RequestBody.md b/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/RequestBody.md deleted file mode 100644 index 5258ce593d8..00000000000 --- a/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/RequestBody.md +++ /dev/null @@ -1,128 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| record | [RequestBody.MultipartformdataMediaType](#multipartformdatamediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | -| record | [RequestBody.MultipartformdataRequestBody](#multipartformdatarequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype), -[MultipartformdataMediaType](#multipartformdatamediatype) - -sealed interface that stores schema and encoding info - - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## MultipartformdataMediaType -public record MultipartformdataMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[MultipartformdataSchema.MultipartformdataSchema1](../../../paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| MultipartformdataMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [MultipartformdataSchema.MultipartformdataSchema1](../../../paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = false
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)()),
    new AbstractMap.SimpleEntry<>("multipart/form-data", new [MultipartformdataMediaType](#multipartformdatamediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[ApplicationjsonRequestBody](#applicationjsonrequestbody), -[MultipartformdataRequestBody](#multipartformdatarequestbody) - -sealed interface that stores request contentType + validated schema data - -## ApplicationjsonRequestBody -public record ApplicationjsonRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonRequestBody(ApplicationjsonSchema.[ApplicationjsonSchema1Boxed](../../../paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "application/json" | -| ApplicationjsonSchema.[ApplicationjsonSchema1Boxed](../../../paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1boxed) | body()
returns the body passed in in the constructor | -## MultipartformdataRequestBody -public record MultipartformdataRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="multipart/form-data" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| MultipartformdataRequestBody(MultipartformdataSchema.[MultipartformdataSchema1Boxed](../../../paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "multipart/form-data" | -| MultipartformdataSchema.[MultipartformdataSchema1Boxed](../../../paths/fakemultiplerequestbodycontenttypes/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/Responses.md b/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/Responses.md deleted file mode 100644 index 84545c913c6..00000000000 --- a/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/fakemultiplerequestbodycontenttypes/post/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/responses/Code200Response.md deleted file mode 100644 index b2018685e0e..00000000000 --- a/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/responses/Code200Response.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakemultiplerequestbodycontenttypes/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakemultiplerequestbodycontenttypes/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/responses/FakemultiplerequestbodycontenttypesPostCode200Response.md b/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/responses/FakemultiplerequestbodycontenttypesPostCode200Response.md new file mode 100644 index 00000000000..c6bb2c77dfd --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakemultiplerequestbodycontenttypes/post/responses/FakemultiplerequestbodycontenttypesPostCode200Response.md @@ -0,0 +1,87 @@ +# FakemultiplerequestbodycontenttypesPostCode200Response + +public class FakemultiplerequestbodycontenttypesPostCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakemultiplerequestbodycontenttypesPostCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakemultiplerequestbodycontenttypesPostCode200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakemultiplerequestbodycontenttypesPostCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakemultiplerequestbodycontenttypesPostCode200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [FakemultiplerequestbodycontenttypesPostCode200Response.FakemultiplerequestbodycontenttypesPostCode200Response1](#fakemultiplerequestbodycontenttypespostcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakemultiplerequestbodycontenttypes/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakemultiplerequestbodycontenttypes/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | + +## FakemultiplerequestbodycontenttypesPostCode200Response1 +public static class FakemultiplerequestbodycontenttypesPostCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakemultiplerequestbodycontenttypesPostCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/FakemultipleresponsebodiesGet.md b/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/FakemultipleresponsebodiesGet.md new file mode 100644 index 00000000000..03689e7b07c --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/FakemultipleresponsebodiesGet.md @@ -0,0 +1,147 @@ +# FakemultipleresponsebodiesGet + +public class FakemultipleresponsebodiesGet + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Get](#get)
The class that has a get method to call the endpoint | +| interface | [MultipleResponseBodiesOperation](#multipleresponsebodiesoperation)
The interface that has a multipleResponseBodies method to call the endpoint | +| static class | [GetRequest](#getrequest)
The request inputs class | +| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | + +## Get +public static class Get extends ApiClient.ApiClient1 implements GetOperation
+ +a class that allows one to call the endpoint using a method named get + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.responses.FakemultipleresponsebodiesGetCode200Response; +import org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.responses.FakemultipleresponsebodiesGetCode202Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakemultipleresponsebodies.FakemultipleresponsebodiesGet; +import org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.FakemultipleresponsebodiesGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakemultipleresponsebodiesGet.Get apiClient = new FakemultipleresponsebodiesGet.Get(apiConfiguration, schemaConfiguration); + + +var request = new FakemultipleresponsebodiesGet.GetRequestBuilder().build(); + +FakemultipleresponsebodiesGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +if (response instanceof FakemultipleresponsebodiesGetResponses.EndpointFakemultipleresponsebodiesGetCode200Response castResponse) { +FakemultipleresponsebodiesGetCode200Response.ApplicationjsonResponseBody deserializedBody = (FakemultipleresponsebodiesGetCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +} else { + FakemultipleresponsebodiesGetResponses.EndpointFakemultipleresponsebodiesGetCode202Response castResponse = (FakemultipleresponsebodiesGetResponses.EndpointFakemultipleresponsebodiesGetCode202Response) response; +FakemultipleresponsebodiesGetCode202Response.ApplicationjsonResponseBody deserializedBody = (FakemultipleresponsebodiesGetCode202Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +} +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakemultipleresponsebodiesGetResponses.EndpointResponse](../../paths/fakemultipleresponsebodies/get/FakemultipleresponsebodiesGetResponses.md#endpointresponse) | get([GetRequest](#getrequest) request) | + +## MultipleResponseBodiesOperation +public interface MultipleResponseBodiesOperation
+ +an interface that allows one to call the endpoint using a method named multipleResponseBodies by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakemultipleresponsebodiesGetResponses.EndpointResponse](../../paths/fakemultipleresponsebodies/get/FakemultipleresponsebodiesGetResponses.md#endpointresponse) | multipleResponseBodies([GetRequest](#getrequest) request) | + +## GetRequest +public static class GetRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## GetRequestBuilder +public static class GetRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| GetRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | +| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/Get.md b/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/Get.md deleted file mode 100644 index b0a9bc68466..00000000000 --- a/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/Get.md +++ /dev/null @@ -1,136 +0,0 @@ -# Get - -public class Get - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Get1](#get1)
The class that has a get method to call the endpoint | -| static class | [GetRequest](#getrequest)
The request inputs class | -| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | - -## Get1 -public static class Get1 extends ApiClient.ApiClient1 implements GetOperation
- -a class that allows one to call the endpoint using a method named get - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.responses.Code200Response; -import org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.responses.Code202Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakemultipleresponsebodies.Get; -import org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Get.Get1 apiClient = new Get.Get1(apiConfiguration, schemaConfiguration); - - -var request = new GetRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.get(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -if (response instanceof Responses.EndpointCode200Response castResponse) { -Code200Response.ApplicationjsonResponseBody deserializedBody = (Code200Response.ApplicationjsonResponseBody) castResponse.body; -// handle deserialized body here -} else { - Responses.EndpointCode202Response castResponse = (Responses.EndpointCode202Response) response; -Code202Response.ApplicationjsonResponseBody deserializedBody = (Code202Response.ApplicationjsonResponseBody) castResponse.body; -// handle deserialized body here -} -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakemultipleresponsebodies/get/Responses.md#endpointresponse) | get([GetRequest](#getrequest) request) | - -## GetRequest -public static class GetRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## GetRequestBuilder -public static class GetRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| GetRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | -| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/FakemultipleresponsebodiesGetResponses.md b/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/FakemultipleresponsebodiesGetResponses.md new file mode 100644 index 00000000000..526882905f0 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/FakemultipleresponsebodiesGetResponses.md @@ -0,0 +1,40 @@ +# FakemultipleresponsebodiesGetResponses + +public class FakemultipleresponsebodiesGetResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakemultipleresponsebodiesGetCode200Response](#endpointfakemultipleresponsebodiesgetcode200response)
the response for 200 | +| record | [EndpointFakemultipleresponsebodiesGetCode202Response](#endpointfakemultipleresponsebodiesgetcode202response)
the response for 202 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakemultipleresponsebodiesGetCode200Response](#endpointfakemultipleresponsebodiesgetcode200response), +[EndpointFakemultipleresponsebodiesGetCode202Response](#endpointfakemultipleresponsebodiesgetcode202response) + +a sealed interface that stores endpoint responses + +## EndpointFakemultipleresponsebodiesGetCode200Response +public record EndpointFakemultipleresponsebodiesGetCode200Response( + HttpResponse response, + [FakemultipleresponsebodiesGetCode200Response.SealedResponseBody](../../../paths/fakemultipleresponsebodies/get/responses/FakemultipleresponsebodiesGetCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + +## EndpointFakemultipleresponsebodiesGetCode202Response +public record EndpointFakemultipleresponsebodiesGetCode202Response( + HttpResponse response, + [FakemultipleresponsebodiesGetCode202Response.SealedResponseBody](../../../paths/fakemultipleresponsebodies/get/responses/FakemultipleresponsebodiesGetCode202Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/Responses.md b/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/Responses.md deleted file mode 100644 index 23ac78a74e1..00000000000 --- a/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/Responses.md +++ /dev/null @@ -1,40 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | -| record | [EndpointCode202Response](#endpointcode202response)
the response for 202 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response), -[EndpointCode202Response](#endpointcode202response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/fakemultipleresponsebodies/get/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - -## EndpointCode202Response -public record EndpointCode202Response( - HttpResponse response, - [Code202Response.SealedResponseBody](../../../paths/fakemultipleresponsebodies/get/responses/Code202Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/responses/Code200Response.md deleted file mode 100644 index ce537bef9b8..00000000000 --- a/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/responses/Code200Response.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakemultipleresponsebodies/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakemultipleresponsebodies/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/responses/Code202Response.md b/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/responses/Code202Response.md deleted file mode 100644 index b04ca6b54b6..00000000000 --- a/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/responses/Code202Response.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code202Response - -public class Code202Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code202Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code202Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code202Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code202Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code202Response.Code202Response1](#code202response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakemultipleresponsebodies/get/responses/code202response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakemultipleresponsebodies/get/responses/code202response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | - -## Code202Response1 -public static class Code202Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code202Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/responses/FakemultipleresponsebodiesGetCode200Response.md b/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/responses/FakemultipleresponsebodiesGetCode200Response.md new file mode 100644 index 00000000000..43977a02fe7 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/responses/FakemultipleresponsebodiesGetCode200Response.md @@ -0,0 +1,87 @@ +# FakemultipleresponsebodiesGetCode200Response + +public class FakemultipleresponsebodiesGetCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakemultipleresponsebodiesGetCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakemultipleresponsebodiesGetCode200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakemultipleresponsebodiesGetCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakemultipleresponsebodiesGetCode200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [FakemultipleresponsebodiesGetCode200Response.FakemultipleresponsebodiesGetCode200Response1](#fakemultipleresponsebodiesgetcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakemultipleresponsebodies/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakemultipleresponsebodies/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | + +## FakemultipleresponsebodiesGetCode200Response1 +public static class FakemultipleresponsebodiesGetCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakemultipleresponsebodiesGetCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/responses/FakemultipleresponsebodiesGetCode202Response.md b/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/responses/FakemultipleresponsebodiesGetCode202Response.md new file mode 100644 index 00000000000..75f30c5f0f3 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakemultipleresponsebodies/get/responses/FakemultipleresponsebodiesGetCode202Response.md @@ -0,0 +1,87 @@ +# FakemultipleresponsebodiesGetCode202Response + +public class FakemultipleresponsebodiesGetCode202Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakemultipleresponsebodiesGetCode202Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakemultipleresponsebodiesGetCode202Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakemultipleresponsebodiesGetCode202Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakemultipleresponsebodiesGetCode202Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [FakemultipleresponsebodiesGetCode202Response.FakemultipleresponsebodiesGetCode202Response1](#fakemultipleresponsebodiesgetcode202response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakemultipleresponsebodies/get/responses/code202response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakemultipleresponsebodies/get/responses/code202response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | + +## FakemultipleresponsebodiesGetCode202Response1 +public static class FakemultipleresponsebodiesGetCode202Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakemultipleresponsebodiesGetCode202Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakemultiplesecurities/FakemultiplesecuritiesGet.md b/samples/client/petstore/java/docs/paths/fakemultiplesecurities/FakemultiplesecuritiesGet.md new file mode 100644 index 00000000000..da3a2cc31a7 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakemultiplesecurities/FakemultiplesecuritiesGet.md @@ -0,0 +1,160 @@ +# FakemultiplesecuritiesGet + +public class FakemultiplesecuritiesGet + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Get](#get)
The class that has a get method to call the endpoint | +| interface | [MultipleSecuritiesOperation](#multiplesecuritiesoperation)
The interface that has a multipleSecurities method to call the endpoint | +| static class | [GetRequest](#getrequest)
The request inputs class | +| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | + +## Get +public static class Get extends ApiClient.ApiClient1 implements GetOperation
+ +a class that allows one to call the endpoint using a method named get + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakemultiplesecurities.get.FakemultiplesecuritiesGetSecurityInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.HttpBasicTest; +import org.openapijsonschematools.client.components.securityschemes.ApiKey; +import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; +import org.openapijsonschematools.client.paths.fakemultiplesecurities.get.responses.FakemultiplesecuritiesGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakemultiplesecurities.FakemultiplesecuritiesGet; +import org.openapijsonschematools.client.paths.fakemultiplesecurities.get.FakemultiplesecuritiesGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new HttpBasicTest("someUserId", "somePassword"); +); +securitySchemes.add( + new ApiKey("someApiKey"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .fakemultiplesecuritiesGetSecurityRequirementObject0SecurityIndex(FakemultiplesecuritiesGetSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakemultiplesecuritiesGet.Get apiClient = new FakemultiplesecuritiesGet.Get(apiConfiguration, schemaConfiguration); + + +var request = new FakemultiplesecuritiesGet.GetRequestBuilder().build(); + +FakemultiplesecuritiesGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakemultiplesecuritiesGetResponses.EndpointFakemultiplesecuritiesGetCode200Response castResponse = (FakemultiplesecuritiesGetResponses.EndpointFakemultiplesecuritiesGetCode200Response) response; +FakemultiplesecuritiesGetCode200Response.ApplicationjsonResponseBody deserializedBody = (FakemultiplesecuritiesGetCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakemultiplesecuritiesGetResponses.EndpointResponse](../../paths/fakemultiplesecurities/get/FakemultiplesecuritiesGetResponses.md#endpointresponse) | get([GetRequest](#getrequest) request) | + +## MultipleSecuritiesOperation +public interface MultipleSecuritiesOperation
+ +an interface that allows one to call the endpoint using a method named multipleSecurities by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakemultiplesecuritiesGetResponses.EndpointResponse](../../paths/fakemultiplesecurities/get/FakemultiplesecuritiesGetResponses.md#endpointresponse) | multipleSecurities([GetRequest](#getrequest) request) | + +## GetRequest +public static class GetRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| [FakemultiplesecuritiesGetSecurityInfo.@Nullable SecurityIndex](../../paths/fakemultiplesecurities/get/FakemultiplesecuritiesGetSecurityInfo.md#securityindex) | securityIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## GetRequestBuilder +public static class GetRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| GetRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | +| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [GetRequestBuilder](#getrequestbuilder) | securityIndex([FakemultiplesecuritiesGetSecurityInfo.SecurityIndex](../../paths/fakemultiplesecurities/get/FakemultiplesecuritiesGetSecurityInfo.md#securityindex) securityIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakemultiplesecurities/Get.md b/samples/client/petstore/java/docs/paths/fakemultiplesecurities/Get.md deleted file mode 100644 index f17fe936fdf..00000000000 --- a/samples/client/petstore/java/docs/paths/fakemultiplesecurities/Get.md +++ /dev/null @@ -1,149 +0,0 @@ -# Get - -public class Get - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Get1](#get1)
The class that has a get method to call the endpoint | -| static class | [GetRequest](#getrequest)
The request inputs class | -| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | - -## Get1 -public static class Get1 extends ApiClient.ApiClient1 implements GetOperation
- -a class that allows one to call the endpoint using a method named get - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakemultiplesecurities.get.FakemultiplesecuritiesGetSecurityInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.securityschemes.SecurityScheme; -import org.openapijsonschematools.client.components.securityschemes.HttpBasicTest; -import org.openapijsonschematools.client.components.securityschemes.ApiKey; -import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; -import org.openapijsonschematools.client.paths.fakemultiplesecurities.get.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakemultiplesecurities.Get; -import org.openapijsonschematools.client.paths.fakemultiplesecurities.get.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -List securitySchemes = new ArrayList(); -securitySchemes.add( - new HttpBasicTest("someUserId", "somePassword"); -); -securitySchemes.add( - new ApiKey("someApiKey"); -); -ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() - .fakemultiplesecuritiesGetSecurityRequirementObject0SecurityIndex(FakemultiplesecuritiesGetSecurityRequirementObject0.SecurityIndex.SECURITY_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - securitySchemes, - securityIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Get.Get1 apiClient = new Get.Get1(apiConfiguration, schemaConfiguration); - - -var request = new GetRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.get(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -Code200Response.ApplicationjsonResponseBody deserializedBody = (Code200Response.ApplicationjsonResponseBody) castResponse.body; -// handle deserialized body here -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakemultiplesecurities/get/Responses.md#endpointresponse) | get([GetRequest](#getrequest) request) | - -## GetRequest -public static class GetRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| [FakemultiplesecuritiesGetSecurityInfo.@Nullable SecurityIndex](../../paths/fakemultiplesecurities/get/FakemultiplesecuritiesGetSecurityInfo.md#securityindex) | securityIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## GetRequestBuilder -public static class GetRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| GetRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | -| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [GetRequestBuilder](#getrequestbuilder) | securityIndex([FakemultiplesecuritiesGetSecurityInfo.SecurityIndex](../../paths/fakemultiplesecurities/get/FakemultiplesecuritiesGetSecurityInfo.md#securityindex) securityIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakemultiplesecurities/get/FakemultiplesecuritiesGetResponses.md b/samples/client/petstore/java/docs/paths/fakemultiplesecurities/get/FakemultiplesecuritiesGetResponses.md new file mode 100644 index 00000000000..10182841698 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakemultiplesecurities/get/FakemultiplesecuritiesGetResponses.md @@ -0,0 +1,29 @@ +# FakemultiplesecuritiesGetResponses + +public class FakemultiplesecuritiesGetResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakemultiplesecuritiesGetCode200Response](#endpointfakemultiplesecuritiesgetcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakemultiplesecuritiesGetCode200Response](#endpointfakemultiplesecuritiesgetcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakemultiplesecuritiesGetCode200Response +public record EndpointFakemultiplesecuritiesGetCode200Response( + HttpResponse response, + [FakemultiplesecuritiesGetCode200Response.SealedResponseBody](../../../paths/fakemultiplesecurities/get/responses/FakemultiplesecuritiesGetCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakemultiplesecurities/get/Responses.md b/samples/client/petstore/java/docs/paths/fakemultiplesecurities/get/Responses.md deleted file mode 100644 index a2ec8f42a78..00000000000 --- a/samples/client/petstore/java/docs/paths/fakemultiplesecurities/get/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/fakemultiplesecurities/get/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakemultiplesecurities/get/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakemultiplesecurities/get/responses/Code200Response.md deleted file mode 100644 index 36b2ff44005..00000000000 --- a/samples/client/petstore/java/docs/paths/fakemultiplesecurities/get/responses/Code200Response.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakemultiplesecurities/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakemultiplesecurities/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakemultiplesecurities/get/responses/FakemultiplesecuritiesGetCode200Response.md b/samples/client/petstore/java/docs/paths/fakemultiplesecurities/get/responses/FakemultiplesecuritiesGetCode200Response.md new file mode 100644 index 00000000000..fe4134ce780 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakemultiplesecurities/get/responses/FakemultiplesecuritiesGetCode200Response.md @@ -0,0 +1,87 @@ +# FakemultiplesecuritiesGetCode200Response + +public class FakemultiplesecuritiesGetCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakemultiplesecuritiesGetCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakemultiplesecuritiesGetCode200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakemultiplesecuritiesGetCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakemultiplesecuritiesGetCode200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [FakemultiplesecuritiesGetCode200Response.FakemultiplesecuritiesGetCode200Response1](#fakemultiplesecuritiesgetcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakemultiplesecurities/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakemultiplesecurities/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | + +## FakemultiplesecuritiesGetCode200Response1 +public static class FakemultiplesecuritiesGetCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakemultiplesecuritiesGetCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakeobjinquery/FakeobjinqueryGet.md b/samples/client/petstore/java/docs/paths/fakeobjinquery/FakeobjinqueryGet.md new file mode 100644 index 00000000000..78ad271ec3b --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeobjinquery/FakeobjinqueryGet.md @@ -0,0 +1,142 @@ +# FakeobjinqueryGet + +public class FakeobjinqueryGet + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Get](#get)
The class that has a get method to call the endpoint | +| interface | [ObjectInQueryOperation](#objectinqueryoperation)
The interface that has a objectInQuery method to call the endpoint | +| static class | [GetRequest](#getrequest)
The request inputs class | +| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | + +## Get +public static class Get extends ApiClient.ApiClient1 implements GetOperation
+ +a class that allows one to call the endpoint using a method named get + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakeobjinquery.get.FakeobjinqueryGetQueryParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeobjinquery.get.responses.FakeobjinqueryGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeobjinquery.FakeobjinqueryGet; +import org.openapijsonschematools.client.paths.fakeobjinquery.get.FakeobjinqueryGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakeobjinqueryGet.Get apiClient = new FakeobjinqueryGet.Get(apiConfiguration, schemaConfiguration); + + +var request = new FakeobjinqueryGet.GetRequestBuilder().build(); + +FakeobjinqueryGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeobjinqueryGetResponses.EndpointFakeobjinqueryGetCode200Response castResponse = (FakeobjinqueryGetResponses.EndpointFakeobjinqueryGetCode200Response) response; +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeobjinqueryGetResponses.EndpointResponse](../../paths/fakeobjinquery/get/FakeobjinqueryGetResponses.md#endpointresponse) | get([GetRequest](#getrequest) request) | + +## ObjectInQueryOperation +public interface ObjectInQueryOperation
+ +an interface that allows one to call the endpoint using a method named objectInQuery by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeobjinqueryGetResponses.EndpointResponse](../../paths/fakeobjinquery/get/FakeobjinqueryGetResponses.md#endpointresponse) | objectInQuery([GetRequest](#getrequest) request) | + +## GetRequest +public static class GetRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakeobjinqueryGetQueryParameters.@Nullable FakeobjinqueryGetQueryParametersMap](../../paths/fakeobjinquery/get/FakeobjinqueryGetQueryParameters.md#fakeobjinquerygetqueryparametersmap) | queryParameters
optional | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## GetRequestBuilder +public static class GetRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| GetRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | +| [GetRequestBuilder](#getrequestbuilder) | queryParameters([FakeobjinqueryGetQueryParametersFakeobjinqueryGetQueryParametersMap](../../paths/fakeobjinquery/get/FakeobjinqueryGetQueryParameters.md#fakeobjinquerygetqueryparametersmap) queryParameters)
sets the optional property | +| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakeobjinquery/Get.md b/samples/client/petstore/java/docs/paths/fakeobjinquery/Get.md deleted file mode 100644 index 0bb145e285a..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeobjinquery/Get.md +++ /dev/null @@ -1,131 +0,0 @@ -# Get - -public class Get - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Get1](#get1)
The class that has a get method to call the endpoint | -| static class | [GetRequest](#getrequest)
The request inputs class | -| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | - -## Get1 -public static class Get1 extends ApiClient.ApiClient1 implements GetOperation
- -a class that allows one to call the endpoint using a method named get - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakeobjinquery.get.QueryParameters; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakeobjinquery.get.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakeobjinquery.Get; -import org.openapijsonschematools.client.paths.fakeobjinquery.get.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Get.Get1 apiClient = new Get.Get1(apiConfiguration, schemaConfiguration); - - -var request = new GetRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.get(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakeobjinquery/get/Responses.md#endpointresponse) | get([GetRequest](#getrequest) request) | - -## GetRequest -public static class GetRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [QueryParameters.@Nullable QueryParametersMap](../../paths/fakeobjinquery/get/QueryParameters.md#queryparametersmap) | queryParameters
optional | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## GetRequestBuilder -public static class GetRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| GetRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | -| [GetRequestBuilder](#getrequestbuilder) | queryParameters([QueryParametersQueryParametersMap](../../paths/fakeobjinquery/get/QueryParameters.md#queryparametersmap) queryParameters)
sets the optional property | -| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakeobjinquery/get/FakeobjinqueryGetQueryParameters.md b/samples/client/petstore/java/docs/paths/fakeobjinquery/get/FakeobjinqueryGetQueryParameters.md new file mode 100644 index 00000000000..454d5ae13a2 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeobjinquery/get/FakeobjinqueryGetQueryParameters.md @@ -0,0 +1,258 @@ +# FakeobjinqueryGetQueryParameters +public class FakeobjinqueryGetQueryParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [FakeobjinqueryGetQueryParameters.FakeobjinqueryGetQueryParameters1Boxed](#fakeobjinquerygetqueryparameters1boxed)
sealed interface for validated payloads | +| record | [FakeobjinqueryGetQueryParameters.FakeobjinqueryGetQueryParameters1BoxedMap](#fakeobjinquerygetqueryparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [FakeobjinqueryGetQueryParameters.FakeobjinqueryGetQueryParameters1](#fakeobjinquerygetqueryparameters1)
schema class | +| static class | [FakeobjinqueryGetQueryParameters.FakeobjinqueryGetQueryParametersMapBuilder](#fakeobjinquerygetqueryparametersmapbuilder)
builder for Map payloads | +| static class | [FakeobjinqueryGetQueryParameters.FakeobjinqueryGetQueryParametersMap](#fakeobjinquerygetqueryparametersmap)
output class for Map payloads | +| sealed interface | [FakeobjinqueryGetQueryParameters.FakeobjinqueryGetadditionalPropertiesBoxed](#fakeobjinquerygetadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [FakeobjinqueryGetQueryParameters.FakeobjinqueryGetadditionalPropertiesBoxedVoid](#fakeobjinquerygetadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [FakeobjinqueryGetQueryParameters.FakeobjinqueryGetadditionalPropertiesBoxedBoolean](#fakeobjinquerygetadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [FakeobjinqueryGetQueryParameters.FakeobjinqueryGetadditionalPropertiesBoxedNumber](#fakeobjinquerygetadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [FakeobjinqueryGetQueryParameters.FakeobjinqueryGetadditionalPropertiesBoxedString](#fakeobjinquerygetadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [FakeobjinqueryGetQueryParameters.FakeobjinqueryGetadditionalPropertiesBoxedList](#fakeobjinquerygetadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [FakeobjinqueryGetQueryParameters.FakeobjinqueryGetadditionalPropertiesBoxedMap](#fakeobjinquerygetadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [FakeobjinqueryGetQueryParameters.FakeobjinqueryGetadditionalProperties](#fakeobjinquerygetadditionalproperties)
schema class | + +## FakeobjinqueryGetQueryParameters1Boxed +public sealed interface FakeobjinqueryGetQueryParameters1Boxed
+permits
+[FakeobjinqueryGetQueryParameters1BoxedMap](#fakeobjinquerygetqueryparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## FakeobjinqueryGetQueryParameters1BoxedMap +public record FakeobjinqueryGetQueryParameters1BoxedMap
+implements [FakeobjinqueryGetQueryParameters1Boxed](#fakeobjinquerygetqueryparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeobjinqueryGetQueryParameters1BoxedMap([FakeobjinqueryGetQueryParametersMap](#fakeobjinquerygetqueryparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeobjinqueryGetQueryParametersMap](#fakeobjinquerygetqueryparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeobjinqueryGetQueryParameters1 +public static class FakeobjinqueryGetQueryParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakeobjinquery.get.FakeobjinqueryGetQueryParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +FakeobjinqueryGetQueryParameters.FakeobjinqueryGetQueryParametersMap validatedPayload = + FakeobjinqueryGetQueryParameters.FakeobjinqueryGetQueryParameters1.validate( + new FakeobjinqueryGetQueryParameters.FakeobjinqueryGetQueryParametersMapBuilder() + .mapBean( + MapUtils.makeMap( + new AbstractMap.SimpleEntry( + "keyword", + "a" + ) + ) + ) + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("mapBean", [Schema0.Schema01.class](../../../paths/fakeobjinquery/get/parameters/parameter0/Schema0.md#schema01))
)
| +| Class | additionalProperties = [FakeobjinqueryGetadditionalProperties.class](#fakeobjinquerygetadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeobjinqueryGetQueryParametersMap](#fakeobjinquerygetqueryparametersmap) | validate([Map<?, ?>](#fakeobjinquerygetqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [FakeobjinqueryGetQueryParameters1BoxedMap](#fakeobjinquerygetqueryparameters1boxedmap) | validateAndBox([Map<?, ?>](#fakeobjinquerygetqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [FakeobjinqueryGetQueryParameters1Boxed](#fakeobjinquerygetqueryparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## FakeobjinqueryGetQueryParametersMapBuilder +public class FakeobjinqueryGetQueryParametersMapBuilder
+builder for `Map>` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeobjinqueryGetQueryParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map> | build()
Returns map input that should be used with Schema.validate | +| [FakeobjinqueryGetQueryParametersMapBuilder](#fakeobjinquerygetqueryparametersmapbuilder) | mapBean(Map value) | + +## FakeobjinqueryGetQueryParametersMap +public static class FakeobjinqueryGetQueryParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [FakeobjinqueryGetQueryParametersMap](#fakeobjinquerygetqueryparametersmap) | of([Map>](#fakeobjinquerygetqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [Schema0.SchemaMap0](../../../paths/fakeobjinquery/get/parameters/parameter0/Schema0.md#schemamap0) | mapBean()
[optional] | + +## FakeobjinqueryGetadditionalPropertiesBoxed +public sealed interface FakeobjinqueryGetadditionalPropertiesBoxed
+permits
+[FakeobjinqueryGetadditionalPropertiesBoxedVoid](#fakeobjinquerygetadditionalpropertiesboxedvoid), +[FakeobjinqueryGetadditionalPropertiesBoxedBoolean](#fakeobjinquerygetadditionalpropertiesboxedboolean), +[FakeobjinqueryGetadditionalPropertiesBoxedNumber](#fakeobjinquerygetadditionalpropertiesboxednumber), +[FakeobjinqueryGetadditionalPropertiesBoxedString](#fakeobjinquerygetadditionalpropertiesboxedstring), +[FakeobjinqueryGetadditionalPropertiesBoxedList](#fakeobjinquerygetadditionalpropertiesboxedlist), +[FakeobjinqueryGetadditionalPropertiesBoxedMap](#fakeobjinquerygetadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## FakeobjinqueryGetadditionalPropertiesBoxedVoid +public record FakeobjinqueryGetadditionalPropertiesBoxedVoid
+implements [FakeobjinqueryGetadditionalPropertiesBoxed](#fakeobjinquerygetadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeobjinqueryGetadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeobjinqueryGetadditionalPropertiesBoxedBoolean +public record FakeobjinqueryGetadditionalPropertiesBoxedBoolean
+implements [FakeobjinqueryGetadditionalPropertiesBoxed](#fakeobjinquerygetadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeobjinqueryGetadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeobjinqueryGetadditionalPropertiesBoxedNumber +public record FakeobjinqueryGetadditionalPropertiesBoxedNumber
+implements [FakeobjinqueryGetadditionalPropertiesBoxed](#fakeobjinquerygetadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeobjinqueryGetadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeobjinqueryGetadditionalPropertiesBoxedString +public record FakeobjinqueryGetadditionalPropertiesBoxedString
+implements [FakeobjinqueryGetadditionalPropertiesBoxed](#fakeobjinquerygetadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeobjinqueryGetadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeobjinqueryGetadditionalPropertiesBoxedList +public record FakeobjinqueryGetadditionalPropertiesBoxedList
+implements [FakeobjinqueryGetadditionalPropertiesBoxed](#fakeobjinquerygetadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeobjinqueryGetadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeobjinqueryGetadditionalPropertiesBoxedMap +public record FakeobjinqueryGetadditionalPropertiesBoxedMap
+implements [FakeobjinqueryGetadditionalPropertiesBoxed](#fakeobjinquerygetadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeobjinqueryGetadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakeobjinqueryGetadditionalProperties +public static class FakeobjinqueryGetadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakeobjinquery/get/FakeobjinqueryGetResponses.md b/samples/client/petstore/java/docs/paths/fakeobjinquery/get/FakeobjinqueryGetResponses.md new file mode 100644 index 00000000000..edf71dc70ce --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeobjinquery/get/FakeobjinqueryGetResponses.md @@ -0,0 +1,29 @@ +# FakeobjinqueryGetResponses + +public class FakeobjinqueryGetResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakeobjinqueryGetCode200Response](#endpointfakeobjinquerygetcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakeobjinqueryGetCode200Response](#endpointfakeobjinquerygetcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakeobjinqueryGetCode200Response +public record EndpointFakeobjinqueryGetCode200Response( + HttpResponse response, + Void body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakeobjinquery/get/QueryParameters.md b/samples/client/petstore/java/docs/paths/fakeobjinquery/get/QueryParameters.md deleted file mode 100644 index 4c6bb23a701..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeobjinquery/get/QueryParameters.md +++ /dev/null @@ -1,258 +0,0 @@ -# QueryParameters -public class QueryParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [QueryParameters.QueryParameters1Boxed](#queryparameters1boxed)
sealed interface for validated payloads | -| record | [QueryParameters.QueryParameters1BoxedMap](#queryparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [QueryParameters.QueryParameters1](#queryparameters1)
schema class | -| static class | [QueryParameters.QueryParametersMapBuilder](#queryparametersmapbuilder)
builder for Map payloads | -| static class | [QueryParameters.QueryParametersMap](#queryparametersmap)
output class for Map payloads | -| sealed interface | [QueryParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [QueryParameters.AdditionalProperties](#additionalproperties)
schema class | - -## QueryParameters1Boxed -public sealed interface QueryParameters1Boxed
-permits
-[QueryParameters1BoxedMap](#queryparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## QueryParameters1BoxedMap -public record QueryParameters1BoxedMap
-implements [QueryParameters1Boxed](#queryparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParameters1BoxedMap([QueryParametersMap](#queryparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap](#queryparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## QueryParameters1 -public static class QueryParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakeobjinquery.get.QueryParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -QueryParameters.QueryParametersMap validatedPayload = - QueryParameters.QueryParameters1.validate( - new QueryParameters.QueryParametersMapBuilder() - .mapBean( - MapUtils.makeMap( - new AbstractMap.SimpleEntry( - "keyword", - "a" - ) - ) - ) - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("mapBean", [Schema0.Schema01.class](../../../paths/fakeobjinquery/get/parameters/parameter0/Schema0.md#schema01))
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap](#queryparametersmap) | validate([Map<?, ?>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [QueryParameters1BoxedMap](#queryparameters1boxedmap) | validateAndBox([Map<?, ?>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [QueryParameters1Boxed](#queryparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## QueryParametersMapBuilder -public class QueryParametersMapBuilder
-builder for `Map>` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map> | build()
Returns map input that should be used with Schema.validate | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | mapBean(Map value) | - -## QueryParametersMap -public static class QueryParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [QueryParametersMap](#queryparametersmap) | of([Map>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [Schema0.SchemaMap0](../../../paths/fakeobjinquery/get/parameters/parameter0/Schema0.md#schemamap0) | mapBean()
[optional] | - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakeobjinquery/get/Responses.md b/samples/client/petstore/java/docs/paths/fakeobjinquery/get/Responses.md deleted file mode 100644 index d4bf4fdb8f5..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeobjinquery/get/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakeobjinquery/get/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakeobjinquery/get/responses/Code200Response.md deleted file mode 100644 index e89c75b2e12..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeobjinquery/get/responses/Code200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# Code200Response - -public class Code200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) - -A class (extended from the $ref class) that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## Code200Response1 -public static class Code200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
- -a class that deserializes responses, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/fakeobjinquery/get/responses/FakeobjinqueryGetCode200Response.md b/samples/client/petstore/java/docs/paths/fakeobjinquery/get/responses/FakeobjinqueryGetCode200Response.md new file mode 100644 index 00000000000..6ff3fdb9b67 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeobjinquery/get/responses/FakeobjinqueryGetCode200Response.md @@ -0,0 +1,17 @@ +# FakeobjinqueryGetCode200Response + +public class FakeobjinqueryGetCode200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) + +A class (extended from the $ref class) that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [FakeobjinqueryGetCode200Response.FakeobjinqueryGetCode200Response1](#fakeobjinquerygetcode200response1)
class that deserializes responses | + +## FakeobjinqueryGetCode200Response1 +public static class FakeobjinqueryGetCode200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
+ +a class that deserializes responses, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/Fakeparametercollisions1ababselfabPost.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/Fakeparametercollisions1ababselfabPost.md new file mode 100644 index 00000000000..292dc8096de --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/Fakeparametercollisions1ababselfabPost.md @@ -0,0 +1,208 @@ +# Fakeparametercollisions1ababselfabPost + +public class Fakeparametercollisions1ababselfabPost + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Post](#post)
The class that has a post method to call the endpoint | +| interface | [ParameterCollisionsOperation](#parametercollisionsoperation)
The interface that has a parameterCollisions method to call the endpoint | +| static class | [PostRequest](#postrequest)
The final request inputs class | +| static class | [PostNullableRequest](#postnullablerequest)
The initial request inputs class | +| static class | [Post0RequestBuilder](#post0requestbuilder)
A builder for the request input class | +| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | + +## Post +public static class Post extends ApiClient.ApiClient1 implements PostOperation
+ +a class that allows one to call the endpoint using a method named post + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Fakeparametercollisions1ababselfabPostRequestBody; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Fakeparametercollisions1ababselfabPostHeaderParameters; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Fakeparametercollisions1ababselfabPostQueryParameters; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Fakeparametercollisions1ababselfabPostCookieParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Fakeparametercollisions1ababselfabPostPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.responses.Fakeparametercollisions1ababselfabPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.Fakeparametercollisions1ababselfabPost; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Fakeparametercollisions1ababselfabPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +Fakeparametercollisions1ababselfabPost.Post apiClient = new Fakeparametercollisions1ababselfabPost.Post(apiConfiguration, schemaConfiguration); + + +// Map validation +Fakeparametercollisions1ababselfabPostPathParameters.Fakeparametercollisions1ababselfabPostPathParametersMap pathParameters = + Fakeparametercollisions1ababselfabPostPathParameters.Fakeparametercollisions1ababselfabPostPathParameters1.validate( + new Fakeparametercollisions1ababselfabPostPathParameters.Fakeparametercollisions1ababselfabPostPathParametersMapBuilder() + .positive1("a") + + .aHyphenMinusB("a") + + .Ab("a") + + .aB("a") + + .self("a") + + .build(), + schemaConfiguration +); + +var request = new Fakeparametercollisions1ababselfabPost.PostRequestBuilder() + .pathParameters(pathParameters) + .build(); + +Fakeparametercollisions1ababselfabPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +Fakeparametercollisions1ababselfabPostResponses.EndpointFakeparametercollisions1ababselfabPostCode200Response castResponse = (Fakeparametercollisions1ababselfabPostResponses.EndpointFakeparametercollisions1ababselfabPostCode200Response) response; +Fakeparametercollisions1ababselfabPostCode200Response.ApplicationjsonResponseBody deserializedBody = (Fakeparametercollisions1ababselfabPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostResponses.EndpointResponse](../../paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostResponses.md#endpointresponse) | post([PostRequest](#postrequest) request) | + +## ParameterCollisionsOperation +public interface ParameterCollisionsOperation
+ +an interface that allows one to call the endpoint using a method named parameterCollisions by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostResponses.EndpointResponse](../../paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostResponses.md#endpointresponse) | parameterCollisions([PostRequest](#postrequest) request) | + +## PostRequest +public static class PostRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [Fakeparametercollisions1ababselfabPostPathParameters.Fakeparametercollisions1ababselfabPostPathParametersMap](../../paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostPathParameters.md#fakeparametercollisions1ababselfabpostpathparametersmap) | pathParameters | +| [Fakeparametercollisions1ababselfabPostRequestBody.@Nullable SealedRequestBody](../../paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostRequestBody.md#sealedrequestbody) | requestBody
optional | +| [Fakeparametercollisions1ababselfabPostHeaderParameters.@Nullable Fakeparametercollisions1ababselfabPostHeaderParametersMap](../../paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostHeaderParameters.md#fakeparametercollisions1ababselfabpostheaderparametersmap) | headerParameters
optional | +| [Fakeparametercollisions1ababselfabPostQueryParameters.@Nullable Fakeparametercollisions1ababselfabPostQueryParametersMap](../../paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostQueryParameters.md#fakeparametercollisions1ababselfabpostqueryparametersmap) | queryParameters
optional | +| [Fakeparametercollisions1ababselfabPostCookieParameters.@Nullable Fakeparametercollisions1ababselfabPostCookieParametersMap](../../paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostCookieParameters.md#fakeparametercollisions1ababselfabpostcookieparametersmap) | cookieParameters
optional | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PostNullableRequest +public static class PostNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [Fakeparametercollisions1ababselfabPostPathParameters.@Nullable Fakeparametercollisions1ababselfabPostPathParametersMap](../../paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostPathParameters.md#fakeparametercollisions1ababselfabpostpathparametersmap) | pathParameters | +| [Fakeparametercollisions1ababselfabPostRequestBody.@Nullable SealedRequestBody](../../paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostRequestBody.md#sealedrequestbody) | requestBody | +| [Fakeparametercollisions1ababselfabPostHeaderParameters.@Nullable Fakeparametercollisions1ababselfabPostHeaderParametersMap](../../paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostHeaderParameters.md#fakeparametercollisions1ababselfabpostheaderparametersmap) | headerParameters | +| [Fakeparametercollisions1ababselfabPostQueryParameters.@Nullable Fakeparametercollisions1ababselfabPostQueryParametersMap](../../paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostQueryParameters.md#fakeparametercollisions1ababselfabpostqueryparametersmap) | queryParameters | +| [Fakeparametercollisions1ababselfabPostCookieParameters.@Nullable Fakeparametercollisions1ababselfabPostCookieParametersMap](../../paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostCookieParameters.md#fakeparametercollisions1ababselfabpostcookieparametersmap) | cookieParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| @Nullable Duration | timeout | + +## Post0RequestBuilder +public static class Post0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post0RequestBuilder(Post0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | +| [Post0RequestBuilder](#post0requestbuilder) | requestBody([Fakeparametercollisions1ababselfabPostRequestBody.SealedRequestBody](../../paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostRequestBody.md#sealedrequestbody) requestBody)
sets the optional property | +| [Post0RequestBuilder](#post0requestbuilder) | headerParameters([Fakeparametercollisions1ababselfabPostHeaderParametersFakeparametercollisions1ababselfabPostHeaderParametersMap](../../paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostHeaderParameters.md#fakeparametercollisions1ababselfabpostheaderparametersmap) headerParameters)
sets the optional property | +| [Post0RequestBuilder](#post0requestbuilder) | queryParameters([Fakeparametercollisions1ababselfabPostQueryParametersFakeparametercollisions1ababselfabPostQueryParametersMap](../../paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostQueryParameters.md#fakeparametercollisions1ababselfabpostqueryparametersmap) queryParameters)
sets the optional property | +| [Post0RequestBuilder](#post0requestbuilder) | cookieParameters([Fakeparametercollisions1ababselfabPostCookieParametersFakeparametercollisions1ababselfabPostCookieParametersMap](../../paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostCookieParameters.md#fakeparametercollisions1ababselfabpostcookieparametersmap) cookieParameters)
sets the optional property | +| [Post0RequestBuilder](#post0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Post0RequestBuilder](#post0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## PostRequestBuilder +public static class PostRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PostRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Post0RequestBuilder](#post0requestbuilder) | pathParameters([Fakeparametercollisions1ababselfabPostPathParametersFakeparametercollisions1ababselfabPostPathParametersMap](../../paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostPathParameters.md#fakeparametercollisions1ababselfabpostpathparametersmap) pathParameters)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/Post.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/Post.md deleted file mode 100644 index 04bdd7cc49f..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/Post.md +++ /dev/null @@ -1,197 +0,0 @@ -# Post - -public class Post - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Post1](#post1)
The class that has a post method to call the endpoint | -| static class | [PostRequest](#postrequest)
The final request inputs class | -| static class | [PostNullableRequest](#postnullablerequest)
The initial request inputs class | -| static class | [Post0RequestBuilder](#post0requestbuilder)
A builder for the request input class | -| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | - -## Post1 -public static class Post1 extends ApiClient.ApiClient1 implements PostOperation
- -a class that allows one to call the endpoint using a method named post - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.RequestBody; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.HeaderParameters; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.QueryParameters; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.CookieParameters; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.PathParameters; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.Post; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Post.Post1 apiClient = new Post.Post1(apiConfiguration, schemaConfiguration); - - -// Map validation -PathParameters.PathParametersMap pathParameters = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .positive1("a") - - .aHyphenMinusB("a") - - .Ab("a") - - .aB("a") - - .self("a") - - .build(), - schemaConfiguration -); - -var request = new PostRequestBuilder() - .pathParameters(pathParameters) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.post(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -Code200Response.ApplicationjsonResponseBody deserializedBody = (Code200Response.ApplicationjsonResponseBody) castResponse.body; -// handle deserialized body here -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakeparametercollisions1ababselfab/post/Responses.md#endpointresponse) | post([PostRequest](#postrequest) request) | - -## PostRequest -public static class PostRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [PathParameters.PathParametersMap](../../paths/fakeparametercollisions1ababselfab/post/PathParameters.md#pathparametersmap) | pathParameters | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fakeparametercollisions1ababselfab/post/RequestBody.md#sealedrequestbody) | requestBody
optional | -| [HeaderParameters.@Nullable HeaderParametersMap](../../paths/fakeparametercollisions1ababselfab/post/HeaderParameters.md#headerparametersmap) | headerParameters
optional | -| [QueryParameters.@Nullable QueryParametersMap](../../paths/fakeparametercollisions1ababselfab/post/QueryParameters.md#queryparametersmap) | queryParameters
optional | -| [CookieParameters.@Nullable CookieParametersMap](../../paths/fakeparametercollisions1ababselfab/post/CookieParameters.md#cookieparametersmap) | cookieParameters
optional | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PostNullableRequest -public static class PostNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [PathParameters.@Nullable PathParametersMap](../../paths/fakeparametercollisions1ababselfab/post/PathParameters.md#pathparametersmap) | pathParameters | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fakeparametercollisions1ababselfab/post/RequestBody.md#sealedrequestbody) | requestBody | -| [HeaderParameters.@Nullable HeaderParametersMap](../../paths/fakeparametercollisions1ababselfab/post/HeaderParameters.md#headerparametersmap) | headerParameters | -| [QueryParameters.@Nullable QueryParametersMap](../../paths/fakeparametercollisions1ababselfab/post/QueryParameters.md#queryparametersmap) | queryParameters | -| [CookieParameters.@Nullable CookieParametersMap](../../paths/fakeparametercollisions1ababselfab/post/CookieParameters.md#cookieparametersmap) | cookieParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| @Nullable Duration | timeout | - -## Post0RequestBuilder -public static class Post0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post0RequestBuilder(Post0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | -| [Post0RequestBuilder](#post0requestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/fakeparametercollisions1ababselfab/post/RequestBody.md#sealedrequestbody) requestBody)
sets the optional property | -| [Post0RequestBuilder](#post0requestbuilder) | headerParameters([HeaderParametersHeaderParametersMap](../../paths/fakeparametercollisions1ababselfab/post/HeaderParameters.md#headerparametersmap) headerParameters)
sets the optional property | -| [Post0RequestBuilder](#post0requestbuilder) | queryParameters([QueryParametersQueryParametersMap](../../paths/fakeparametercollisions1ababselfab/post/QueryParameters.md#queryparametersmap) queryParameters)
sets the optional property | -| [Post0RequestBuilder](#post0requestbuilder) | cookieParameters([CookieParametersCookieParametersMap](../../paths/fakeparametercollisions1ababselfab/post/CookieParameters.md#cookieparametersmap) cookieParameters)
sets the optional property | -| [Post0RequestBuilder](#post0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Post0RequestBuilder](#post0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## PostRequestBuilder -public static class PostRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PostRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Post0RequestBuilder](#post0requestbuilder) | pathParameters([PathParametersPathParametersMap](../../paths/fakeparametercollisions1ababselfab/post/PathParameters.md#pathparametersmap) pathParameters)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/CookieParameters.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/CookieParameters.md deleted file mode 100644 index bb7f88699c9..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/CookieParameters.md +++ /dev/null @@ -1,267 +0,0 @@ -# CookieParameters -public class CookieParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [CookieParameters.CookieParameters1Boxed](#cookieparameters1boxed)
sealed interface for validated payloads | -| record | [CookieParameters.CookieParameters1BoxedMap](#cookieparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [CookieParameters.CookieParameters1](#cookieparameters1)
schema class | -| static class | [CookieParameters.CookieParametersMapBuilder](#cookieparametersmapbuilder)
builder for Map payloads | -| static class | [CookieParameters.CookieParametersMap](#cookieparametersmap)
output class for Map payloads | -| sealed interface | [CookieParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [CookieParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [CookieParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [CookieParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [CookieParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [CookieParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [CookieParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [CookieParameters.AdditionalProperties](#additionalproperties)
schema class | - -## CookieParameters1Boxed -public sealed interface CookieParameters1Boxed
-permits
-[CookieParameters1BoxedMap](#cookieparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## CookieParameters1BoxedMap -public record CookieParameters1BoxedMap
-implements [CookieParameters1Boxed](#cookieparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| CookieParameters1BoxedMap([CookieParametersMap](#cookieparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [CookieParametersMap](#cookieparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## CookieParameters1 -public static class CookieParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.CookieParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -CookieParameters.CookieParametersMap validatedPayload = - CookieParameters.CookieParameters1.validate( - new CookieParameters.CookieParametersMapBuilder() - .positive1("a") - - .aB("a") - - .Ab("a") - - .aHyphenMinusB("a") - - .self("a") - - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("1", [Schema14.Schema141.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter14/Schema14.md#schema141)),
    new PropertyEntry("aB", [Schema15.Schema151.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter15/Schema15.md#schema151)),
    new PropertyEntry("Ab", [Schema16.Schema161.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter16/Schema16.md#schema161)),
    new PropertyEntry("A-B", [Schema18.Schema181.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter18/Schema18.md#schema181)),
    new PropertyEntry("self", [Schema17.Schema171.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter17/Schema17.md#schema171))
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [CookieParametersMap](#cookieparametersmap) | validate([Map<?, ?>](#cookieparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [CookieParameters1BoxedMap](#cookieparameters1boxedmap) | validateAndBox([Map<?, ?>](#cookieparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [CookieParameters1Boxed](#cookieparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## CookieParametersMapBuilder -public class CookieParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| CookieParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | -| [CookieParametersMapBuilder](#cookieparametersmapbuilder) | positive1(String value) | -| [CookieParametersMapBuilder](#cookieparametersmapbuilder) | aB(String value) | -| [CookieParametersMapBuilder](#cookieparametersmapbuilder) | Ab(String value) | -| [CookieParametersMapBuilder](#cookieparametersmapbuilder) | aHyphenMinusB(String value) | -| [CookieParametersMapBuilder](#cookieparametersmapbuilder) | self(String value) | - -## CookieParametersMap -public static class CookieParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [CookieParametersMap](#cookieparametersmap) | of([Map](#cookieparametersmapbuilder) arg, SchemaConfiguration configuration) | -| String | aB()
[optional] | -| String | Ab()
[optional] | -| String | self()
[optional] | -| @Nullable Object | get(String key)
This schema has invalid Java names so this method must be used when you access instance["1"], instance["A-B"], | - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostCookieParameters.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostCookieParameters.md new file mode 100644 index 00000000000..aa5cbc51772 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostCookieParameters.md @@ -0,0 +1,267 @@ +# Fakeparametercollisions1ababselfabPostCookieParameters +public class Fakeparametercollisions1ababselfabPostCookieParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [Fakeparametercollisions1ababselfabPostCookieParameters.Fakeparametercollisions1ababselfabPostCookieParameters1Boxed](#fakeparametercollisions1ababselfabpostcookieparameters1boxed)
sealed interface for validated payloads | +| record | [Fakeparametercollisions1ababselfabPostCookieParameters.Fakeparametercollisions1ababselfabPostCookieParameters1BoxedMap](#fakeparametercollisions1ababselfabpostcookieparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [Fakeparametercollisions1ababselfabPostCookieParameters.Fakeparametercollisions1ababselfabPostCookieParameters1](#fakeparametercollisions1ababselfabpostcookieparameters1)
schema class | +| static class | [Fakeparametercollisions1ababselfabPostCookieParameters.Fakeparametercollisions1ababselfabPostCookieParametersMapBuilder](#fakeparametercollisions1ababselfabpostcookieparametersmapbuilder)
builder for Map payloads | +| static class | [Fakeparametercollisions1ababselfabPostCookieParameters.Fakeparametercollisions1ababselfabPostCookieParametersMap](#fakeparametercollisions1ababselfabpostcookieparametersmap)
output class for Map payloads | +| sealed interface | [Fakeparametercollisions1ababselfabPostCookieParameters.Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [Fakeparametercollisions1ababselfabPostCookieParameters.Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedVoid](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [Fakeparametercollisions1ababselfabPostCookieParameters.Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedBoolean](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [Fakeparametercollisions1ababselfabPostCookieParameters.Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedNumber](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [Fakeparametercollisions1ababselfabPostCookieParameters.Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedString](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [Fakeparametercollisions1ababselfabPostCookieParameters.Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedList](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [Fakeparametercollisions1ababselfabPostCookieParameters.Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedMap](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [Fakeparametercollisions1ababselfabPostCookieParameters.Fakeparametercollisions1ababselfabPostadditionalProperties](#fakeparametercollisions1ababselfabpostadditionalproperties)
schema class | + +## Fakeparametercollisions1ababselfabPostCookieParameters1Boxed +public sealed interface Fakeparametercollisions1ababselfabPostCookieParameters1Boxed
+permits
+[Fakeparametercollisions1ababselfabPostCookieParameters1BoxedMap](#fakeparametercollisions1ababselfabpostcookieparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## Fakeparametercollisions1ababselfabPostCookieParameters1BoxedMap +public record Fakeparametercollisions1ababselfabPostCookieParameters1BoxedMap
+implements [Fakeparametercollisions1ababselfabPostCookieParameters1Boxed](#fakeparametercollisions1ababselfabpostcookieparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostCookieParameters1BoxedMap([Fakeparametercollisions1ababselfabPostCookieParametersMap](#fakeparametercollisions1ababselfabpostcookieparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostCookieParametersMap](#fakeparametercollisions1ababselfabpostcookieparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Fakeparametercollisions1ababselfabPostCookieParameters1 +public static class Fakeparametercollisions1ababselfabPostCookieParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Fakeparametercollisions1ababselfabPostCookieParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +Fakeparametercollisions1ababselfabPostCookieParameters.Fakeparametercollisions1ababselfabPostCookieParametersMap validatedPayload = + Fakeparametercollisions1ababselfabPostCookieParameters.Fakeparametercollisions1ababselfabPostCookieParameters1.validate( + new Fakeparametercollisions1ababselfabPostCookieParameters.Fakeparametercollisions1ababselfabPostCookieParametersMapBuilder() + .positive1("a") + + .aB("a") + + .Ab("a") + + .aHyphenMinusB("a") + + .self("a") + + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("1", [Schema14.Schema141.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter14/Schema14.md#schema141)),
    new PropertyEntry("aB", [Schema15.Schema151.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter15/Schema15.md#schema151)),
    new PropertyEntry("Ab", [Schema16.Schema161.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter16/Schema16.md#schema161)),
    new PropertyEntry("A-B", [Schema18.Schema181.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter18/Schema18.md#schema181)),
    new PropertyEntry("self", [Schema17.Schema171.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter17/Schema17.md#schema171))
)
| +| Class | additionalProperties = [Fakeparametercollisions1ababselfabPostadditionalProperties.class](#fakeparametercollisions1ababselfabpostadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostCookieParametersMap](#fakeparametercollisions1ababselfabpostcookieparametersmap) | validate([Map<?, ?>](#fakeparametercollisions1ababselfabpostcookieparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [Fakeparametercollisions1ababselfabPostCookieParameters1BoxedMap](#fakeparametercollisions1ababselfabpostcookieparameters1boxedmap) | validateAndBox([Map<?, ?>](#fakeparametercollisions1ababselfabpostcookieparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [Fakeparametercollisions1ababselfabPostCookieParameters1Boxed](#fakeparametercollisions1ababselfabpostcookieparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## Fakeparametercollisions1ababselfabPostCookieParametersMapBuilder +public class Fakeparametercollisions1ababselfabPostCookieParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostCookieParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | +| [Fakeparametercollisions1ababselfabPostCookieParametersMapBuilder](#fakeparametercollisions1ababselfabpostcookieparametersmapbuilder) | positive1(String value) | +| [Fakeparametercollisions1ababselfabPostCookieParametersMapBuilder](#fakeparametercollisions1ababselfabpostcookieparametersmapbuilder) | aB(String value) | +| [Fakeparametercollisions1ababselfabPostCookieParametersMapBuilder](#fakeparametercollisions1ababselfabpostcookieparametersmapbuilder) | Ab(String value) | +| [Fakeparametercollisions1ababselfabPostCookieParametersMapBuilder](#fakeparametercollisions1ababselfabpostcookieparametersmapbuilder) | aHyphenMinusB(String value) | +| [Fakeparametercollisions1ababselfabPostCookieParametersMapBuilder](#fakeparametercollisions1ababselfabpostcookieparametersmapbuilder) | self(String value) | + +## Fakeparametercollisions1ababselfabPostCookieParametersMap +public static class Fakeparametercollisions1ababselfabPostCookieParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [Fakeparametercollisions1ababselfabPostCookieParametersMap](#fakeparametercollisions1ababselfabpostcookieparametersmap) | of([Map](#fakeparametercollisions1ababselfabpostcookieparametersmapbuilder) arg, SchemaConfiguration configuration) | +| String | aB()
[optional] | +| String | Ab()
[optional] | +| String | self()
[optional] | +| @Nullable Object | get(String key)
This schema has invalid Java names so this method must be used when you access instance["1"], instance["A-B"], | + +## Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed +public sealed interface Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed
+permits
+[Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedVoid](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedvoid), +[Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedBoolean](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedboolean), +[Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedNumber](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxednumber), +[Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedString](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedstring), +[Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedList](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedlist), +[Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedMap](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedVoid +public record Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedVoid
+implements [Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedBoolean +public record Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedBoolean
+implements [Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedNumber +public record Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedNumber
+implements [Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedString +public record Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedString
+implements [Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedList +public record Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedList
+implements [Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedMap +public record Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedMap
+implements [Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Fakeparametercollisions1ababselfabPostadditionalProperties +public static class Fakeparametercollisions1ababselfabPostadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostHeaderParameters.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostHeaderParameters.md new file mode 100644 index 00000000000..469ac3b89ee --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostHeaderParameters.md @@ -0,0 +1,263 @@ +# Fakeparametercollisions1ababselfabPostHeaderParameters +public class Fakeparametercollisions1ababselfabPostHeaderParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [Fakeparametercollisions1ababselfabPostHeaderParameters.Fakeparametercollisions1ababselfabPostHeaderParameters1Boxed](#fakeparametercollisions1ababselfabpostheaderparameters1boxed)
sealed interface for validated payloads | +| record | [Fakeparametercollisions1ababselfabPostHeaderParameters.Fakeparametercollisions1ababselfabPostHeaderParameters1BoxedMap](#fakeparametercollisions1ababselfabpostheaderparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [Fakeparametercollisions1ababselfabPostHeaderParameters.Fakeparametercollisions1ababselfabPostHeaderParameters1](#fakeparametercollisions1ababselfabpostheaderparameters1)
schema class | +| static class | [Fakeparametercollisions1ababselfabPostHeaderParameters.Fakeparametercollisions1ababselfabPostHeaderParametersMapBuilder](#fakeparametercollisions1ababselfabpostheaderparametersmapbuilder)
builder for Map payloads | +| static class | [Fakeparametercollisions1ababselfabPostHeaderParameters.Fakeparametercollisions1ababselfabPostHeaderParametersMap](#fakeparametercollisions1ababselfabpostheaderparametersmap)
output class for Map payloads | +| sealed interface | [Fakeparametercollisions1ababselfabPostHeaderParameters.Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [Fakeparametercollisions1ababselfabPostHeaderParameters.Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedVoid](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [Fakeparametercollisions1ababselfabPostHeaderParameters.Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedBoolean](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [Fakeparametercollisions1ababselfabPostHeaderParameters.Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedNumber](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [Fakeparametercollisions1ababselfabPostHeaderParameters.Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedString](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [Fakeparametercollisions1ababselfabPostHeaderParameters.Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedList](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [Fakeparametercollisions1ababselfabPostHeaderParameters.Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedMap](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [Fakeparametercollisions1ababselfabPostHeaderParameters.Fakeparametercollisions1ababselfabPostadditionalProperties](#fakeparametercollisions1ababselfabpostadditionalproperties)
schema class | + +## Fakeparametercollisions1ababselfabPostHeaderParameters1Boxed +public sealed interface Fakeparametercollisions1ababselfabPostHeaderParameters1Boxed
+permits
+[Fakeparametercollisions1ababselfabPostHeaderParameters1BoxedMap](#fakeparametercollisions1ababselfabpostheaderparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## Fakeparametercollisions1ababselfabPostHeaderParameters1BoxedMap +public record Fakeparametercollisions1ababselfabPostHeaderParameters1BoxedMap
+implements [Fakeparametercollisions1ababselfabPostHeaderParameters1Boxed](#fakeparametercollisions1ababselfabpostheaderparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostHeaderParameters1BoxedMap([Fakeparametercollisions1ababselfabPostHeaderParametersMap](#fakeparametercollisions1ababselfabpostheaderparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostHeaderParametersMap](#fakeparametercollisions1ababselfabpostheaderparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Fakeparametercollisions1ababselfabPostHeaderParameters1 +public static class Fakeparametercollisions1ababselfabPostHeaderParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Fakeparametercollisions1ababselfabPostHeaderParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +Fakeparametercollisions1ababselfabPostHeaderParameters.Fakeparametercollisions1ababselfabPostHeaderParametersMap validatedPayload = + Fakeparametercollisions1ababselfabPostHeaderParameters.Fakeparametercollisions1ababselfabPostHeaderParameters1.validate( + new Fakeparametercollisions1ababselfabPostHeaderParameters.Fakeparametercollisions1ababselfabPostHeaderParametersMapBuilder() + .positive1("a") + + .aB("a") + + .aHyphenMinusB("a") + + .self("a") + + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("1", [Schema5.Schema51.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter5/Schema5.md#schema51)),
    new PropertyEntry("aB", [Schema6.Schema61.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter6/Schema6.md#schema61)),
    new PropertyEntry("A-B", [Schema8.Schema81.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter8/Schema8.md#schema81)),
    new PropertyEntry("self", [Schema7.Schema71.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter7/Schema7.md#schema71))
)
| +| Class | additionalProperties = [Fakeparametercollisions1ababselfabPostadditionalProperties.class](#fakeparametercollisions1ababselfabpostadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostHeaderParametersMap](#fakeparametercollisions1ababselfabpostheaderparametersmap) | validate([Map<?, ?>](#fakeparametercollisions1ababselfabpostheaderparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [Fakeparametercollisions1ababselfabPostHeaderParameters1BoxedMap](#fakeparametercollisions1ababselfabpostheaderparameters1boxedmap) | validateAndBox([Map<?, ?>](#fakeparametercollisions1ababselfabpostheaderparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [Fakeparametercollisions1ababselfabPostHeaderParameters1Boxed](#fakeparametercollisions1ababselfabpostheaderparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## Fakeparametercollisions1ababselfabPostHeaderParametersMapBuilder +public class Fakeparametercollisions1ababselfabPostHeaderParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostHeaderParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | +| [Fakeparametercollisions1ababselfabPostHeaderParametersMapBuilder](#fakeparametercollisions1ababselfabpostheaderparametersmapbuilder) | positive1(String value) | +| [Fakeparametercollisions1ababselfabPostHeaderParametersMapBuilder](#fakeparametercollisions1ababselfabpostheaderparametersmapbuilder) | aB(String value) | +| [Fakeparametercollisions1ababselfabPostHeaderParametersMapBuilder](#fakeparametercollisions1ababselfabpostheaderparametersmapbuilder) | aHyphenMinusB(String value) | +| [Fakeparametercollisions1ababselfabPostHeaderParametersMapBuilder](#fakeparametercollisions1ababselfabpostheaderparametersmapbuilder) | self(String value) | + +## Fakeparametercollisions1ababselfabPostHeaderParametersMap +public static class Fakeparametercollisions1ababselfabPostHeaderParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [Fakeparametercollisions1ababselfabPostHeaderParametersMap](#fakeparametercollisions1ababselfabpostheaderparametersmap) | of([Map](#fakeparametercollisions1ababselfabpostheaderparametersmapbuilder) arg, SchemaConfiguration configuration) | +| String | aB()
[optional] | +| String | self()
[optional] | +| @Nullable Object | get(String key)
This schema has invalid Java names so this method must be used when you access instance["1"], instance["A-B"], | + +## Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed +public sealed interface Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed
+permits
+[Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedVoid](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedvoid), +[Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedBoolean](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedboolean), +[Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedNumber](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxednumber), +[Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedString](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedstring), +[Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedList](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedlist), +[Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedMap](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedVoid +public record Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedVoid
+implements [Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedBoolean +public record Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedBoolean
+implements [Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedNumber +public record Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedNumber
+implements [Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedString +public record Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedString
+implements [Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedList +public record Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedList
+implements [Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedMap +public record Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedMap
+implements [Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Fakeparametercollisions1ababselfabPostadditionalProperties +public static class Fakeparametercollisions1ababselfabPostadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostPathParameters.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostPathParameters.md new file mode 100644 index 00000000000..7585710f95e --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostPathParameters.md @@ -0,0 +1,808 @@ +# Fakeparametercollisions1ababselfabPostPathParameters +public class Fakeparametercollisions1ababselfabPostPathParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [Fakeparametercollisions1ababselfabPostPathParameters.Fakeparametercollisions1ababselfabPostPathParameters1Boxed](#fakeparametercollisions1ababselfabpostpathparameters1boxed)
sealed interface for validated payloads | +| record | [Fakeparametercollisions1ababselfabPostPathParameters.Fakeparametercollisions1ababselfabPostPathParameters1BoxedMap](#fakeparametercollisions1ababselfabpostpathparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [Fakeparametercollisions1ababselfabPostPathParameters.Fakeparametercollisions1ababselfabPostPathParameters1](#fakeparametercollisions1ababselfabpostpathparameters1)
schema class | +| static class | [Fakeparametercollisions1ababselfabPostPathParameters.Fakeparametercollisions1ababselfabPostPathParametersMapBuilder](#fakeparametercollisions1ababselfabpostpathparametersmapbuilder)
builder for Map payloads | +| static class | [Fakeparametercollisions1ababselfabPostPathParameters.Fakeparametercollisions1ababselfabPostPathParametersMap](#fakeparametercollisions1ababselfabpostpathparametersmap)
output class for Map payloads | +| sealed interface | [Fakeparametercollisions1ababselfabPostPathParameters.Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [Fakeparametercollisions1ababselfabPostPathParameters.Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedVoid](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [Fakeparametercollisions1ababselfabPostPathParameters.Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedBoolean](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [Fakeparametercollisions1ababselfabPostPathParameters.Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedNumber](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [Fakeparametercollisions1ababselfabPostPathParameters.Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedString](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [Fakeparametercollisions1ababselfabPostPathParameters.Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedList](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [Fakeparametercollisions1ababselfabPostPathParameters.Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedMap](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [Fakeparametercollisions1ababselfabPostPathParameters.Fakeparametercollisions1ababselfabPostadditionalProperties](#fakeparametercollisions1ababselfabpostadditionalproperties)
schema class | + +## Fakeparametercollisions1ababselfabPostPathParameters1Boxed +public sealed interface Fakeparametercollisions1ababselfabPostPathParameters1Boxed
+permits
+[Fakeparametercollisions1ababselfabPostPathParameters1BoxedMap](#fakeparametercollisions1ababselfabpostpathparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## Fakeparametercollisions1ababselfabPostPathParameters1BoxedMap +public record Fakeparametercollisions1ababselfabPostPathParameters1BoxedMap
+implements [Fakeparametercollisions1ababselfabPostPathParameters1Boxed](#fakeparametercollisions1ababselfabpostpathparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParameters1BoxedMap([Fakeparametercollisions1ababselfabPostPathParametersMap](#fakeparametercollisions1ababselfabpostpathparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap](#fakeparametercollisions1ababselfabpostpathparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Fakeparametercollisions1ababselfabPostPathParameters1 +public static class Fakeparametercollisions1ababselfabPostPathParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Fakeparametercollisions1ababselfabPostPathParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +Fakeparametercollisions1ababselfabPostPathParameters.Fakeparametercollisions1ababselfabPostPathParametersMap validatedPayload = + Fakeparametercollisions1ababselfabPostPathParameters.Fakeparametercollisions1ababselfabPostPathParameters1.validate( + new Fakeparametercollisions1ababselfabPostPathParameters.Fakeparametercollisions1ababselfabPostPathParametersMapBuilder() + .positive1("a") + + .aHyphenMinusB("a") + + .Ab("a") + + .aB("a") + + .self("a") + + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("1", [Schema9.Schema91.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter9/Schema9.md#schema91)),
    new PropertyEntry("aB", [Schema10.Schema101.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter10/Schema10.md#schema101)),
    new PropertyEntry("Ab", [Schema11.Schema111.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter11/Schema11.md#schema111)),
    new PropertyEntry("A-B", [Schema13.Schema131.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter13/Schema13.md#schema131)),
    new PropertyEntry("self", [Schema12.Schema121.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter12/Schema12.md#schema121))
)
| +| Set | required = Set.of(
    "1",
    "A-B",
    "Ab",
    "aB",
    "self"
)
| +| Class | additionalProperties = [Fakeparametercollisions1ababselfabPostadditionalProperties.class](#fakeparametercollisions1ababselfabpostadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap](#fakeparametercollisions1ababselfabpostpathparametersmap) | validate([Map<?, ?>](#fakeparametercollisions1ababselfabpostpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [Fakeparametercollisions1ababselfabPostPathParameters1BoxedMap](#fakeparametercollisions1ababselfabpostpathparameters1boxedmap) | validateAndBox([Map<?, ?>](#fakeparametercollisions1ababselfabpostpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [Fakeparametercollisions1ababselfabPostPathParameters1Boxed](#fakeparametercollisions1ababselfabpostpathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap00000Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap00000Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap00000Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | + +## Fakeparametercollisions1ababselfabPostPathParametersMap00001Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap00001Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap00001Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap00000Builder](#fakeparametercollisions1ababselfabpostpathparametersmap00000builder) | self(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap00010Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap00010Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap00010Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap00000Builder](#fakeparametercollisions1ababselfabpostpathparametersmap00000builder) | aB(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap00011Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap00011Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap00011Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap00001Builder](#fakeparametercollisions1ababselfabpostpathparametersmap00001builder) | aB(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap00010Builder](#fakeparametercollisions1ababselfabpostpathparametersmap00010builder) | self(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap00100Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap00100Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap00100Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap00000Builder](#fakeparametercollisions1ababselfabpostpathparametersmap00000builder) | Ab(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap00101Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap00101Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap00101Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap00001Builder](#fakeparametercollisions1ababselfabpostpathparametersmap00001builder) | Ab(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap00100Builder](#fakeparametercollisions1ababselfabpostpathparametersmap00100builder) | self(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap00110Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap00110Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap00110Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap00010Builder](#fakeparametercollisions1ababselfabpostpathparametersmap00010builder) | Ab(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap00100Builder](#fakeparametercollisions1ababselfabpostpathparametersmap00100builder) | aB(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap00111Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap00111Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap00111Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap00011Builder](#fakeparametercollisions1ababselfabpostpathparametersmap00011builder) | Ab(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap00101Builder](#fakeparametercollisions1ababselfabpostpathparametersmap00101builder) | aB(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap00110Builder](#fakeparametercollisions1ababselfabpostpathparametersmap00110builder) | self(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap01000Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap01000Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap01000Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap00000Builder](#fakeparametercollisions1ababselfabpostpathparametersmap00000builder) | aHyphenMinusB(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap01001Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap01001Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap01001Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap00001Builder](#fakeparametercollisions1ababselfabpostpathparametersmap00001builder) | aHyphenMinusB(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap01000Builder](#fakeparametercollisions1ababselfabpostpathparametersmap01000builder) | self(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap01010Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap01010Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap01010Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap00010Builder](#fakeparametercollisions1ababselfabpostpathparametersmap00010builder) | aHyphenMinusB(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap01000Builder](#fakeparametercollisions1ababselfabpostpathparametersmap01000builder) | aB(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap01011Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap01011Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap01011Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap00011Builder](#fakeparametercollisions1ababselfabpostpathparametersmap00011builder) | aHyphenMinusB(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap01001Builder](#fakeparametercollisions1ababselfabpostpathparametersmap01001builder) | aB(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap01010Builder](#fakeparametercollisions1ababselfabpostpathparametersmap01010builder) | self(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap01100Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap01100Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap01100Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap00100Builder](#fakeparametercollisions1ababselfabpostpathparametersmap00100builder) | aHyphenMinusB(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap01000Builder](#fakeparametercollisions1ababselfabpostpathparametersmap01000builder) | Ab(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap01101Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap01101Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap01101Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap00101Builder](#fakeparametercollisions1ababselfabpostpathparametersmap00101builder) | aHyphenMinusB(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap01001Builder](#fakeparametercollisions1ababselfabpostpathparametersmap01001builder) | Ab(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap01100Builder](#fakeparametercollisions1ababselfabpostpathparametersmap01100builder) | self(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap01110Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap01110Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap01110Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap00110Builder](#fakeparametercollisions1ababselfabpostpathparametersmap00110builder) | aHyphenMinusB(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap01010Builder](#fakeparametercollisions1ababselfabpostpathparametersmap01010builder) | Ab(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap01100Builder](#fakeparametercollisions1ababselfabpostpathparametersmap01100builder) | aB(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap01111Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap01111Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap01111Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap00111Builder](#fakeparametercollisions1ababselfabpostpathparametersmap00111builder) | aHyphenMinusB(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap01011Builder](#fakeparametercollisions1ababselfabpostpathparametersmap01011builder) | Ab(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap01101Builder](#fakeparametercollisions1ababselfabpostpathparametersmap01101builder) | aB(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap01110Builder](#fakeparametercollisions1ababselfabpostpathparametersmap01110builder) | self(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap10000Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap10000Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap10000Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap00000Builder](#fakeparametercollisions1ababselfabpostpathparametersmap00000builder) | positive1(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap10001Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap10001Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap10001Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap00001Builder](#fakeparametercollisions1ababselfabpostpathparametersmap00001builder) | positive1(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap10000Builder](#fakeparametercollisions1ababselfabpostpathparametersmap10000builder) | self(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap10010Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap10010Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap10010Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap00010Builder](#fakeparametercollisions1ababselfabpostpathparametersmap00010builder) | positive1(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap10000Builder](#fakeparametercollisions1ababselfabpostpathparametersmap10000builder) | aB(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap10011Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap10011Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap10011Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap00011Builder](#fakeparametercollisions1ababselfabpostpathparametersmap00011builder) | positive1(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap10001Builder](#fakeparametercollisions1ababselfabpostpathparametersmap10001builder) | aB(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap10010Builder](#fakeparametercollisions1ababselfabpostpathparametersmap10010builder) | self(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap10100Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap10100Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap10100Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap00100Builder](#fakeparametercollisions1ababselfabpostpathparametersmap00100builder) | positive1(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap10000Builder](#fakeparametercollisions1ababselfabpostpathparametersmap10000builder) | Ab(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap10101Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap10101Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap10101Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap00101Builder](#fakeparametercollisions1ababselfabpostpathparametersmap00101builder) | positive1(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap10001Builder](#fakeparametercollisions1ababselfabpostpathparametersmap10001builder) | Ab(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap10100Builder](#fakeparametercollisions1ababselfabpostpathparametersmap10100builder) | self(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap10110Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap10110Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap10110Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap00110Builder](#fakeparametercollisions1ababselfabpostpathparametersmap00110builder) | positive1(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap10010Builder](#fakeparametercollisions1ababselfabpostpathparametersmap10010builder) | Ab(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap10100Builder](#fakeparametercollisions1ababselfabpostpathparametersmap10100builder) | aB(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap10111Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap10111Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap10111Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap00111Builder](#fakeparametercollisions1ababselfabpostpathparametersmap00111builder) | positive1(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap10011Builder](#fakeparametercollisions1ababselfabpostpathparametersmap10011builder) | Ab(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap10101Builder](#fakeparametercollisions1ababselfabpostpathparametersmap10101builder) | aB(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap10110Builder](#fakeparametercollisions1ababselfabpostpathparametersmap10110builder) | self(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap11000Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap11000Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap11000Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap01000Builder](#fakeparametercollisions1ababselfabpostpathparametersmap01000builder) | positive1(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap10000Builder](#fakeparametercollisions1ababselfabpostpathparametersmap10000builder) | aHyphenMinusB(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap11001Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap11001Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap11001Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap01001Builder](#fakeparametercollisions1ababselfabpostpathparametersmap01001builder) | positive1(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap10001Builder](#fakeparametercollisions1ababselfabpostpathparametersmap10001builder) | aHyphenMinusB(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap11000Builder](#fakeparametercollisions1ababselfabpostpathparametersmap11000builder) | self(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap11010Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap11010Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap11010Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap01010Builder](#fakeparametercollisions1ababselfabpostpathparametersmap01010builder) | positive1(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap10010Builder](#fakeparametercollisions1ababselfabpostpathparametersmap10010builder) | aHyphenMinusB(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap11000Builder](#fakeparametercollisions1ababselfabpostpathparametersmap11000builder) | aB(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap11011Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap11011Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap11011Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap01011Builder](#fakeparametercollisions1ababselfabpostpathparametersmap01011builder) | positive1(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap10011Builder](#fakeparametercollisions1ababselfabpostpathparametersmap10011builder) | aHyphenMinusB(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap11001Builder](#fakeparametercollisions1ababselfabpostpathparametersmap11001builder) | aB(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap11010Builder](#fakeparametercollisions1ababselfabpostpathparametersmap11010builder) | self(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap11100Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap11100Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap11100Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap01100Builder](#fakeparametercollisions1ababselfabpostpathparametersmap01100builder) | positive1(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap10100Builder](#fakeparametercollisions1ababselfabpostpathparametersmap10100builder) | aHyphenMinusB(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap11000Builder](#fakeparametercollisions1ababselfabpostpathparametersmap11000builder) | Ab(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap11101Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap11101Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap11101Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap01101Builder](#fakeparametercollisions1ababselfabpostpathparametersmap01101builder) | positive1(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap10101Builder](#fakeparametercollisions1ababselfabpostpathparametersmap10101builder) | aHyphenMinusB(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap11001Builder](#fakeparametercollisions1ababselfabpostpathparametersmap11001builder) | Ab(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap11100Builder](#fakeparametercollisions1ababselfabpostpathparametersmap11100builder) | self(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap11110Builder +public class Fakeparametercollisions1ababselfabPostPathParametersMap11110Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMap11110Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap01110Builder](#fakeparametercollisions1ababselfabpostpathparametersmap01110builder) | positive1(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap10110Builder](#fakeparametercollisions1ababselfabpostpathparametersmap10110builder) | aHyphenMinusB(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap11010Builder](#fakeparametercollisions1ababselfabpostpathparametersmap11010builder) | Ab(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap11100Builder](#fakeparametercollisions1ababselfabpostpathparametersmap11100builder) | aB(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMapBuilder +public class Fakeparametercollisions1ababselfabPostPathParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostPathParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostPathParametersMap01111Builder](#fakeparametercollisions1ababselfabpostpathparametersmap01111builder) | positive1(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap10111Builder](#fakeparametercollisions1ababselfabpostpathparametersmap10111builder) | aHyphenMinusB(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap11011Builder](#fakeparametercollisions1ababselfabpostpathparametersmap11011builder) | Ab(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap11101Builder](#fakeparametercollisions1ababselfabpostpathparametersmap11101builder) | aB(String value) | +| [Fakeparametercollisions1ababselfabPostPathParametersMap11110Builder](#fakeparametercollisions1ababselfabpostpathparametersmap11110builder) | self(String value) | + +## Fakeparametercollisions1ababselfabPostPathParametersMap +public static class Fakeparametercollisions1ababselfabPostPathParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [Fakeparametercollisions1ababselfabPostPathParametersMap](#fakeparametercollisions1ababselfabpostpathparametersmap) | of([Map](#fakeparametercollisions1ababselfabpostpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| String | Ab()
| +| String | aB()
| +| String | self()
| +| @Nullable Object | get(String key)
This schema has invalid Java names so this method must be used when you access instance["1"], instance["A-B"], | + +## Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed +public sealed interface Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed
+permits
+[Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedVoid](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedvoid), +[Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedBoolean](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedboolean), +[Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedNumber](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxednumber), +[Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedString](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedstring), +[Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedList](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedlist), +[Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedMap](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedVoid +public record Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedVoid
+implements [Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedBoolean +public record Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedBoolean
+implements [Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedNumber +public record Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedNumber
+implements [Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedString +public record Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedString
+implements [Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedList +public record Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedList
+implements [Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedMap +public record Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedMap
+implements [Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Fakeparametercollisions1ababselfabPostadditionalProperties +public static class Fakeparametercollisions1ababselfabPostadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostQueryParameters.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostQueryParameters.md new file mode 100644 index 00000000000..e791e7eae15 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostQueryParameters.md @@ -0,0 +1,267 @@ +# Fakeparametercollisions1ababselfabPostQueryParameters +public class Fakeparametercollisions1ababselfabPostQueryParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [Fakeparametercollisions1ababselfabPostQueryParameters.Fakeparametercollisions1ababselfabPostQueryParameters1Boxed](#fakeparametercollisions1ababselfabpostqueryparameters1boxed)
sealed interface for validated payloads | +| record | [Fakeparametercollisions1ababselfabPostQueryParameters.Fakeparametercollisions1ababselfabPostQueryParameters1BoxedMap](#fakeparametercollisions1ababselfabpostqueryparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [Fakeparametercollisions1ababselfabPostQueryParameters.Fakeparametercollisions1ababselfabPostQueryParameters1](#fakeparametercollisions1ababselfabpostqueryparameters1)
schema class | +| static class | [Fakeparametercollisions1ababselfabPostQueryParameters.Fakeparametercollisions1ababselfabPostQueryParametersMapBuilder](#fakeparametercollisions1ababselfabpostqueryparametersmapbuilder)
builder for Map payloads | +| static class | [Fakeparametercollisions1ababselfabPostQueryParameters.Fakeparametercollisions1ababselfabPostQueryParametersMap](#fakeparametercollisions1ababselfabpostqueryparametersmap)
output class for Map payloads | +| sealed interface | [Fakeparametercollisions1ababselfabPostQueryParameters.Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [Fakeparametercollisions1ababselfabPostQueryParameters.Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedVoid](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [Fakeparametercollisions1ababselfabPostQueryParameters.Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedBoolean](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [Fakeparametercollisions1ababselfabPostQueryParameters.Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedNumber](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [Fakeparametercollisions1ababselfabPostQueryParameters.Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedString](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [Fakeparametercollisions1ababselfabPostQueryParameters.Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedList](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [Fakeparametercollisions1ababselfabPostQueryParameters.Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedMap](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [Fakeparametercollisions1ababselfabPostQueryParameters.Fakeparametercollisions1ababselfabPostadditionalProperties](#fakeparametercollisions1ababselfabpostadditionalproperties)
schema class | + +## Fakeparametercollisions1ababselfabPostQueryParameters1Boxed +public sealed interface Fakeparametercollisions1ababselfabPostQueryParameters1Boxed
+permits
+[Fakeparametercollisions1ababselfabPostQueryParameters1BoxedMap](#fakeparametercollisions1ababselfabpostqueryparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## Fakeparametercollisions1ababselfabPostQueryParameters1BoxedMap +public record Fakeparametercollisions1ababselfabPostQueryParameters1BoxedMap
+implements [Fakeparametercollisions1ababselfabPostQueryParameters1Boxed](#fakeparametercollisions1ababselfabpostqueryparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostQueryParameters1BoxedMap([Fakeparametercollisions1ababselfabPostQueryParametersMap](#fakeparametercollisions1ababselfabpostqueryparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostQueryParametersMap](#fakeparametercollisions1ababselfabpostqueryparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Fakeparametercollisions1ababselfabPostQueryParameters1 +public static class Fakeparametercollisions1ababselfabPostQueryParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Fakeparametercollisions1ababselfabPostQueryParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +Fakeparametercollisions1ababselfabPostQueryParameters.Fakeparametercollisions1ababselfabPostQueryParametersMap validatedPayload = + Fakeparametercollisions1ababselfabPostQueryParameters.Fakeparametercollisions1ababselfabPostQueryParameters1.validate( + new Fakeparametercollisions1ababselfabPostQueryParameters.Fakeparametercollisions1ababselfabPostQueryParametersMapBuilder() + .positive1("a") + + .aB("a") + + .Ab("a") + + .aHyphenMinusB("a") + + .self("a") + + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("1", [Schema0.Schema01.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter0/Schema0.md#schema01)),
    new PropertyEntry("aB", [Schema1.Schema11.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter1/Schema1.md#schema11)),
    new PropertyEntry("Ab", [Schema2.Schema21.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter2/Schema2.md#schema21)),
    new PropertyEntry("A-B", [Schema4.Schema41.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter4/Schema4.md#schema41)),
    new PropertyEntry("self", [Schema3.Schema31.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter3/Schema3.md#schema31))
)
| +| Class | additionalProperties = [Fakeparametercollisions1ababselfabPostadditionalProperties.class](#fakeparametercollisions1ababselfabpostadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Fakeparametercollisions1ababselfabPostQueryParametersMap](#fakeparametercollisions1ababselfabpostqueryparametersmap) | validate([Map<?, ?>](#fakeparametercollisions1ababselfabpostqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [Fakeparametercollisions1ababselfabPostQueryParameters1BoxedMap](#fakeparametercollisions1ababselfabpostqueryparameters1boxedmap) | validateAndBox([Map<?, ?>](#fakeparametercollisions1ababselfabpostqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [Fakeparametercollisions1ababselfabPostQueryParameters1Boxed](#fakeparametercollisions1ababselfabpostqueryparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## Fakeparametercollisions1ababselfabPostQueryParametersMapBuilder +public class Fakeparametercollisions1ababselfabPostQueryParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostQueryParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | +| [Fakeparametercollisions1ababselfabPostQueryParametersMapBuilder](#fakeparametercollisions1ababselfabpostqueryparametersmapbuilder) | positive1(String value) | +| [Fakeparametercollisions1ababselfabPostQueryParametersMapBuilder](#fakeparametercollisions1ababselfabpostqueryparametersmapbuilder) | aB(String value) | +| [Fakeparametercollisions1ababselfabPostQueryParametersMapBuilder](#fakeparametercollisions1ababselfabpostqueryparametersmapbuilder) | Ab(String value) | +| [Fakeparametercollisions1ababselfabPostQueryParametersMapBuilder](#fakeparametercollisions1ababselfabpostqueryparametersmapbuilder) | aHyphenMinusB(String value) | +| [Fakeparametercollisions1ababselfabPostQueryParametersMapBuilder](#fakeparametercollisions1ababselfabpostqueryparametersmapbuilder) | self(String value) | + +## Fakeparametercollisions1ababselfabPostQueryParametersMap +public static class Fakeparametercollisions1ababselfabPostQueryParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [Fakeparametercollisions1ababselfabPostQueryParametersMap](#fakeparametercollisions1ababselfabpostqueryparametersmap) | of([Map](#fakeparametercollisions1ababselfabpostqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| String | aB()
[optional] | +| String | Ab()
[optional] | +| String | self()
[optional] | +| @Nullable Object | get(String key)
This schema has invalid Java names so this method must be used when you access instance["1"], instance["A-B"], | + +## Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed +public sealed interface Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed
+permits
+[Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedVoid](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedvoid), +[Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedBoolean](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedboolean), +[Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedNumber](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxednumber), +[Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedString](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedstring), +[Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedList](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedlist), +[Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedMap](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedVoid +public record Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedVoid
+implements [Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedBoolean +public record Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedBoolean
+implements [Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedNumber +public record Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedNumber
+implements [Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedString +public record Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedString
+implements [Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedList +public record Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedList
+implements [Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedMap +public record Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedMap
+implements [Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxed](#fakeparametercollisions1ababselfabpostadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## Fakeparametercollisions1ababselfabPostadditionalProperties +public static class Fakeparametercollisions1ababselfabPostadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostRequestBody.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostRequestBody.md new file mode 100644 index 00000000000..a1386452447 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostRequestBody.md @@ -0,0 +1,90 @@ +# Fakeparametercollisions1ababselfabPostRequestBody + +public class Fakeparametercollisions1ababselfabPostRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [Fakeparametercollisions1ababselfabPostRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [Fakeparametercollisions1ababselfabPostRequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| static class | [Fakeparametercollisions1ababselfabPostRequestBody.Fakeparametercollisions1ababselfabPostRequestBody1](#fakeparametercollisions1ababselfabpostrequestbody1)
class that serializes request bodies | +| sealed interface | [Fakeparametercollisions1ababselfabPostRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [Fakeparametercollisions1ababselfabPostRequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakeparametercollisions1ababselfab/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakeparametercollisions1ababselfab/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## Fakeparametercollisions1ababselfabPostRequestBody1 +public static class Fakeparametercollisions1ababselfabPostRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = false
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[ApplicationjsonRequestBody](#applicationjsonrequestbody) + +sealed interface that stores request contentType + validated schema data + +## ApplicationjsonRequestBody +public record ApplicationjsonRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonRequestBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "application/json" | +| ApplicationjsonSchema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostResponses.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostResponses.md new file mode 100644 index 00000000000..950f7cf471d --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostResponses.md @@ -0,0 +1,29 @@ +# Fakeparametercollisions1ababselfabPostResponses + +public class Fakeparametercollisions1ababselfabPostResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakeparametercollisions1ababselfabPostCode200Response](#endpointfakeparametercollisions1ababselfabpostcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakeparametercollisions1ababselfabPostCode200Response](#endpointfakeparametercollisions1ababselfabpostcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakeparametercollisions1ababselfabPostCode200Response +public record EndpointFakeparametercollisions1ababselfabPostCode200Response( + HttpResponse response, + [Fakeparametercollisions1ababselfabPostCode200Response.SealedResponseBody](../../../paths/fakeparametercollisions1ababselfab/post/responses/Fakeparametercollisions1ababselfabPostCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/HeaderParameters.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/HeaderParameters.md deleted file mode 100644 index 2a5dbe5fed5..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/HeaderParameters.md +++ /dev/null @@ -1,263 +0,0 @@ -# HeaderParameters -public class HeaderParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [HeaderParameters.HeaderParameters1Boxed](#headerparameters1boxed)
sealed interface for validated payloads | -| record | [HeaderParameters.HeaderParameters1BoxedMap](#headerparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [HeaderParameters.HeaderParameters1](#headerparameters1)
schema class | -| static class | [HeaderParameters.HeaderParametersMapBuilder](#headerparametersmapbuilder)
builder for Map payloads | -| static class | [HeaderParameters.HeaderParametersMap](#headerparametersmap)
output class for Map payloads | -| sealed interface | [HeaderParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [HeaderParameters.AdditionalProperties](#additionalproperties)
schema class | - -## HeaderParameters1Boxed -public sealed interface HeaderParameters1Boxed
-permits
-[HeaderParameters1BoxedMap](#headerparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## HeaderParameters1BoxedMap -public record HeaderParameters1BoxedMap
-implements [HeaderParameters1Boxed](#headerparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| HeaderParameters1BoxedMap([HeaderParametersMap](#headerparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [HeaderParametersMap](#headerparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## HeaderParameters1 -public static class HeaderParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.HeaderParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -HeaderParameters.HeaderParametersMap validatedPayload = - HeaderParameters.HeaderParameters1.validate( - new HeaderParameters.HeaderParametersMapBuilder() - .positive1("a") - - .aB("a") - - .aHyphenMinusB("a") - - .self("a") - - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("1", [Schema5.Schema51.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter5/Schema5.md#schema51)),
    new PropertyEntry("aB", [Schema6.Schema61.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter6/Schema6.md#schema61)),
    new PropertyEntry("A-B", [Schema8.Schema81.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter8/Schema8.md#schema81)),
    new PropertyEntry("self", [Schema7.Schema71.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter7/Schema7.md#schema71))
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [HeaderParametersMap](#headerparametersmap) | validate([Map<?, ?>](#headerparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [HeaderParameters1BoxedMap](#headerparameters1boxedmap) | validateAndBox([Map<?, ?>](#headerparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [HeaderParameters1Boxed](#headerparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## HeaderParametersMapBuilder -public class HeaderParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| HeaderParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | -| [HeaderParametersMapBuilder](#headerparametersmapbuilder) | positive1(String value) | -| [HeaderParametersMapBuilder](#headerparametersmapbuilder) | aB(String value) | -| [HeaderParametersMapBuilder](#headerparametersmapbuilder) | aHyphenMinusB(String value) | -| [HeaderParametersMapBuilder](#headerparametersmapbuilder) | self(String value) | - -## HeaderParametersMap -public static class HeaderParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [HeaderParametersMap](#headerparametersmap) | of([Map](#headerparametersmapbuilder) arg, SchemaConfiguration configuration) | -| String | aB()
[optional] | -| String | self()
[optional] | -| @Nullable Object | get(String key)
This schema has invalid Java names so this method must be used when you access instance["1"], instance["A-B"], | - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/PathParameters.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/PathParameters.md deleted file mode 100644 index 0a3a341c225..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/PathParameters.md +++ /dev/null @@ -1,808 +0,0 @@ -# PathParameters -public class PathParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [PathParameters.PathParameters1Boxed](#pathparameters1boxed)
sealed interface for validated payloads | -| record | [PathParameters.PathParameters1BoxedMap](#pathparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.PathParameters1](#pathparameters1)
schema class | -| static class | [PathParameters.PathParametersMapBuilder](#pathparametersmapbuilder)
builder for Map payloads | -| static class | [PathParameters.PathParametersMap](#pathparametersmap)
output class for Map payloads | -| sealed interface | [PathParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [PathParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [PathParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [PathParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [PathParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [PathParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [PathParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.AdditionalProperties](#additionalproperties)
schema class | - -## PathParameters1Boxed -public sealed interface PathParameters1Boxed
-permits
-[PathParameters1BoxedMap](#pathparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## PathParameters1BoxedMap -public record PathParameters1BoxedMap
-implements [PathParameters1Boxed](#pathparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParameters1BoxedMap([PathParametersMap](#pathparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## PathParameters1 -public static class PathParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.PathParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -PathParameters.PathParametersMap validatedPayload = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .positive1("a") - - .aHyphenMinusB("a") - - .Ab("a") - - .aB("a") - - .self("a") - - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("1", [Schema9.Schema91.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter9/Schema9.md#schema91)),
    new PropertyEntry("aB", [Schema10.Schema101.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter10/Schema10.md#schema101)),
    new PropertyEntry("Ab", [Schema11.Schema111.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter11/Schema11.md#schema111)),
    new PropertyEntry("A-B", [Schema13.Schema131.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter13/Schema13.md#schema131)),
    new PropertyEntry("self", [Schema12.Schema121.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter12/Schema12.md#schema121))
)
| -| Set | required = Set.of(
    "1",
    "A-B",
    "Ab",
    "aB",
    "self"
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | validate([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1BoxedMap](#pathparameters1boxedmap) | validateAndBox([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1Boxed](#pathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## PathParametersMap00000Builder -public class PathParametersMap00000Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap00000Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | - -## PathParametersMap00001Builder -public class PathParametersMap00001Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap00001Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap00000Builder](#pathparametersmap00000builder) | self(String value) | - -## PathParametersMap00010Builder -public class PathParametersMap00010Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap00010Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap00000Builder](#pathparametersmap00000builder) | aB(String value) | - -## PathParametersMap00011Builder -public class PathParametersMap00011Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap00011Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap00001Builder](#pathparametersmap00001builder) | aB(String value) | -| [PathParametersMap00010Builder](#pathparametersmap00010builder) | self(String value) | - -## PathParametersMap00100Builder -public class PathParametersMap00100Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap00100Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap00000Builder](#pathparametersmap00000builder) | Ab(String value) | - -## PathParametersMap00101Builder -public class PathParametersMap00101Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap00101Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap00001Builder](#pathparametersmap00001builder) | Ab(String value) | -| [PathParametersMap00100Builder](#pathparametersmap00100builder) | self(String value) | - -## PathParametersMap00110Builder -public class PathParametersMap00110Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap00110Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap00010Builder](#pathparametersmap00010builder) | Ab(String value) | -| [PathParametersMap00100Builder](#pathparametersmap00100builder) | aB(String value) | - -## PathParametersMap00111Builder -public class PathParametersMap00111Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap00111Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap00011Builder](#pathparametersmap00011builder) | Ab(String value) | -| [PathParametersMap00101Builder](#pathparametersmap00101builder) | aB(String value) | -| [PathParametersMap00110Builder](#pathparametersmap00110builder) | self(String value) | - -## PathParametersMap01000Builder -public class PathParametersMap01000Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap01000Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap00000Builder](#pathparametersmap00000builder) | aHyphenMinusB(String value) | - -## PathParametersMap01001Builder -public class PathParametersMap01001Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap01001Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap00001Builder](#pathparametersmap00001builder) | aHyphenMinusB(String value) | -| [PathParametersMap01000Builder](#pathparametersmap01000builder) | self(String value) | - -## PathParametersMap01010Builder -public class PathParametersMap01010Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap01010Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap00010Builder](#pathparametersmap00010builder) | aHyphenMinusB(String value) | -| [PathParametersMap01000Builder](#pathparametersmap01000builder) | aB(String value) | - -## PathParametersMap01011Builder -public class PathParametersMap01011Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap01011Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap00011Builder](#pathparametersmap00011builder) | aHyphenMinusB(String value) | -| [PathParametersMap01001Builder](#pathparametersmap01001builder) | aB(String value) | -| [PathParametersMap01010Builder](#pathparametersmap01010builder) | self(String value) | - -## PathParametersMap01100Builder -public class PathParametersMap01100Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap01100Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap00100Builder](#pathparametersmap00100builder) | aHyphenMinusB(String value) | -| [PathParametersMap01000Builder](#pathparametersmap01000builder) | Ab(String value) | - -## PathParametersMap01101Builder -public class PathParametersMap01101Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap01101Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap00101Builder](#pathparametersmap00101builder) | aHyphenMinusB(String value) | -| [PathParametersMap01001Builder](#pathparametersmap01001builder) | Ab(String value) | -| [PathParametersMap01100Builder](#pathparametersmap01100builder) | self(String value) | - -## PathParametersMap01110Builder -public class PathParametersMap01110Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap01110Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap00110Builder](#pathparametersmap00110builder) | aHyphenMinusB(String value) | -| [PathParametersMap01010Builder](#pathparametersmap01010builder) | Ab(String value) | -| [PathParametersMap01100Builder](#pathparametersmap01100builder) | aB(String value) | - -## PathParametersMap01111Builder -public class PathParametersMap01111Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap01111Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap00111Builder](#pathparametersmap00111builder) | aHyphenMinusB(String value) | -| [PathParametersMap01011Builder](#pathparametersmap01011builder) | Ab(String value) | -| [PathParametersMap01101Builder](#pathparametersmap01101builder) | aB(String value) | -| [PathParametersMap01110Builder](#pathparametersmap01110builder) | self(String value) | - -## PathParametersMap10000Builder -public class PathParametersMap10000Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap10000Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap00000Builder](#pathparametersmap00000builder) | positive1(String value) | - -## PathParametersMap10001Builder -public class PathParametersMap10001Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap10001Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap00001Builder](#pathparametersmap00001builder) | positive1(String value) | -| [PathParametersMap10000Builder](#pathparametersmap10000builder) | self(String value) | - -## PathParametersMap10010Builder -public class PathParametersMap10010Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap10010Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap00010Builder](#pathparametersmap00010builder) | positive1(String value) | -| [PathParametersMap10000Builder](#pathparametersmap10000builder) | aB(String value) | - -## PathParametersMap10011Builder -public class PathParametersMap10011Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap10011Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap00011Builder](#pathparametersmap00011builder) | positive1(String value) | -| [PathParametersMap10001Builder](#pathparametersmap10001builder) | aB(String value) | -| [PathParametersMap10010Builder](#pathparametersmap10010builder) | self(String value) | - -## PathParametersMap10100Builder -public class PathParametersMap10100Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap10100Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap00100Builder](#pathparametersmap00100builder) | positive1(String value) | -| [PathParametersMap10000Builder](#pathparametersmap10000builder) | Ab(String value) | - -## PathParametersMap10101Builder -public class PathParametersMap10101Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap10101Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap00101Builder](#pathparametersmap00101builder) | positive1(String value) | -| [PathParametersMap10001Builder](#pathparametersmap10001builder) | Ab(String value) | -| [PathParametersMap10100Builder](#pathparametersmap10100builder) | self(String value) | - -## PathParametersMap10110Builder -public class PathParametersMap10110Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap10110Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap00110Builder](#pathparametersmap00110builder) | positive1(String value) | -| [PathParametersMap10010Builder](#pathparametersmap10010builder) | Ab(String value) | -| [PathParametersMap10100Builder](#pathparametersmap10100builder) | aB(String value) | - -## PathParametersMap10111Builder -public class PathParametersMap10111Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap10111Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap00111Builder](#pathparametersmap00111builder) | positive1(String value) | -| [PathParametersMap10011Builder](#pathparametersmap10011builder) | Ab(String value) | -| [PathParametersMap10101Builder](#pathparametersmap10101builder) | aB(String value) | -| [PathParametersMap10110Builder](#pathparametersmap10110builder) | self(String value) | - -## PathParametersMap11000Builder -public class PathParametersMap11000Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap11000Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap01000Builder](#pathparametersmap01000builder) | positive1(String value) | -| [PathParametersMap10000Builder](#pathparametersmap10000builder) | aHyphenMinusB(String value) | - -## PathParametersMap11001Builder -public class PathParametersMap11001Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap11001Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap01001Builder](#pathparametersmap01001builder) | positive1(String value) | -| [PathParametersMap10001Builder](#pathparametersmap10001builder) | aHyphenMinusB(String value) | -| [PathParametersMap11000Builder](#pathparametersmap11000builder) | self(String value) | - -## PathParametersMap11010Builder -public class PathParametersMap11010Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap11010Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap01010Builder](#pathparametersmap01010builder) | positive1(String value) | -| [PathParametersMap10010Builder](#pathparametersmap10010builder) | aHyphenMinusB(String value) | -| [PathParametersMap11000Builder](#pathparametersmap11000builder) | aB(String value) | - -## PathParametersMap11011Builder -public class PathParametersMap11011Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap11011Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap01011Builder](#pathparametersmap01011builder) | positive1(String value) | -| [PathParametersMap10011Builder](#pathparametersmap10011builder) | aHyphenMinusB(String value) | -| [PathParametersMap11001Builder](#pathparametersmap11001builder) | aB(String value) | -| [PathParametersMap11010Builder](#pathparametersmap11010builder) | self(String value) | - -## PathParametersMap11100Builder -public class PathParametersMap11100Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap11100Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap01100Builder](#pathparametersmap01100builder) | positive1(String value) | -| [PathParametersMap10100Builder](#pathparametersmap10100builder) | aHyphenMinusB(String value) | -| [PathParametersMap11000Builder](#pathparametersmap11000builder) | Ab(String value) | - -## PathParametersMap11101Builder -public class PathParametersMap11101Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap11101Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap01101Builder](#pathparametersmap01101builder) | positive1(String value) | -| [PathParametersMap10101Builder](#pathparametersmap10101builder) | aHyphenMinusB(String value) | -| [PathParametersMap11001Builder](#pathparametersmap11001builder) | Ab(String value) | -| [PathParametersMap11100Builder](#pathparametersmap11100builder) | self(String value) | - -## PathParametersMap11110Builder -public class PathParametersMap11110Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap11110Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap01110Builder](#pathparametersmap01110builder) | positive1(String value) | -| [PathParametersMap10110Builder](#pathparametersmap10110builder) | aHyphenMinusB(String value) | -| [PathParametersMap11010Builder](#pathparametersmap11010builder) | Ab(String value) | -| [PathParametersMap11100Builder](#pathparametersmap11100builder) | aB(String value) | - -## PathParametersMapBuilder -public class PathParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap01111Builder](#pathparametersmap01111builder) | positive1(String value) | -| [PathParametersMap10111Builder](#pathparametersmap10111builder) | aHyphenMinusB(String value) | -| [PathParametersMap11011Builder](#pathparametersmap11011builder) | Ab(String value) | -| [PathParametersMap11101Builder](#pathparametersmap11101builder) | aB(String value) | -| [PathParametersMap11110Builder](#pathparametersmap11110builder) | self(String value) | - -## PathParametersMap -public static class PathParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [PathParametersMap](#pathparametersmap) | of([Map](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| String | Ab()
| -| String | aB()
| -| String | self()
| -| @Nullable Object | get(String key)
This schema has invalid Java names so this method must be used when you access instance["1"], instance["A-B"], | - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/QueryParameters.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/QueryParameters.md deleted file mode 100644 index a4c08e40129..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/QueryParameters.md +++ /dev/null @@ -1,267 +0,0 @@ -# QueryParameters -public class QueryParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [QueryParameters.QueryParameters1Boxed](#queryparameters1boxed)
sealed interface for validated payloads | -| record | [QueryParameters.QueryParameters1BoxedMap](#queryparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [QueryParameters.QueryParameters1](#queryparameters1)
schema class | -| static class | [QueryParameters.QueryParametersMapBuilder](#queryparametersmapbuilder)
builder for Map payloads | -| static class | [QueryParameters.QueryParametersMap](#queryparametersmap)
output class for Map payloads | -| sealed interface | [QueryParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [QueryParameters.AdditionalProperties](#additionalproperties)
schema class | - -## QueryParameters1Boxed -public sealed interface QueryParameters1Boxed
-permits
-[QueryParameters1BoxedMap](#queryparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## QueryParameters1BoxedMap -public record QueryParameters1BoxedMap
-implements [QueryParameters1Boxed](#queryparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParameters1BoxedMap([QueryParametersMap](#queryparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap](#queryparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## QueryParameters1 -public static class QueryParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.QueryParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -QueryParameters.QueryParametersMap validatedPayload = - QueryParameters.QueryParameters1.validate( - new QueryParameters.QueryParametersMapBuilder() - .positive1("a") - - .aB("a") - - .Ab("a") - - .aHyphenMinusB("a") - - .self("a") - - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("1", [Schema0.Schema01.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter0/Schema0.md#schema01)),
    new PropertyEntry("aB", [Schema1.Schema11.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter1/Schema1.md#schema11)),
    new PropertyEntry("Ab", [Schema2.Schema21.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter2/Schema2.md#schema21)),
    new PropertyEntry("A-B", [Schema4.Schema41.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter4/Schema4.md#schema41)),
    new PropertyEntry("self", [Schema3.Schema31.class](../../../paths/fakeparametercollisions1ababselfab/post/parameters/parameter3/Schema3.md#schema31))
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap](#queryparametersmap) | validate([Map<?, ?>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [QueryParameters1BoxedMap](#queryparameters1boxedmap) | validateAndBox([Map<?, ?>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [QueryParameters1Boxed](#queryparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## QueryParametersMapBuilder -public class QueryParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | positive1(String value) | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | aB(String value) | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | Ab(String value) | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | aHyphenMinusB(String value) | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | self(String value) | - -## QueryParametersMap -public static class QueryParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [QueryParametersMap](#queryparametersmap) | of([Map](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| String | aB()
[optional] | -| String | Ab()
[optional] | -| String | self()
[optional] | -| @Nullable Object | get(String key)
This schema has invalid Java names so this method must be used when you access instance["1"], instance["A-B"], | - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/RequestBody.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/RequestBody.md deleted file mode 100644 index ad5c1348c48..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/RequestBody.md +++ /dev/null @@ -1,90 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakeparametercollisions1ababselfab/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakeparametercollisions1ababselfab/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = false
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[ApplicationjsonRequestBody](#applicationjsonrequestbody) - -sealed interface that stores request contentType + validated schema data - -## ApplicationjsonRequestBody -public record ApplicationjsonRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonRequestBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "application/json" | -| ApplicationjsonSchema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/Responses.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/Responses.md deleted file mode 100644 index 42ff2be8930..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/fakeparametercollisions1ababselfab/post/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/responses/Code200Response.md deleted file mode 100644 index 5a3dd5fda7e..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/responses/Code200Response.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakeparametercollisions1ababselfab/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakeparametercollisions1ababselfab/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/responses/Fakeparametercollisions1ababselfabPostCode200Response.md b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/responses/Fakeparametercollisions1ababselfabPostCode200Response.md new file mode 100644 index 00000000000..2080fb2adb3 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeparametercollisions1ababselfab/post/responses/Fakeparametercollisions1ababselfabPostCode200Response.md @@ -0,0 +1,87 @@ +# Fakeparametercollisions1ababselfabPostCode200Response + +public class Fakeparametercollisions1ababselfabPostCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [Fakeparametercollisions1ababselfabPostCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [Fakeparametercollisions1ababselfabPostCode200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [Fakeparametercollisions1ababselfabPostCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [Fakeparametercollisions1ababselfabPostCode200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [Fakeparametercollisions1ababselfabPostCode200Response.Fakeparametercollisions1ababselfabPostCode200Response1](#fakeparametercollisions1ababselfabpostcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakeparametercollisions1ababselfab/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakeparametercollisions1ababselfab/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | + +## Fakeparametercollisions1ababselfabPostCode200Response1 +public static class Fakeparametercollisions1ababselfabPostCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Fakeparametercollisions1ababselfabPostCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakepemcontenttype/FakepemcontenttypeGet.md b/samples/client/petstore/java/docs/paths/fakepemcontenttype/FakepemcontenttypeGet.md new file mode 100644 index 00000000000..a052361bc1f --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakepemcontenttype/FakepemcontenttypeGet.md @@ -0,0 +1,145 @@ +# FakepemcontenttypeGet + +public class FakepemcontenttypeGet + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Get](#get)
The class that has a get method to call the endpoint | +| interface | [PemContentTypeOperation](#pemcontenttypeoperation)
The interface that has a pemContentType method to call the endpoint | +| static class | [GetRequest](#getrequest)
The request inputs class | +| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | + +## Get +public static class Get extends ApiClient.ApiClient1 implements GetOperation
+ +a class that allows one to call the endpoint using a method named get + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakepemcontenttype.get.FakepemcontenttypeGetRequestBody; +import org.openapijsonschematools.client.paths.fakepemcontenttype.get.requestbody.content.applicationxpemfile.ApplicationxpemfileSchema; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakepemcontenttype.get.responses.FakepemcontenttypeGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakepemcontenttype.FakepemcontenttypeGet; +import org.openapijsonschematools.client.paths.fakepemcontenttype.get.FakepemcontenttypeGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakepemcontenttypeGet.Get apiClient = new FakepemcontenttypeGet.Get(apiConfiguration, schemaConfiguration); + + +var request = new FakepemcontenttypeGet.GetRequestBuilder().build(); + +FakepemcontenttypeGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakepemcontenttypeGetResponses.EndpointFakepemcontenttypeGetCode200Response castResponse = (FakepemcontenttypeGetResponses.EndpointFakepemcontenttypeGetCode200Response) response; +FakepemcontenttypeGetCode200Response.ApplicationxpemfileResponseBody deserializedBody = (FakepemcontenttypeGetCode200Response.ApplicationxpemfileResponseBody) castResponse.body; +// handle deserialized body here +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakepemcontenttypeGetResponses.EndpointResponse](../../paths/fakepemcontenttype/get/FakepemcontenttypeGetResponses.md#endpointresponse) | get([GetRequest](#getrequest) request) | + +## PemContentTypeOperation +public interface PemContentTypeOperation
+ +an interface that allows one to call the endpoint using a method named pemContentType by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakepemcontenttypeGetResponses.EndpointResponse](../../paths/fakepemcontenttype/get/FakepemcontenttypeGetResponses.md#endpointresponse) | pemContentType([GetRequest](#getrequest) request) | + +## GetRequest +public static class GetRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakepemcontenttypeGetRequestBody.@Nullable SealedRequestBody](../../paths/fakepemcontenttype/get/FakepemcontenttypeGetRequestBody.md#sealedrequestbody) | requestBody
optional | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## GetRequestBuilder +public static class GetRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| GetRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | +| [GetRequestBuilder](#getrequestbuilder) | requestBody([FakepemcontenttypeGetRequestBody.SealedRequestBody](../../paths/fakepemcontenttype/get/FakepemcontenttypeGetRequestBody.md#sealedrequestbody) requestBody)
sets the optional property | +| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakepemcontenttype/Get.md b/samples/client/petstore/java/docs/paths/fakepemcontenttype/Get.md deleted file mode 100644 index c355850ea3b..00000000000 --- a/samples/client/petstore/java/docs/paths/fakepemcontenttype/Get.md +++ /dev/null @@ -1,134 +0,0 @@ -# Get - -public class Get - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Get1](#get1)
The class that has a get method to call the endpoint | -| static class | [GetRequest](#getrequest)
The request inputs class | -| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | - -## Get1 -public static class Get1 extends ApiClient.ApiClient1 implements GetOperation
- -a class that allows one to call the endpoint using a method named get - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakepemcontenttype.get.RequestBody; -import org.openapijsonschematools.client.paths.fakepemcontenttype.get.requestbody.content.applicationxpemfile.ApplicationxpemfileSchema; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakepemcontenttype.get.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakepemcontenttype.Get; -import org.openapijsonschematools.client.paths.fakepemcontenttype.get.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Get.Get1 apiClient = new Get.Get1(apiConfiguration, schemaConfiguration); - - -var request = new GetRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.get(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -Code200Response.ApplicationxpemfileResponseBody deserializedBody = (Code200Response.ApplicationxpemfileResponseBody) castResponse.body; -// handle deserialized body here -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakepemcontenttype/get/Responses.md#endpointresponse) | get([GetRequest](#getrequest) request) | - -## GetRequest -public static class GetRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fakepemcontenttype/get/RequestBody.md#sealedrequestbody) | requestBody
optional | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## GetRequestBuilder -public static class GetRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| GetRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | -| [GetRequestBuilder](#getrequestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/fakepemcontenttype/get/RequestBody.md#sealedrequestbody) requestBody)
sets the optional property | -| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakepemcontenttype/get/FakepemcontenttypeGetRequestBody.md b/samples/client/petstore/java/docs/paths/fakepemcontenttype/get/FakepemcontenttypeGetRequestBody.md new file mode 100644 index 00000000000..4601113bc84 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakepemcontenttype/get/FakepemcontenttypeGetRequestBody.md @@ -0,0 +1,90 @@ +# FakepemcontenttypeGetRequestBody + +public class FakepemcontenttypeGetRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakepemcontenttypeGetRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakepemcontenttypeGetRequestBody.ApplicationxpemfileMediaType](#applicationxpemfilemediatype)
record storing schema + encoding for a specific contentType | +| static class | [FakepemcontenttypeGetRequestBody.FakepemcontenttypeGetRequestBody1](#fakepemcontenttypegetrequestbody1)
class that serializes request bodies | +| sealed interface | [FakepemcontenttypeGetRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [FakepemcontenttypeGetRequestBody.ApplicationxpemfileRequestBody](#applicationxpemfilerequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationxpemfileMediaType](#applicationxpemfilemediatype) + +sealed interface that stores schema and encoding info + + +## ApplicationxpemfileMediaType +public record ApplicationxpemfileMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationxpemfileSchema.ApplicationxpemfileSchema1](../../../paths/fakepemcontenttype/get/requestbody/content/applicationxpemfile/ApplicationxpemfileSchema.md#applicationxpemfileschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationxpemfileMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationxpemfileSchema.ApplicationxpemfileSchema1](../../../paths/fakepemcontenttype/get/requestbody/content/applicationxpemfile/ApplicationxpemfileSchema.md#applicationxpemfileschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## FakepemcontenttypeGetRequestBody1 +public static class FakepemcontenttypeGetRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakepemcontenttypeGetRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = false
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/x-pem-file", new [ApplicationxpemfileMediaType](#applicationxpemfilemediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[ApplicationxpemfileRequestBody](#applicationxpemfilerequestbody) + +sealed interface that stores request contentType + validated schema data + +## ApplicationxpemfileRequestBody +public record ApplicationxpemfileRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="application/x-pem-file" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationxpemfileRequestBody(ApplicationxpemfileSchema.StringJsonSchema1Boxed body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "application/x-pem-file" | +| ApplicationxpemfileSchema.StringJsonSchema1Boxed | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakepemcontenttype/get/FakepemcontenttypeGetResponses.md b/samples/client/petstore/java/docs/paths/fakepemcontenttype/get/FakepemcontenttypeGetResponses.md new file mode 100644 index 00000000000..50c4184e734 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakepemcontenttype/get/FakepemcontenttypeGetResponses.md @@ -0,0 +1,29 @@ +# FakepemcontenttypeGetResponses + +public class FakepemcontenttypeGetResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakepemcontenttypeGetCode200Response](#endpointfakepemcontenttypegetcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakepemcontenttypeGetCode200Response](#endpointfakepemcontenttypegetcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakepemcontenttypeGetCode200Response +public record EndpointFakepemcontenttypeGetCode200Response( + HttpResponse response, + [FakepemcontenttypeGetCode200Response.SealedResponseBody](../../../paths/fakepemcontenttype/get/responses/FakepemcontenttypeGetCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakepemcontenttype/get/RequestBody.md b/samples/client/petstore/java/docs/paths/fakepemcontenttype/get/RequestBody.md deleted file mode 100644 index b15697012da..00000000000 --- a/samples/client/petstore/java/docs/paths/fakepemcontenttype/get/RequestBody.md +++ /dev/null @@ -1,90 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.ApplicationxpemfileMediaType](#applicationxpemfilemediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.ApplicationxpemfileRequestBody](#applicationxpemfilerequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationxpemfileMediaType](#applicationxpemfilemediatype) - -sealed interface that stores schema and encoding info - - -## ApplicationxpemfileMediaType -public record ApplicationxpemfileMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationxpemfileSchema.ApplicationxpemfileSchema1](../../../paths/fakepemcontenttype/get/requestbody/content/applicationxpemfile/ApplicationxpemfileSchema.md#applicationxpemfileschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationxpemfileMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationxpemfileSchema.ApplicationxpemfileSchema1](../../../paths/fakepemcontenttype/get/requestbody/content/applicationxpemfile/ApplicationxpemfileSchema.md#applicationxpemfileschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = false
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/x-pem-file", new [ApplicationxpemfileMediaType](#applicationxpemfilemediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[ApplicationxpemfileRequestBody](#applicationxpemfilerequestbody) - -sealed interface that stores request contentType + validated schema data - -## ApplicationxpemfileRequestBody -public record ApplicationxpemfileRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="application/x-pem-file" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationxpemfileRequestBody(ApplicationxpemfileSchema.StringJsonSchema1Boxed body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "application/x-pem-file" | -| ApplicationxpemfileSchema.StringJsonSchema1Boxed | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakepemcontenttype/get/Responses.md b/samples/client/petstore/java/docs/paths/fakepemcontenttype/get/Responses.md deleted file mode 100644 index a30940e0b0e..00000000000 --- a/samples/client/petstore/java/docs/paths/fakepemcontenttype/get/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/fakepemcontenttype/get/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakepemcontenttype/get/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakepemcontenttype/get/responses/Code200Response.md deleted file mode 100644 index cf48dd70fcb..00000000000 --- a/samples/client/petstore/java/docs/paths/fakepemcontenttype/get/responses/Code200Response.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationxpemfileMediaType](#applicationxpemfilemediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationxpemfileResponseBody](#applicationxpemfileresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationxpemfileMediaType](#applicationxpemfilemediatype) - -sealed interface that stores schema and encoding info - -## ApplicationxpemfileMediaType -public record ApplicationxpemfileMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationxpemfileSchema.ApplicationxpemfileSchema1](../../../../paths/fakepemcontenttype/get/responses/code200response/content/applicationxpemfile/ApplicationxpemfileSchema.md#applicationxpemfileschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationxpemfileMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationxpemfileSchema.ApplicationxpemfileSchema1](../../../../paths/fakepemcontenttype/get/responses/code200response/content/applicationxpemfile/ApplicationxpemfileSchema.md#applicationxpemfileschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationxpemfileResponseBody](#applicationxpemfileresponsebody) - -sealed interface that stores response body - -## ApplicationxpemfileResponseBody -public record ApplicationxpemfileResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/x-pem-file" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationxpemfileResponseBody(ApplicationxpemfileSchema.StringJsonSchema1Boxed body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationxpemfileSchema.StringJsonSchema1Boxed | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/x-pem-file", new [ApplicationxpemfileMediaType](#applicationxpemfilemediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakepemcontenttype/get/responses/FakepemcontenttypeGetCode200Response.md b/samples/client/petstore/java/docs/paths/fakepemcontenttype/get/responses/FakepemcontenttypeGetCode200Response.md new file mode 100644 index 00000000000..f89129a2374 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakepemcontenttype/get/responses/FakepemcontenttypeGetCode200Response.md @@ -0,0 +1,87 @@ +# FakepemcontenttypeGetCode200Response + +public class FakepemcontenttypeGetCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakepemcontenttypeGetCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakepemcontenttypeGetCode200Response.ApplicationxpemfileMediaType](#applicationxpemfilemediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakepemcontenttypeGetCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakepemcontenttypeGetCode200Response.ApplicationxpemfileResponseBody](#applicationxpemfileresponsebody)
implements sealed interface to store response body | +| static class | [FakepemcontenttypeGetCode200Response.FakepemcontenttypeGetCode200Response1](#fakepemcontenttypegetcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationxpemfileMediaType](#applicationxpemfilemediatype) + +sealed interface that stores schema and encoding info + +## ApplicationxpemfileMediaType +public record ApplicationxpemfileMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationxpemfileSchema.ApplicationxpemfileSchema1](../../../../paths/fakepemcontenttype/get/responses/code200response/content/applicationxpemfile/ApplicationxpemfileSchema.md#applicationxpemfileschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationxpemfileMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationxpemfileSchema.ApplicationxpemfileSchema1](../../../../paths/fakepemcontenttype/get/responses/code200response/content/applicationxpemfile/ApplicationxpemfileSchema.md#applicationxpemfileschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationxpemfileResponseBody](#applicationxpemfileresponsebody) + +sealed interface that stores response body + +## ApplicationxpemfileResponseBody +public record ApplicationxpemfileResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/x-pem-file" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationxpemfileResponseBody(ApplicationxpemfileSchema.StringJsonSchema1Boxed body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationxpemfileSchema.StringJsonSchema1Boxed | body()
returns the body passed in in the constructor | + +## FakepemcontenttypeGetCode200Response1 +public static class FakepemcontenttypeGetCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakepemcontenttypeGetCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/x-pem-file", new [ApplicationxpemfileMediaType](#applicationxpemfilemediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/FakepetiduploadimagewithrequiredfilePost.md b/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/FakepetiduploadimagewithrequiredfilePost.md new file mode 100644 index 00000000000..606fee4ae21 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/FakepetiduploadimagewithrequiredfilePost.md @@ -0,0 +1,200 @@ +# FakepetiduploadimagewithrequiredfilePost + +public class FakepetiduploadimagewithrequiredfilePost + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Post](#post)
The class that has a post method to call the endpoint | +| interface | [UploadFileWithRequiredFileOperation](#uploadfilewithrequiredfileoperation)
The interface that has a uploadFileWithRequiredFile method to call the endpoint | +| static class | [PostRequest](#postrequest)
The final request inputs class | +| static class | [PostNullableRequest](#postnullablerequest)
The initial request inputs class | +| static class | [Post0RequestBuilder](#post0requestbuilder)
A builder for the request input class | +| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | + +## Post +public static class Post extends ApiClient.ApiClient1 implements PostOperation
+ +a class that allows one to call the endpoint using a method named post + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.FakepetiduploadimagewithrequiredfilePostRequestBody; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.FakepetiduploadimagewithrequiredfilePostSecurityInfo; +import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.FakepetiduploadimagewithrequiredfilePostPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; +import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.responses.FakepetiduploadimagewithrequiredfilePostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.FakepetiduploadimagewithrequiredfilePost; +import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.FakepetiduploadimagewithrequiredfilePostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .fakepetiduploadimagewithrequiredfilePostSecurityRequirementObject0SecurityIndex(FakepetiduploadimagewithrequiredfilePostSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakepetiduploadimagewithrequiredfilePost.Post apiClient = new FakepetiduploadimagewithrequiredfilePost.Post(apiConfiguration, schemaConfiguration); + + +// Map validation +FakepetiduploadimagewithrequiredfilePostPathParameters.FakepetiduploadimagewithrequiredfilePostPathParametersMap pathParameters = + FakepetiduploadimagewithrequiredfilePostPathParameters.FakepetiduploadimagewithrequiredfilePostPathParameters1.validate( + new FakepetiduploadimagewithrequiredfilePostPathParameters.FakepetiduploadimagewithrequiredfilePostPathParametersMapBuilder() + .petId(1L) + + .build(), + schemaConfiguration +); + +var request = new FakepetiduploadimagewithrequiredfilePost.PostRequestBuilder() + .pathParameters(pathParameters) + .build(); + +FakepetiduploadimagewithrequiredfilePostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakepetiduploadimagewithrequiredfilePostResponses.EndpointFakepetiduploadimagewithrequiredfilePostCode200Response castResponse = (FakepetiduploadimagewithrequiredfilePostResponses.EndpointFakepetiduploadimagewithrequiredfilePostCode200Response) response; +FakepetiduploadimagewithrequiredfilePostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakepetiduploadimagewithrequiredfilePostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakepetiduploadimagewithrequiredfilePostResponses.EndpointResponse](../../paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostResponses.md#endpointresponse) | post([PostRequest](#postrequest) request) | + +## UploadFileWithRequiredFileOperation +public interface UploadFileWithRequiredFileOperation
+ +an interface that allows one to call the endpoint using a method named uploadFileWithRequiredFile by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakepetiduploadimagewithrequiredfilePostResponses.EndpointResponse](../../paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostResponses.md#endpointresponse) | uploadFileWithRequiredFile([PostRequest](#postrequest) request) | + +## PostRequest +public static class PostRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakepetiduploadimagewithrequiredfilePostPathParameters.FakepetiduploadimagewithrequiredfilePostPathParametersMap](../../paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostPathParameters.md#fakepetiduploadimagewithrequiredfilepostpathparametersmap) | pathParameters | +| [FakepetiduploadimagewithrequiredfilePostRequestBody.@Nullable SealedRequestBody](../../paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostRequestBody.md#sealedrequestbody) | requestBody
optional | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| [FakepetiduploadimagewithrequiredfilePostSecurityInfo.@Nullable SecurityIndex](../../paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostSecurityInfo.md#securityindex) | securityIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PostNullableRequest +public static class PostNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakepetiduploadimagewithrequiredfilePostPathParameters.@Nullable FakepetiduploadimagewithrequiredfilePostPathParametersMap](../../paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostPathParameters.md#fakepetiduploadimagewithrequiredfilepostpathparametersmap) | pathParameters | +| [FakepetiduploadimagewithrequiredfilePostRequestBody.@Nullable SealedRequestBody](../../paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostRequestBody.md#sealedrequestbody) | requestBody | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| [FakepetiduploadimagewithrequiredfilePostSecurityInfo.@Nullable SecurityIndex](../../paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostSecurityInfo.md#securityindex) | securityIndex | +| @Nullable Duration | timeout | + +## Post0RequestBuilder +public static class Post0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post0RequestBuilder(Post0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | +| [Post0RequestBuilder](#post0requestbuilder) | requestBody([FakepetiduploadimagewithrequiredfilePostRequestBody.SealedRequestBody](../../paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostRequestBody.md#sealedrequestbody) requestBody)
sets the optional property | +| [Post0RequestBuilder](#post0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Post0RequestBuilder](#post0requestbuilder) | securityIndex([FakepetiduploadimagewithrequiredfilePostSecurityInfo.SecurityIndex](../../paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostSecurityInfo.md#securityindex) securityIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Post0RequestBuilder](#post0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## PostRequestBuilder +public static class PostRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PostRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Post0RequestBuilder](#post0requestbuilder) | pathParameters([FakepetiduploadimagewithrequiredfilePostPathParametersFakepetiduploadimagewithrequiredfilePostPathParametersMap](../../paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostPathParameters.md#fakepetiduploadimagewithrequiredfilepostpathparametersmap) pathParameters)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/Post.md b/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/Post.md deleted file mode 100644 index c1236de9529..00000000000 --- a/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/Post.md +++ /dev/null @@ -1,189 +0,0 @@ -# Post - -public class Post - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Post1](#post1)
The class that has a post method to call the endpoint | -| static class | [PostRequest](#postrequest)
The final request inputs class | -| static class | [PostNullableRequest](#postnullablerequest)
The initial request inputs class | -| static class | [Post0RequestBuilder](#post0requestbuilder)
A builder for the request input class | -| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | - -## Post1 -public static class Post1 extends ApiClient.ApiClient1 implements PostOperation
- -a class that allows one to call the endpoint using a method named post - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.RequestBody; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.FakepetiduploadimagewithrequiredfilePostSecurityInfo; -import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.PathParameters; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.securityschemes.SecurityScheme; -import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; -import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.Post; -import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -List securitySchemes = new ArrayList(); -ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() - .fakepetiduploadimagewithrequiredfilePostSecurityRequirementObject0SecurityIndex(FakepetiduploadimagewithrequiredfilePostSecurityRequirementObject0.SecurityIndex.SECURITY_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - securitySchemes, - securityIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Post.Post1 apiClient = new Post.Post1(apiConfiguration, schemaConfiguration); - - -// Map validation -PathParameters.PathParametersMap pathParameters = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .petId(1L) - - .build(), - schemaConfiguration -); - -var request = new PostRequestBuilder() - .pathParameters(pathParameters) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.post(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -Code200Response.ApplicationjsonResponseBody deserializedBody = (Code200Response.ApplicationjsonResponseBody) castResponse.body; -// handle deserialized body here -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakepetiduploadimagewithrequiredfile/post/Responses.md#endpointresponse) | post([PostRequest](#postrequest) request) | - -## PostRequest -public static class PostRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [PathParameters.PathParametersMap](../../paths/fakepetiduploadimagewithrequiredfile/post/PathParameters.md#pathparametersmap) | pathParameters | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fakepetiduploadimagewithrequiredfile/post/RequestBody.md#sealedrequestbody) | requestBody
optional | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| [FakepetiduploadimagewithrequiredfilePostSecurityInfo.@Nullable SecurityIndex](../../paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostSecurityInfo.md#securityindex) | securityIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PostNullableRequest -public static class PostNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [PathParameters.@Nullable PathParametersMap](../../paths/fakepetiduploadimagewithrequiredfile/post/PathParameters.md#pathparametersmap) | pathParameters | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fakepetiduploadimagewithrequiredfile/post/RequestBody.md#sealedrequestbody) | requestBody | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| [FakepetiduploadimagewithrequiredfilePostSecurityInfo.@Nullable SecurityIndex](../../paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostSecurityInfo.md#securityindex) | securityIndex | -| @Nullable Duration | timeout | - -## Post0RequestBuilder -public static class Post0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post0RequestBuilder(Post0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | -| [Post0RequestBuilder](#post0requestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/fakepetiduploadimagewithrequiredfile/post/RequestBody.md#sealedrequestbody) requestBody)
sets the optional property | -| [Post0RequestBuilder](#post0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Post0RequestBuilder](#post0requestbuilder) | securityIndex([FakepetiduploadimagewithrequiredfilePostSecurityInfo.SecurityIndex](../../paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostSecurityInfo.md#securityindex) securityIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Post0RequestBuilder](#post0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## PostRequestBuilder -public static class PostRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PostRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Post0RequestBuilder](#post0requestbuilder) | pathParameters([PathParametersPathParametersMap](../../paths/fakepetiduploadimagewithrequiredfile/post/PathParameters.md#pathparametersmap) pathParameters)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostPathParameters.md b/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostPathParameters.md new file mode 100644 index 00000000000..d22af4b6f75 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostPathParameters.md @@ -0,0 +1,271 @@ +# FakepetiduploadimagewithrequiredfilePostPathParameters +public class FakepetiduploadimagewithrequiredfilePostPathParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [FakepetiduploadimagewithrequiredfilePostPathParameters.FakepetiduploadimagewithrequiredfilePostPathParameters1Boxed](#fakepetiduploadimagewithrequiredfilepostpathparameters1boxed)
sealed interface for validated payloads | +| record | [FakepetiduploadimagewithrequiredfilePostPathParameters.FakepetiduploadimagewithrequiredfilePostPathParameters1BoxedMap](#fakepetiduploadimagewithrequiredfilepostpathparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [FakepetiduploadimagewithrequiredfilePostPathParameters.FakepetiduploadimagewithrequiredfilePostPathParameters1](#fakepetiduploadimagewithrequiredfilepostpathparameters1)
schema class | +| static class | [FakepetiduploadimagewithrequiredfilePostPathParameters.FakepetiduploadimagewithrequiredfilePostPathParametersMapBuilder](#fakepetiduploadimagewithrequiredfilepostpathparametersmapbuilder)
builder for Map payloads | +| static class | [FakepetiduploadimagewithrequiredfilePostPathParameters.FakepetiduploadimagewithrequiredfilePostPathParametersMap](#fakepetiduploadimagewithrequiredfilepostpathparametersmap)
output class for Map payloads | +| sealed interface | [FakepetiduploadimagewithrequiredfilePostPathParameters.FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxed](#fakepetiduploadimagewithrequiredfilepostadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [FakepetiduploadimagewithrequiredfilePostPathParameters.FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedVoid](#fakepetiduploadimagewithrequiredfilepostadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [FakepetiduploadimagewithrequiredfilePostPathParameters.FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedBoolean](#fakepetiduploadimagewithrequiredfilepostadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [FakepetiduploadimagewithrequiredfilePostPathParameters.FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedNumber](#fakepetiduploadimagewithrequiredfilepostadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [FakepetiduploadimagewithrequiredfilePostPathParameters.FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedString](#fakepetiduploadimagewithrequiredfilepostadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [FakepetiduploadimagewithrequiredfilePostPathParameters.FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedList](#fakepetiduploadimagewithrequiredfilepostadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [FakepetiduploadimagewithrequiredfilePostPathParameters.FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedMap](#fakepetiduploadimagewithrequiredfilepostadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [FakepetiduploadimagewithrequiredfilePostPathParameters.FakepetiduploadimagewithrequiredfilePostadditionalProperties](#fakepetiduploadimagewithrequiredfilepostadditionalproperties)
schema class | + +## FakepetiduploadimagewithrequiredfilePostPathParameters1Boxed +public sealed interface FakepetiduploadimagewithrequiredfilePostPathParameters1Boxed
+permits
+[FakepetiduploadimagewithrequiredfilePostPathParameters1BoxedMap](#fakepetiduploadimagewithrequiredfilepostpathparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## FakepetiduploadimagewithrequiredfilePostPathParameters1BoxedMap +public record FakepetiduploadimagewithrequiredfilePostPathParameters1BoxedMap
+implements [FakepetiduploadimagewithrequiredfilePostPathParameters1Boxed](#fakepetiduploadimagewithrequiredfilepostpathparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakepetiduploadimagewithrequiredfilePostPathParameters1BoxedMap([FakepetiduploadimagewithrequiredfilePostPathParametersMap](#fakepetiduploadimagewithrequiredfilepostpathparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakepetiduploadimagewithrequiredfilePostPathParametersMap](#fakepetiduploadimagewithrequiredfilepostpathparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakepetiduploadimagewithrequiredfilePostPathParameters1 +public static class FakepetiduploadimagewithrequiredfilePostPathParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.FakepetiduploadimagewithrequiredfilePostPathParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +FakepetiduploadimagewithrequiredfilePostPathParameters.FakepetiduploadimagewithrequiredfilePostPathParametersMap validatedPayload = + FakepetiduploadimagewithrequiredfilePostPathParameters.FakepetiduploadimagewithrequiredfilePostPathParameters1.validate( + new FakepetiduploadimagewithrequiredfilePostPathParameters.FakepetiduploadimagewithrequiredfilePostPathParametersMapBuilder() + .petId(1L) + + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("petId", [Schema0.Schema01.class](../../../paths/fakepetiduploadimagewithrequiredfile/post/parameters/parameter0/Schema0.md#schema01))
)
| +| Set | required = Set.of(
    "petId"
)
| +| Class | additionalProperties = [FakepetiduploadimagewithrequiredfilePostadditionalProperties.class](#fakepetiduploadimagewithrequiredfilepostadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakepetiduploadimagewithrequiredfilePostPathParametersMap](#fakepetiduploadimagewithrequiredfilepostpathparametersmap) | validate([Map<?, ?>](#fakepetiduploadimagewithrequiredfilepostpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [FakepetiduploadimagewithrequiredfilePostPathParameters1BoxedMap](#fakepetiduploadimagewithrequiredfilepostpathparameters1boxedmap) | validateAndBox([Map<?, ?>](#fakepetiduploadimagewithrequiredfilepostpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [FakepetiduploadimagewithrequiredfilePostPathParameters1Boxed](#fakepetiduploadimagewithrequiredfilepostpathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## FakepetiduploadimagewithrequiredfilePostPathParametersMap0Builder +public class FakepetiduploadimagewithrequiredfilePostPathParametersMap0Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakepetiduploadimagewithrequiredfilePostPathParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | + +## FakepetiduploadimagewithrequiredfilePostPathParametersMapBuilder +public class FakepetiduploadimagewithrequiredfilePostPathParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakepetiduploadimagewithrequiredfilePostPathParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakepetiduploadimagewithrequiredfilePostPathParametersMap0Builder](#fakepetiduploadimagewithrequiredfilepostpathparametersmap0builder) | petId(int value) | +| [FakepetiduploadimagewithrequiredfilePostPathParametersMap0Builder](#fakepetiduploadimagewithrequiredfilepostpathparametersmap0builder) | petId(float value) | +| [FakepetiduploadimagewithrequiredfilePostPathParametersMap0Builder](#fakepetiduploadimagewithrequiredfilepostpathparametersmap0builder) | petId(long value) | +| [FakepetiduploadimagewithrequiredfilePostPathParametersMap0Builder](#fakepetiduploadimagewithrequiredfilepostpathparametersmap0builder) | petId(double value) | + +## FakepetiduploadimagewithrequiredfilePostPathParametersMap +public static class FakepetiduploadimagewithrequiredfilePostPathParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [FakepetiduploadimagewithrequiredfilePostPathParametersMap](#fakepetiduploadimagewithrequiredfilepostpathparametersmap) | of([Map](#fakepetiduploadimagewithrequiredfilepostpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| Number | petId()
| + +## FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxed +public sealed interface FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxed
+permits
+[FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedVoid](#fakepetiduploadimagewithrequiredfilepostadditionalpropertiesboxedvoid), +[FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedBoolean](#fakepetiduploadimagewithrequiredfilepostadditionalpropertiesboxedboolean), +[FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedNumber](#fakepetiduploadimagewithrequiredfilepostadditionalpropertiesboxednumber), +[FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedString](#fakepetiduploadimagewithrequiredfilepostadditionalpropertiesboxedstring), +[FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedList](#fakepetiduploadimagewithrequiredfilepostadditionalpropertiesboxedlist), +[FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedMap](#fakepetiduploadimagewithrequiredfilepostadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedVoid +public record FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedVoid
+implements [FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxed](#fakepetiduploadimagewithrequiredfilepostadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedBoolean +public record FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedBoolean
+implements [FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxed](#fakepetiduploadimagewithrequiredfilepostadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedNumber +public record FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedNumber
+implements [FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxed](#fakepetiduploadimagewithrequiredfilepostadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedString +public record FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedString
+implements [FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxed](#fakepetiduploadimagewithrequiredfilepostadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedList +public record FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedList
+implements [FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxed](#fakepetiduploadimagewithrequiredfilepostadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedMap +public record FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedMap
+implements [FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxed](#fakepetiduploadimagewithrequiredfilepostadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakepetiduploadimagewithrequiredfilePostadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakepetiduploadimagewithrequiredfilePostadditionalProperties +public static class FakepetiduploadimagewithrequiredfilePostadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostRequestBody.md b/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostRequestBody.md new file mode 100644 index 00000000000..1bb49435994 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostRequestBody.md @@ -0,0 +1,90 @@ +# FakepetiduploadimagewithrequiredfilePostRequestBody + +public class FakepetiduploadimagewithrequiredfilePostRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakepetiduploadimagewithrequiredfilePostRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakepetiduploadimagewithrequiredfilePostRequestBody.MultipartformdataMediaType](#multipartformdatamediatype)
record storing schema + encoding for a specific contentType | +| static class | [FakepetiduploadimagewithrequiredfilePostRequestBody.FakepetiduploadimagewithrequiredfilePostRequestBody1](#fakepetiduploadimagewithrequiredfilepostrequestbody1)
class that serializes request bodies | +| sealed interface | [FakepetiduploadimagewithrequiredfilePostRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [FakepetiduploadimagewithrequiredfilePostRequestBody.MultipartformdataRequestBody](#multipartformdatarequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[MultipartformdataMediaType](#multipartformdatamediatype) + +sealed interface that stores schema and encoding info + + +## MultipartformdataMediaType +public record MultipartformdataMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[MultipartformdataSchema.MultipartformdataSchema1](../../../paths/fakepetiduploadimagewithrequiredfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| MultipartformdataMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [MultipartformdataSchema.MultipartformdataSchema1](../../../paths/fakepetiduploadimagewithrequiredfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## FakepetiduploadimagewithrequiredfilePostRequestBody1 +public static class FakepetiduploadimagewithrequiredfilePostRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakepetiduploadimagewithrequiredfilePostRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = false
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("multipart/form-data", new [MultipartformdataMediaType](#multipartformdatamediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[MultipartformdataRequestBody](#multipartformdatarequestbody) + +sealed interface that stores request contentType + validated schema data + +## MultipartformdataRequestBody +public record MultipartformdataRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="multipart/form-data" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| MultipartformdataRequestBody(MultipartformdataSchema.[MultipartformdataSchema1Boxed](../../../paths/fakepetiduploadimagewithrequiredfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "multipart/form-data" | +| MultipartformdataSchema.[MultipartformdataSchema1Boxed](../../../paths/fakepetiduploadimagewithrequiredfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostResponses.md b/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostResponses.md new file mode 100644 index 00000000000..4c28cb1368a --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostResponses.md @@ -0,0 +1,29 @@ +# FakepetiduploadimagewithrequiredfilePostResponses + +public class FakepetiduploadimagewithrequiredfilePostResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakepetiduploadimagewithrequiredfilePostCode200Response](#endpointfakepetiduploadimagewithrequiredfilepostcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakepetiduploadimagewithrequiredfilePostCode200Response](#endpointfakepetiduploadimagewithrequiredfilepostcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakepetiduploadimagewithrequiredfilePostCode200Response +public record EndpointFakepetiduploadimagewithrequiredfilePostCode200Response( + HttpResponse response, + [FakepetiduploadimagewithrequiredfilePostCode200Response.SealedResponseBody](../../../paths/fakepetiduploadimagewithrequiredfile/post/responses/FakepetiduploadimagewithrequiredfilePostCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/PathParameters.md b/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/PathParameters.md deleted file mode 100644 index fc76860f3f1..00000000000 --- a/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/PathParameters.md +++ /dev/null @@ -1,271 +0,0 @@ -# PathParameters -public class PathParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [PathParameters.PathParameters1Boxed](#pathparameters1boxed)
sealed interface for validated payloads | -| record | [PathParameters.PathParameters1BoxedMap](#pathparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.PathParameters1](#pathparameters1)
schema class | -| static class | [PathParameters.PathParametersMapBuilder](#pathparametersmapbuilder)
builder for Map payloads | -| static class | [PathParameters.PathParametersMap](#pathparametersmap)
output class for Map payloads | -| sealed interface | [PathParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [PathParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [PathParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [PathParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [PathParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [PathParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [PathParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.AdditionalProperties](#additionalproperties)
schema class | - -## PathParameters1Boxed -public sealed interface PathParameters1Boxed
-permits
-[PathParameters1BoxedMap](#pathparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## PathParameters1BoxedMap -public record PathParameters1BoxedMap
-implements [PathParameters1Boxed](#pathparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParameters1BoxedMap([PathParametersMap](#pathparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## PathParameters1 -public static class PathParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.PathParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -PathParameters.PathParametersMap validatedPayload = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .petId(1L) - - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("petId", [Schema0.Schema01.class](../../../paths/fakepetiduploadimagewithrequiredfile/post/parameters/parameter0/Schema0.md#schema01))
)
| -| Set | required = Set.of(
    "petId"
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | validate([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1BoxedMap](#pathparameters1boxedmap) | validateAndBox([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1Boxed](#pathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## PathParametersMap0Builder -public class PathParametersMap0Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | - -## PathParametersMapBuilder -public class PathParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap0Builder](#pathparametersmap0builder) | petId(int value) | -| [PathParametersMap0Builder](#pathparametersmap0builder) | petId(float value) | -| [PathParametersMap0Builder](#pathparametersmap0builder) | petId(long value) | -| [PathParametersMap0Builder](#pathparametersmap0builder) | petId(double value) | - -## PathParametersMap -public static class PathParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [PathParametersMap](#pathparametersmap) | of([Map](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| Number | petId()
| - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/RequestBody.md b/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/RequestBody.md deleted file mode 100644 index dfcea020fdb..00000000000 --- a/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/RequestBody.md +++ /dev/null @@ -1,90 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.MultipartformdataMediaType](#multipartformdatamediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.MultipartformdataRequestBody](#multipartformdatarequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[MultipartformdataMediaType](#multipartformdatamediatype) - -sealed interface that stores schema and encoding info - - -## MultipartformdataMediaType -public record MultipartformdataMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[MultipartformdataSchema.MultipartformdataSchema1](../../../paths/fakepetiduploadimagewithrequiredfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| MultipartformdataMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [MultipartformdataSchema.MultipartformdataSchema1](../../../paths/fakepetiduploadimagewithrequiredfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = false
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("multipart/form-data", new [MultipartformdataMediaType](#multipartformdatamediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[MultipartformdataRequestBody](#multipartformdatarequestbody) - -sealed interface that stores request contentType + validated schema data - -## MultipartformdataRequestBody -public record MultipartformdataRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="multipart/form-data" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| MultipartformdataRequestBody(MultipartformdataSchema.[MultipartformdataSchema1Boxed](../../../paths/fakepetiduploadimagewithrequiredfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "multipart/form-data" | -| MultipartformdataSchema.[MultipartformdataSchema1Boxed](../../../paths/fakepetiduploadimagewithrequiredfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/Responses.md b/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/Responses.md deleted file mode 100644 index 8628fab9749..00000000000 --- a/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/fakepetiduploadimagewithrequiredfile/post/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/responses/Code200Response.md deleted file mode 100644 index fcae996d354..00000000000 --- a/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/responses/Code200Response.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakepetiduploadimagewithrequiredfile/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakepetiduploadimagewithrequiredfile/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.[ApiResponseSchema1Boxed](../../../../components/schemas/ApiResponseSchema.md#apiresponseschema1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.[ApiResponseSchema1Boxed](../../../../components/schemas/ApiResponseSchema.md#apiresponseschema1boxed) | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/responses/FakepetiduploadimagewithrequiredfilePostCode200Response.md b/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/responses/FakepetiduploadimagewithrequiredfilePostCode200Response.md new file mode 100644 index 00000000000..fecda0a9b1d --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakepetiduploadimagewithrequiredfile/post/responses/FakepetiduploadimagewithrequiredfilePostCode200Response.md @@ -0,0 +1,87 @@ +# FakepetiduploadimagewithrequiredfilePostCode200Response + +public class FakepetiduploadimagewithrequiredfilePostCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakepetiduploadimagewithrequiredfilePostCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakepetiduploadimagewithrequiredfilePostCode200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakepetiduploadimagewithrequiredfilePostCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakepetiduploadimagewithrequiredfilePostCode200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [FakepetiduploadimagewithrequiredfilePostCode200Response.FakepetiduploadimagewithrequiredfilePostCode200Response1](#fakepetiduploadimagewithrequiredfilepostcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakepetiduploadimagewithrequiredfile/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakepetiduploadimagewithrequiredfile/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.[ApiResponseSchema1Boxed](../../../../components/schemas/ApiResponseSchema.md#apiresponseschema1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.[ApiResponseSchema1Boxed](../../../../components/schemas/ApiResponseSchema.md#apiresponseschema1boxed) | body()
returns the body passed in in the constructor | + +## FakepetiduploadimagewithrequiredfilePostCode200Response1 +public static class FakepetiduploadimagewithrequiredfilePostCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakepetiduploadimagewithrequiredfilePostCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/FakequeryparamwithjsoncontenttypeGet.md b/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/FakequeryparamwithjsoncontenttypeGet.md new file mode 100644 index 00000000000..7f6553a05cd --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/FakequeryparamwithjsoncontenttypeGet.md @@ -0,0 +1,182 @@ +# FakequeryparamwithjsoncontenttypeGet + +public class FakequeryparamwithjsoncontenttypeGet + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Get](#get)
The class that has a get method to call the endpoint | +| interface | [QueryParamWithJsonContentTypeOperation](#queryparamwithjsoncontenttypeoperation)
The interface that has a queryParamWithJsonContentType method to call the endpoint | +| static class | [GetRequest](#getrequest)
The final request inputs class | +| static class | [GetNullableRequest](#getnullablerequest)
The initial request inputs class | +| static class | [Get0RequestBuilder](#get0requestbuilder)
A builder for the request input class | +| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | + +## Get +public static class Get extends ApiClient.ApiClient1 implements GetOperation
+ +a class that allows one to call the endpoint using a method named get + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.FakequeryparamwithjsoncontenttypeGetQueryParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.responses.FakequeryparamwithjsoncontenttypeGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.FakequeryparamwithjsoncontenttypeGet; +import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.FakequeryparamwithjsoncontenttypeGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakequeryparamwithjsoncontenttypeGet.Get apiClient = new FakequeryparamwithjsoncontenttypeGet.Get(apiConfiguration, schemaConfiguration); + + +// Map validation +FakequeryparamwithjsoncontenttypeGetQueryParameters.FakequeryparamwithjsoncontenttypeGetQueryParametersMap queryParameters = + FakequeryparamwithjsoncontenttypeGetQueryParameters.FakequeryparamwithjsoncontenttypeGetQueryParameters1.validate( + new FakequeryparamwithjsoncontenttypeGetQueryParameters.FakequeryparamwithjsoncontenttypeGetQueryParametersMapBuilder() + .build(), + schemaConfiguration +); + +var request = new FakequeryparamwithjsoncontenttypeGet.GetRequestBuilder() + .queryParameters(queryParameters) + .build(); + +FakequeryparamwithjsoncontenttypeGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakequeryparamwithjsoncontenttypeGetResponses.EndpointFakequeryparamwithjsoncontenttypeGetCode200Response castResponse = (FakequeryparamwithjsoncontenttypeGetResponses.EndpointFakequeryparamwithjsoncontenttypeGetCode200Response) response; +FakequeryparamwithjsoncontenttypeGetCode200Response.ApplicationjsonResponseBody deserializedBody = (FakequeryparamwithjsoncontenttypeGetCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakequeryparamwithjsoncontenttypeGetResponses.EndpointResponse](../../paths/fakequeryparamwithjsoncontenttype/get/FakequeryparamwithjsoncontenttypeGetResponses.md#endpointresponse) | get([GetRequest](#getrequest) request) | + +## QueryParamWithJsonContentTypeOperation +public interface QueryParamWithJsonContentTypeOperation
+ +an interface that allows one to call the endpoint using a method named queryParamWithJsonContentType by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakequeryparamwithjsoncontenttypeGetResponses.EndpointResponse](../../paths/fakequeryparamwithjsoncontenttype/get/FakequeryparamwithjsoncontenttypeGetResponses.md#endpointresponse) | queryParamWithJsonContentType([GetRequest](#getrequest) request) | + +## GetRequest +public static class GetRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakequeryparamwithjsoncontenttypeGetQueryParameters.FakequeryparamwithjsoncontenttypeGetQueryParametersMap](../../paths/fakequeryparamwithjsoncontenttype/get/FakequeryparamwithjsoncontenttypeGetQueryParameters.md#fakequeryparamwithjsoncontenttypegetqueryparametersmap) | queryParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## GetNullableRequest +public static class GetNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakequeryparamwithjsoncontenttypeGetQueryParameters.@Nullable FakequeryparamwithjsoncontenttypeGetQueryParametersMap](../../paths/fakequeryparamwithjsoncontenttype/get/FakequeryparamwithjsoncontenttypeGetQueryParameters.md#fakequeryparamwithjsoncontenttypegetqueryparametersmap) | queryParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| @Nullable Duration | timeout | + +## Get0RequestBuilder +public static class Get0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get0RequestBuilder(Get0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | +| [Get0RequestBuilder](#get0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Get0RequestBuilder](#get0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## GetRequestBuilder +public static class GetRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| GetRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Get0RequestBuilder](#get0requestbuilder) | queryParameters([FakequeryparamwithjsoncontenttypeGetQueryParametersFakequeryparamwithjsoncontenttypeGetQueryParametersMap](../../paths/fakequeryparamwithjsoncontenttype/get/FakequeryparamwithjsoncontenttypeGetQueryParameters.md#fakequeryparamwithjsoncontenttypegetqueryparametersmap) queryParameters)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/Get.md b/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/Get.md deleted file mode 100644 index 74a0727c609..00000000000 --- a/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/Get.md +++ /dev/null @@ -1,171 +0,0 @@ -# Get - -public class Get - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Get1](#get1)
The class that has a get method to call the endpoint | -| static class | [GetRequest](#getrequest)
The final request inputs class | -| static class | [GetNullableRequest](#getnullablerequest)
The initial request inputs class | -| static class | [Get0RequestBuilder](#get0requestbuilder)
A builder for the request input class | -| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | - -## Get1 -public static class Get1 extends ApiClient.ApiClient1 implements GetOperation
- -a class that allows one to call the endpoint using a method named get - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.QueryParameters; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.Get; -import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Get.Get1 apiClient = new Get.Get1(apiConfiguration, schemaConfiguration); - - -// Map validation -QueryParameters.QueryParametersMap queryParameters = - QueryParameters.QueryParameters1.validate( - new QueryParameters.QueryParametersMapBuilder() - .build(), - schemaConfiguration -); - -var request = new GetRequestBuilder() - .queryParameters(queryParameters) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.get(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -Code200Response.ApplicationjsonResponseBody deserializedBody = (Code200Response.ApplicationjsonResponseBody) castResponse.body; -// handle deserialized body here -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakequeryparamwithjsoncontenttype/get/Responses.md#endpointresponse) | get([GetRequest](#getrequest) request) | - -## GetRequest -public static class GetRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [QueryParameters.QueryParametersMap](../../paths/fakequeryparamwithjsoncontenttype/get/QueryParameters.md#queryparametersmap) | queryParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## GetNullableRequest -public static class GetNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [QueryParameters.@Nullable QueryParametersMap](../../paths/fakequeryparamwithjsoncontenttype/get/QueryParameters.md#queryparametersmap) | queryParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| @Nullable Duration | timeout | - -## Get0RequestBuilder -public static class Get0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get0RequestBuilder(Get0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | -| [Get0RequestBuilder](#get0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Get0RequestBuilder](#get0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## GetRequestBuilder -public static class GetRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| GetRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Get0RequestBuilder](#get0requestbuilder) | queryParameters([QueryParametersQueryParametersMap](../../paths/fakequeryparamwithjsoncontenttype/get/QueryParameters.md#queryparametersmap) queryParameters)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/get/FakequeryparamwithjsoncontenttypeGetQueryParameters.md b/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/get/FakequeryparamwithjsoncontenttypeGetQueryParameters.md new file mode 100644 index 00000000000..da87a34b4ff --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/get/FakequeryparamwithjsoncontenttypeGetQueryParameters.md @@ -0,0 +1,274 @@ +# FakequeryparamwithjsoncontenttypeGetQueryParameters +public class FakequeryparamwithjsoncontenttypeGetQueryParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [FakequeryparamwithjsoncontenttypeGetQueryParameters.FakequeryparamwithjsoncontenttypeGetQueryParameters1Boxed](#fakequeryparamwithjsoncontenttypegetqueryparameters1boxed)
sealed interface for validated payloads | +| record | [FakequeryparamwithjsoncontenttypeGetQueryParameters.FakequeryparamwithjsoncontenttypeGetQueryParameters1BoxedMap](#fakequeryparamwithjsoncontenttypegetqueryparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [FakequeryparamwithjsoncontenttypeGetQueryParameters.FakequeryparamwithjsoncontenttypeGetQueryParameters1](#fakequeryparamwithjsoncontenttypegetqueryparameters1)
schema class | +| static class | [FakequeryparamwithjsoncontenttypeGetQueryParameters.FakequeryparamwithjsoncontenttypeGetQueryParametersMapBuilder](#fakequeryparamwithjsoncontenttypegetqueryparametersmapbuilder)
builder for Map payloads | +| static class | [FakequeryparamwithjsoncontenttypeGetQueryParameters.FakequeryparamwithjsoncontenttypeGetQueryParametersMap](#fakequeryparamwithjsoncontenttypegetqueryparametersmap)
output class for Map payloads | +| sealed interface | [FakequeryparamwithjsoncontenttypeGetQueryParameters.FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxed](#fakequeryparamwithjsoncontenttypegetadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [FakequeryparamwithjsoncontenttypeGetQueryParameters.FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedVoid](#fakequeryparamwithjsoncontenttypegetadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [FakequeryparamwithjsoncontenttypeGetQueryParameters.FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedBoolean](#fakequeryparamwithjsoncontenttypegetadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [FakequeryparamwithjsoncontenttypeGetQueryParameters.FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedNumber](#fakequeryparamwithjsoncontenttypegetadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [FakequeryparamwithjsoncontenttypeGetQueryParameters.FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedString](#fakequeryparamwithjsoncontenttypegetadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [FakequeryparamwithjsoncontenttypeGetQueryParameters.FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedList](#fakequeryparamwithjsoncontenttypegetadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [FakequeryparamwithjsoncontenttypeGetQueryParameters.FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedMap](#fakequeryparamwithjsoncontenttypegetadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [FakequeryparamwithjsoncontenttypeGetQueryParameters.FakequeryparamwithjsoncontenttypeGetadditionalProperties](#fakequeryparamwithjsoncontenttypegetadditionalproperties)
schema class | + +## FakequeryparamwithjsoncontenttypeGetQueryParameters1Boxed +public sealed interface FakequeryparamwithjsoncontenttypeGetQueryParameters1Boxed
+permits
+[FakequeryparamwithjsoncontenttypeGetQueryParameters1BoxedMap](#fakequeryparamwithjsoncontenttypegetqueryparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## FakequeryparamwithjsoncontenttypeGetQueryParameters1BoxedMap +public record FakequeryparamwithjsoncontenttypeGetQueryParameters1BoxedMap
+implements [FakequeryparamwithjsoncontenttypeGetQueryParameters1Boxed](#fakequeryparamwithjsoncontenttypegetqueryparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakequeryparamwithjsoncontenttypeGetQueryParameters1BoxedMap([FakequeryparamwithjsoncontenttypeGetQueryParametersMap](#fakequeryparamwithjsoncontenttypegetqueryparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakequeryparamwithjsoncontenttypeGetQueryParametersMap](#fakequeryparamwithjsoncontenttypegetqueryparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakequeryparamwithjsoncontenttypeGetQueryParameters1 +public static class FakequeryparamwithjsoncontenttypeGetQueryParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.FakequeryparamwithjsoncontenttypeGetQueryParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +FakequeryparamwithjsoncontenttypeGetQueryParameters.FakequeryparamwithjsoncontenttypeGetQueryParametersMap validatedPayload = + FakequeryparamwithjsoncontenttypeGetQueryParameters.FakequeryparamwithjsoncontenttypeGetQueryParameters1.validate( + new FakequeryparamwithjsoncontenttypeGetQueryParameters.FakequeryparamwithjsoncontenttypeGetQueryParametersMapBuilder() + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("someParam", [Schema0.Schema01.class](../../../paths/fakequeryparamwithjsoncontenttype/get/parameters/parameter0/content/applicationjson/Schema0.md#schema01))
)
| +| Set | required = Set.of(
    "someParam"
)
| +| Class | additionalProperties = [FakequeryparamwithjsoncontenttypeGetadditionalProperties.class](#fakequeryparamwithjsoncontenttypegetadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakequeryparamwithjsoncontenttypeGetQueryParametersMap](#fakequeryparamwithjsoncontenttypegetqueryparametersmap) | validate([Map<?, ?>](#fakequeryparamwithjsoncontenttypegetqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [FakequeryparamwithjsoncontenttypeGetQueryParameters1BoxedMap](#fakequeryparamwithjsoncontenttypegetqueryparameters1boxedmap) | validateAndBox([Map<?, ?>](#fakequeryparamwithjsoncontenttypegetqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [FakequeryparamwithjsoncontenttypeGetQueryParameters1Boxed](#fakequeryparamwithjsoncontenttypegetqueryparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## FakequeryparamwithjsoncontenttypeGetQueryParametersMap0Builder +public class FakequeryparamwithjsoncontenttypeGetQueryParametersMap0Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakequeryparamwithjsoncontenttypeGetQueryParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | + +## FakequeryparamwithjsoncontenttypeGetQueryParametersMapBuilder +public class FakequeryparamwithjsoncontenttypeGetQueryParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakequeryparamwithjsoncontenttypeGetQueryParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakequeryparamwithjsoncontenttypeGetQueryParametersMap0Builder](#fakequeryparamwithjsoncontenttypegetqueryparametersmap0builder) | someParam(Void value) | +| [FakequeryparamwithjsoncontenttypeGetQueryParametersMap0Builder](#fakequeryparamwithjsoncontenttypegetqueryparametersmap0builder) | someParam(boolean value) | +| [FakequeryparamwithjsoncontenttypeGetQueryParametersMap0Builder](#fakequeryparamwithjsoncontenttypegetqueryparametersmap0builder) | someParam(String value) | +| [FakequeryparamwithjsoncontenttypeGetQueryParametersMap0Builder](#fakequeryparamwithjsoncontenttypegetqueryparametersmap0builder) | someParam(int value) | +| [FakequeryparamwithjsoncontenttypeGetQueryParametersMap0Builder](#fakequeryparamwithjsoncontenttypegetqueryparametersmap0builder) | someParam(float value) | +| [FakequeryparamwithjsoncontenttypeGetQueryParametersMap0Builder](#fakequeryparamwithjsoncontenttypegetqueryparametersmap0builder) | someParam(long value) | +| [FakequeryparamwithjsoncontenttypeGetQueryParametersMap0Builder](#fakequeryparamwithjsoncontenttypegetqueryparametersmap0builder) | someParam(double value) | +| [FakequeryparamwithjsoncontenttypeGetQueryParametersMap0Builder](#fakequeryparamwithjsoncontenttypegetqueryparametersmap0builder) | someParam(List value) | +| [FakequeryparamwithjsoncontenttypeGetQueryParametersMap0Builder](#fakequeryparamwithjsoncontenttypegetqueryparametersmap0builder) | someParam(Map value) | + +## FakequeryparamwithjsoncontenttypeGetQueryParametersMap +public static class FakequeryparamwithjsoncontenttypeGetQueryParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [FakequeryparamwithjsoncontenttypeGetQueryParametersMap](#fakequeryparamwithjsoncontenttypegetqueryparametersmap) | of([Map](#fakequeryparamwithjsoncontenttypegetqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| @Nullable Object | someParam()
| + +## FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxed +public sealed interface FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxed
+permits
+[FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedVoid](#fakequeryparamwithjsoncontenttypegetadditionalpropertiesboxedvoid), +[FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedBoolean](#fakequeryparamwithjsoncontenttypegetadditionalpropertiesboxedboolean), +[FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedNumber](#fakequeryparamwithjsoncontenttypegetadditionalpropertiesboxednumber), +[FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedString](#fakequeryparamwithjsoncontenttypegetadditionalpropertiesboxedstring), +[FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedList](#fakequeryparamwithjsoncontenttypegetadditionalpropertiesboxedlist), +[FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedMap](#fakequeryparamwithjsoncontenttypegetadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedVoid +public record FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedVoid
+implements [FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxed](#fakequeryparamwithjsoncontenttypegetadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedBoolean +public record FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedBoolean
+implements [FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxed](#fakequeryparamwithjsoncontenttypegetadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedNumber +public record FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedNumber
+implements [FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxed](#fakequeryparamwithjsoncontenttypegetadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedString +public record FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedString
+implements [FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxed](#fakequeryparamwithjsoncontenttypegetadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedList +public record FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedList
+implements [FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxed](#fakequeryparamwithjsoncontenttypegetadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedMap +public record FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedMap
+implements [FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxed](#fakequeryparamwithjsoncontenttypegetadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakequeryparamwithjsoncontenttypeGetadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakequeryparamwithjsoncontenttypeGetadditionalProperties +public static class FakequeryparamwithjsoncontenttypeGetadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/get/FakequeryparamwithjsoncontenttypeGetResponses.md b/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/get/FakequeryparamwithjsoncontenttypeGetResponses.md new file mode 100644 index 00000000000..8d267310181 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/get/FakequeryparamwithjsoncontenttypeGetResponses.md @@ -0,0 +1,29 @@ +# FakequeryparamwithjsoncontenttypeGetResponses + +public class FakequeryparamwithjsoncontenttypeGetResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakequeryparamwithjsoncontenttypeGetCode200Response](#endpointfakequeryparamwithjsoncontenttypegetcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakequeryparamwithjsoncontenttypeGetCode200Response](#endpointfakequeryparamwithjsoncontenttypegetcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakequeryparamwithjsoncontenttypeGetCode200Response +public record EndpointFakequeryparamwithjsoncontenttypeGetCode200Response( + HttpResponse response, + [FakequeryparamwithjsoncontenttypeGetCode200Response.SealedResponseBody](../../../paths/fakequeryparamwithjsoncontenttype/get/responses/FakequeryparamwithjsoncontenttypeGetCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/get/QueryParameters.md b/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/get/QueryParameters.md deleted file mode 100644 index e5511de70d1..00000000000 --- a/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/get/QueryParameters.md +++ /dev/null @@ -1,274 +0,0 @@ -# QueryParameters -public class QueryParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [QueryParameters.QueryParameters1Boxed](#queryparameters1boxed)
sealed interface for validated payloads | -| record | [QueryParameters.QueryParameters1BoxedMap](#queryparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [QueryParameters.QueryParameters1](#queryparameters1)
schema class | -| static class | [QueryParameters.QueryParametersMapBuilder](#queryparametersmapbuilder)
builder for Map payloads | -| static class | [QueryParameters.QueryParametersMap](#queryparametersmap)
output class for Map payloads | -| sealed interface | [QueryParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [QueryParameters.AdditionalProperties](#additionalproperties)
schema class | - -## QueryParameters1Boxed -public sealed interface QueryParameters1Boxed
-permits
-[QueryParameters1BoxedMap](#queryparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## QueryParameters1BoxedMap -public record QueryParameters1BoxedMap
-implements [QueryParameters1Boxed](#queryparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParameters1BoxedMap([QueryParametersMap](#queryparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap](#queryparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## QueryParameters1 -public static class QueryParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.QueryParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -QueryParameters.QueryParametersMap validatedPayload = - QueryParameters.QueryParameters1.validate( - new QueryParameters.QueryParametersMapBuilder() - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("someParam", [Schema0.Schema01.class](../../../paths/fakequeryparamwithjsoncontenttype/get/parameters/parameter0/content/applicationjson/Schema0.md#schema01))
)
| -| Set | required = Set.of(
    "someParam"
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap](#queryparametersmap) | validate([Map<?, ?>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [QueryParameters1BoxedMap](#queryparameters1boxedmap) | validateAndBox([Map<?, ?>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [QueryParameters1Boxed](#queryparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## QueryParametersMap0Builder -public class QueryParametersMap0Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | - -## QueryParametersMapBuilder -public class QueryParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap0Builder](#queryparametersmap0builder) | someParam(Void value) | -| [QueryParametersMap0Builder](#queryparametersmap0builder) | someParam(boolean value) | -| [QueryParametersMap0Builder](#queryparametersmap0builder) | someParam(String value) | -| [QueryParametersMap0Builder](#queryparametersmap0builder) | someParam(int value) | -| [QueryParametersMap0Builder](#queryparametersmap0builder) | someParam(float value) | -| [QueryParametersMap0Builder](#queryparametersmap0builder) | someParam(long value) | -| [QueryParametersMap0Builder](#queryparametersmap0builder) | someParam(double value) | -| [QueryParametersMap0Builder](#queryparametersmap0builder) | someParam(List value) | -| [QueryParametersMap0Builder](#queryparametersmap0builder) | someParam(Map value) | - -## QueryParametersMap -public static class QueryParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [QueryParametersMap](#queryparametersmap) | of([Map](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| @Nullable Object | someParam()
| - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/get/Responses.md b/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/get/Responses.md deleted file mode 100644 index 07ff93a969b..00000000000 --- a/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/get/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/fakequeryparamwithjsoncontenttype/get/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/get/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/get/responses/Code200Response.md deleted file mode 100644 index aca65794e2c..00000000000 --- a/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/get/responses/Code200Response.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakequeryparamwithjsoncontenttype/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakequeryparamwithjsoncontenttype/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/get/responses/FakequeryparamwithjsoncontenttypeGetCode200Response.md b/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/get/responses/FakequeryparamwithjsoncontenttypeGetCode200Response.md new file mode 100644 index 00000000000..9ec99947bbf --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakequeryparamwithjsoncontenttype/get/responses/FakequeryparamwithjsoncontenttypeGetCode200Response.md @@ -0,0 +1,87 @@ +# FakequeryparamwithjsoncontenttypeGetCode200Response + +public class FakequeryparamwithjsoncontenttypeGetCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakequeryparamwithjsoncontenttypeGetCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakequeryparamwithjsoncontenttypeGetCode200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakequeryparamwithjsoncontenttypeGetCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakequeryparamwithjsoncontenttypeGetCode200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [FakequeryparamwithjsoncontenttypeGetCode200Response.FakequeryparamwithjsoncontenttypeGetCode200Response1](#fakequeryparamwithjsoncontenttypegetcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakequeryparamwithjsoncontenttype/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakequeryparamwithjsoncontenttype/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | + +## FakequeryparamwithjsoncontenttypeGetCode200Response1 +public static class FakequeryparamwithjsoncontenttypeGetCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakequeryparamwithjsoncontenttypeGetCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakeredirection/FakeredirectionGet.md b/samples/client/petstore/java/docs/paths/fakeredirection/FakeredirectionGet.md new file mode 100644 index 00000000000..d710b032e45 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeredirection/FakeredirectionGet.md @@ -0,0 +1,143 @@ +# FakeredirectionGet + +public class FakeredirectionGet + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Get](#get)
The class that has a get method to call the endpoint | +| interface | [RedirectionOperation](#redirectionoperation)
The interface that has a redirection method to call the endpoint | +| static class | [GetRequest](#getrequest)
The request inputs class | +| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | + +## Get +public static class Get extends ApiClient.ApiClient1 implements GetOperation
+ +a class that allows one to call the endpoint using a method named get + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeredirection.get.responses.FakeredirectionGetCode303Response; +import org.openapijsonschematools.client.paths.fakeredirection.get.responses.FakeredirectionGetCode3XXResponse; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeredirection.FakeredirectionGet; +import org.openapijsonschematools.client.paths.fakeredirection.get.FakeredirectionGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakeredirectionGet.Get apiClient = new FakeredirectionGet.Get(apiConfiguration, schemaConfiguration); + + +var request = new FakeredirectionGet.GetRequestBuilder().build(); + +FakeredirectionGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +if (response instanceof FakeredirectionGetResponses.EndpointFakeredirectionGetCode3XXResponse castResponse) { +} else { + FakeredirectionGetResponses.EndpointFakeredirectionGetCode303Response castResponse = (FakeredirectionGetResponses.EndpointFakeredirectionGetCode303Response) response; +} +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeredirectionGetResponses.EndpointResponse](../../paths/fakeredirection/get/FakeredirectionGetResponses.md#endpointresponse) | get([GetRequest](#getrequest) request) | + +## RedirectionOperation +public interface RedirectionOperation
+ +an interface that allows one to call the endpoint using a method named redirection by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeredirectionGetResponses.EndpointResponse](../../paths/fakeredirection/get/FakeredirectionGetResponses.md#endpointresponse) | redirection([GetRequest](#getrequest) request) | + +## GetRequest +public static class GetRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## GetRequestBuilder +public static class GetRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| GetRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | +| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakeredirection/Get.md b/samples/client/petstore/java/docs/paths/fakeredirection/Get.md deleted file mode 100644 index e640e6b3330..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeredirection/Get.md +++ /dev/null @@ -1,132 +0,0 @@ -# Get - -public class Get - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Get1](#get1)
The class that has a get method to call the endpoint | -| static class | [GetRequest](#getrequest)
The request inputs class | -| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | - -## Get1 -public static class Get1 extends ApiClient.ApiClient1 implements GetOperation
- -a class that allows one to call the endpoint using a method named get - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakeredirection.get.responses.Code303Response; -import org.openapijsonschematools.client.paths.fakeredirection.get.responses.Code3XXResponse; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakeredirection.Get; -import org.openapijsonschematools.client.paths.fakeredirection.get.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Get.Get1 apiClient = new Get.Get1(apiConfiguration, schemaConfiguration); - - -var request = new GetRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.get(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -if (response instanceof Responses.EndpointCode3XXResponse castResponse) { -} else { - Responses.EndpointCode303Response castResponse = (Responses.EndpointCode303Response) response; -} -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakeredirection/get/Responses.md#endpointresponse) | get([GetRequest](#getrequest) request) | - -## GetRequest -public static class GetRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## GetRequestBuilder -public static class GetRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| GetRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | -| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakeredirection/get/FakeredirectionGetResponses.md b/samples/client/petstore/java/docs/paths/fakeredirection/get/FakeredirectionGetResponses.md new file mode 100644 index 00000000000..98e4c369709 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeredirection/get/FakeredirectionGetResponses.md @@ -0,0 +1,40 @@ +# FakeredirectionGetResponses + +public class FakeredirectionGetResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakeredirectionGetCode3XXResponse](#endpointfakeredirectiongetcode3xxresponse)
the response for 3XX | +| record | [EndpointFakeredirectionGetCode303Response](#endpointfakeredirectiongetcode303response)
the response for 303 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakeredirectionGetCode3XXResponse](#endpointfakeredirectiongetcode3xxresponse), +[EndpointFakeredirectionGetCode303Response](#endpointfakeredirectiongetcode303response) + +a sealed interface that stores endpoint responses + +## EndpointFakeredirectionGetCode3XXResponse +public record EndpointFakeredirectionGetCode3XXResponse( + HttpResponse response, + Void body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + +## EndpointFakeredirectionGetCode303Response +public record EndpointFakeredirectionGetCode303Response( + HttpResponse response, + Void body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakeredirection/get/Responses.md b/samples/client/petstore/java/docs/paths/fakeredirection/get/Responses.md deleted file mode 100644 index 9d240a76c1e..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeredirection/get/Responses.md +++ /dev/null @@ -1,40 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode3XXResponse](#endpointcode3xxresponse)
the response for 3XX | -| record | [EndpointCode303Response](#endpointcode303response)
the response for 303 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode3XXResponse](#endpointcode3xxresponse), -[EndpointCode303Response](#endpointcode303response) - -a sealed interface that stores endpoint responses - -## EndpointCode3XXResponse -public record EndpointCode3XXResponse( - HttpResponse response, - Void body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - -## EndpointCode303Response -public record EndpointCode303Response( - HttpResponse response, - Void body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakeredirection/get/responses/Code303Response.md b/samples/client/petstore/java/docs/paths/fakeredirection/get/responses/Code303Response.md deleted file mode 100644 index 9fe8de9f05b..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeredirection/get/responses/Code303Response.md +++ /dev/null @@ -1,32 +0,0 @@ -# Code303Response - -public class Code303Response - -A class that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code303Response.Code303Response1](#code303response1)
class that deserializes responses | - -## Code303Response1 -public static class Code303Response1
-extends ResponseDeserializer - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code303Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = MapUtils.makeMap(
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakeredirection/get/responses/Code3XXResponse.md b/samples/client/petstore/java/docs/paths/fakeredirection/get/responses/Code3XXResponse.md deleted file mode 100644 index 613a79b19bf..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeredirection/get/responses/Code3XXResponse.md +++ /dev/null @@ -1,32 +0,0 @@ -# Code3XXResponse - -public class Code3XXResponse - -A class that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code3XXResponse.Code3XXResponse1](#code3xxresponse1)
class that deserializes responses | - -## Code3XXResponse1 -public static class Code3XXResponse1
-extends ResponseDeserializer - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code3XXResponse1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = MapUtils.makeMap(
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakeredirection/get/responses/FakeredirectionGetCode303Response.md b/samples/client/petstore/java/docs/paths/fakeredirection/get/responses/FakeredirectionGetCode303Response.md new file mode 100644 index 00000000000..25474489f32 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeredirection/get/responses/FakeredirectionGetCode303Response.md @@ -0,0 +1,32 @@ +# FakeredirectionGetCode303Response + +public class FakeredirectionGetCode303Response + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [FakeredirectionGetCode303Response.FakeredirectionGetCode303Response1](#fakeredirectiongetcode303response1)
class that deserializes responses | + +## FakeredirectionGetCode303Response1 +public static class FakeredirectionGetCode303Response1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeredirectionGetCode303Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakeredirection/get/responses/FakeredirectionGetCode3XXResponse.md b/samples/client/petstore/java/docs/paths/fakeredirection/get/responses/FakeredirectionGetCode3XXResponse.md new file mode 100644 index 00000000000..f79a85bb494 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeredirection/get/responses/FakeredirectionGetCode3XXResponse.md @@ -0,0 +1,32 @@ +# FakeredirectionGetCode3XXResponse + +public class FakeredirectionGetCode3XXResponse + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [FakeredirectionGetCode3XXResponse.FakeredirectionGetCode3XXResponse1](#fakeredirectiongetcode3xxresponse1)
class that deserializes responses | + +## FakeredirectionGetCode3XXResponse1 +public static class FakeredirectionGetCode3XXResponse1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeredirectionGetCode3XXResponse1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakerefobjinquery/FakerefobjinqueryGet.md b/samples/client/petstore/java/docs/paths/fakerefobjinquery/FakerefobjinqueryGet.md new file mode 100644 index 00000000000..cadef7383c1 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefobjinquery/FakerefobjinqueryGet.md @@ -0,0 +1,142 @@ +# FakerefobjinqueryGet + +public class FakerefobjinqueryGet + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Get](#get)
The class that has a get method to call the endpoint | +| interface | [RefObjectInQueryOperation](#refobjectinqueryoperation)
The interface that has a refObjectInQuery method to call the endpoint | +| static class | [GetRequest](#getrequest)
The request inputs class | +| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | + +## Get +public static class Get extends ApiClient.ApiClient1 implements GetOperation
+ +a class that allows one to call the endpoint using a method named get + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakerefobjinquery.get.FakerefobjinqueryGetQueryParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefobjinquery.get.responses.FakerefobjinqueryGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakerefobjinquery.FakerefobjinqueryGet; +import org.openapijsonschematools.client.paths.fakerefobjinquery.get.FakerefobjinqueryGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakerefobjinqueryGet.Get apiClient = new FakerefobjinqueryGet.Get(apiConfiguration, schemaConfiguration); + + +var request = new FakerefobjinqueryGet.GetRequestBuilder().build(); + +FakerefobjinqueryGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefobjinqueryGetResponses.EndpointFakerefobjinqueryGetCode200Response castResponse = (FakerefobjinqueryGetResponses.EndpointFakerefobjinqueryGetCode200Response) response; +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefobjinqueryGetResponses.EndpointResponse](../../paths/fakerefobjinquery/get/FakerefobjinqueryGetResponses.md#endpointresponse) | get([GetRequest](#getrequest) request) | + +## RefObjectInQueryOperation +public interface RefObjectInQueryOperation
+ +an interface that allows one to call the endpoint using a method named refObjectInQuery by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefobjinqueryGetResponses.EndpointResponse](../../paths/fakerefobjinquery/get/FakerefobjinqueryGetResponses.md#endpointresponse) | refObjectInQuery([GetRequest](#getrequest) request) | + +## GetRequest +public static class GetRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakerefobjinqueryGetQueryParameters.@Nullable FakerefobjinqueryGetQueryParametersMap](../../paths/fakerefobjinquery/get/FakerefobjinqueryGetQueryParameters.md#fakerefobjinquerygetqueryparametersmap) | queryParameters
optional | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## GetRequestBuilder +public static class GetRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| GetRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | +| [GetRequestBuilder](#getrequestbuilder) | queryParameters([FakerefobjinqueryGetQueryParametersFakerefobjinqueryGetQueryParametersMap](../../paths/fakerefobjinquery/get/FakerefobjinqueryGetQueryParameters.md#fakerefobjinquerygetqueryparametersmap) queryParameters)
sets the optional property | +| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakerefobjinquery/Get.md b/samples/client/petstore/java/docs/paths/fakerefobjinquery/Get.md deleted file mode 100644 index f4d03b3f970..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefobjinquery/Get.md +++ /dev/null @@ -1,131 +0,0 @@ -# Get - -public class Get - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Get1](#get1)
The class that has a get method to call the endpoint | -| static class | [GetRequest](#getrequest)
The request inputs class | -| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | - -## Get1 -public static class Get1 extends ApiClient.ApiClient1 implements GetOperation
- -a class that allows one to call the endpoint using a method named get - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakerefobjinquery.get.QueryParameters; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakerefobjinquery.get.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakerefobjinquery.Get; -import org.openapijsonschematools.client.paths.fakerefobjinquery.get.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Get.Get1 apiClient = new Get.Get1(apiConfiguration, schemaConfiguration); - - -var request = new GetRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.get(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakerefobjinquery/get/Responses.md#endpointresponse) | get([GetRequest](#getrequest) request) | - -## GetRequest -public static class GetRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [QueryParameters.@Nullable QueryParametersMap](../../paths/fakerefobjinquery/get/QueryParameters.md#queryparametersmap) | queryParameters
optional | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## GetRequestBuilder -public static class GetRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| GetRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | -| [GetRequestBuilder](#getrequestbuilder) | queryParameters([QueryParametersQueryParametersMap](../../paths/fakerefobjinquery/get/QueryParameters.md#queryparametersmap) queryParameters)
sets the optional property | -| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakerefobjinquery/get/FakerefobjinqueryGetQueryParameters.md b/samples/client/petstore/java/docs/paths/fakerefobjinquery/get/FakerefobjinqueryGetQueryParameters.md new file mode 100644 index 00000000000..53a2d3b33d2 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefobjinquery/get/FakerefobjinqueryGetQueryParameters.md @@ -0,0 +1,258 @@ +# FakerefobjinqueryGetQueryParameters +public class FakerefobjinqueryGetQueryParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [FakerefobjinqueryGetQueryParameters.FakerefobjinqueryGetQueryParameters1Boxed](#fakerefobjinquerygetqueryparameters1boxed)
sealed interface for validated payloads | +| record | [FakerefobjinqueryGetQueryParameters.FakerefobjinqueryGetQueryParameters1BoxedMap](#fakerefobjinquerygetqueryparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [FakerefobjinqueryGetQueryParameters.FakerefobjinqueryGetQueryParameters1](#fakerefobjinquerygetqueryparameters1)
schema class | +| static class | [FakerefobjinqueryGetQueryParameters.FakerefobjinqueryGetQueryParametersMapBuilder](#fakerefobjinquerygetqueryparametersmapbuilder)
builder for Map payloads | +| static class | [FakerefobjinqueryGetQueryParameters.FakerefobjinqueryGetQueryParametersMap](#fakerefobjinquerygetqueryparametersmap)
output class for Map payloads | +| sealed interface | [FakerefobjinqueryGetQueryParameters.FakerefobjinqueryGetadditionalPropertiesBoxed](#fakerefobjinquerygetadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [FakerefobjinqueryGetQueryParameters.FakerefobjinqueryGetadditionalPropertiesBoxedVoid](#fakerefobjinquerygetadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [FakerefobjinqueryGetQueryParameters.FakerefobjinqueryGetadditionalPropertiesBoxedBoolean](#fakerefobjinquerygetadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [FakerefobjinqueryGetQueryParameters.FakerefobjinqueryGetadditionalPropertiesBoxedNumber](#fakerefobjinquerygetadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [FakerefobjinqueryGetQueryParameters.FakerefobjinqueryGetadditionalPropertiesBoxedString](#fakerefobjinquerygetadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [FakerefobjinqueryGetQueryParameters.FakerefobjinqueryGetadditionalPropertiesBoxedList](#fakerefobjinquerygetadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [FakerefobjinqueryGetQueryParameters.FakerefobjinqueryGetadditionalPropertiesBoxedMap](#fakerefobjinquerygetadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [FakerefobjinqueryGetQueryParameters.FakerefobjinqueryGetadditionalProperties](#fakerefobjinquerygetadditionalproperties)
schema class | + +## FakerefobjinqueryGetQueryParameters1Boxed +public sealed interface FakerefobjinqueryGetQueryParameters1Boxed
+permits
+[FakerefobjinqueryGetQueryParameters1BoxedMap](#fakerefobjinquerygetqueryparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## FakerefobjinqueryGetQueryParameters1BoxedMap +public record FakerefobjinqueryGetQueryParameters1BoxedMap
+implements [FakerefobjinqueryGetQueryParameters1Boxed](#fakerefobjinquerygetqueryparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakerefobjinqueryGetQueryParameters1BoxedMap([FakerefobjinqueryGetQueryParametersMap](#fakerefobjinquerygetqueryparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefobjinqueryGetQueryParametersMap](#fakerefobjinquerygetqueryparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakerefobjinqueryGetQueryParameters1 +public static class FakerefobjinqueryGetQueryParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakerefobjinquery.get.FakerefobjinqueryGetQueryParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +FakerefobjinqueryGetQueryParameters.FakerefobjinqueryGetQueryParametersMap validatedPayload = + FakerefobjinqueryGetQueryParameters.FakerefobjinqueryGetQueryParameters1.validate( + new FakerefobjinqueryGetQueryParameters.FakerefobjinqueryGetQueryParametersMapBuilder() + .mapBean( + MapUtils.makeMap( + new AbstractMap.SimpleEntry( + "bar", + "a" + ) + ) + ) + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("mapBean", [Foo.Foo1.class](../../../components/schemas/Foo.md#foo1))
)
| +| Class | additionalProperties = [FakerefobjinqueryGetadditionalProperties.class](#fakerefobjinquerygetadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefobjinqueryGetQueryParametersMap](#fakerefobjinquerygetqueryparametersmap) | validate([Map<?, ?>](#fakerefobjinquerygetqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [FakerefobjinqueryGetQueryParameters1BoxedMap](#fakerefobjinquerygetqueryparameters1boxedmap) | validateAndBox([Map<?, ?>](#fakerefobjinquerygetqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [FakerefobjinqueryGetQueryParameters1Boxed](#fakerefobjinquerygetqueryparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## FakerefobjinqueryGetQueryParametersMapBuilder +public class FakerefobjinqueryGetQueryParametersMapBuilder
+builder for `Map>` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakerefobjinqueryGetQueryParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map> | build()
Returns map input that should be used with Schema.validate | +| [FakerefobjinqueryGetQueryParametersMapBuilder](#fakerefobjinquerygetqueryparametersmapbuilder) | mapBean(Map value) | + +## FakerefobjinqueryGetQueryParametersMap +public static class FakerefobjinqueryGetQueryParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [FakerefobjinqueryGetQueryParametersMap](#fakerefobjinquerygetqueryparametersmap) | of([Map>](#fakerefobjinquerygetqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [Foo.FooMap](../../../components/schemas/Foo.md#foomap) | mapBean()
[optional] | + +## FakerefobjinqueryGetadditionalPropertiesBoxed +public sealed interface FakerefobjinqueryGetadditionalPropertiesBoxed
+permits
+[FakerefobjinqueryGetadditionalPropertiesBoxedVoid](#fakerefobjinquerygetadditionalpropertiesboxedvoid), +[FakerefobjinqueryGetadditionalPropertiesBoxedBoolean](#fakerefobjinquerygetadditionalpropertiesboxedboolean), +[FakerefobjinqueryGetadditionalPropertiesBoxedNumber](#fakerefobjinquerygetadditionalpropertiesboxednumber), +[FakerefobjinqueryGetadditionalPropertiesBoxedString](#fakerefobjinquerygetadditionalpropertiesboxedstring), +[FakerefobjinqueryGetadditionalPropertiesBoxedList](#fakerefobjinquerygetadditionalpropertiesboxedlist), +[FakerefobjinqueryGetadditionalPropertiesBoxedMap](#fakerefobjinquerygetadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## FakerefobjinqueryGetadditionalPropertiesBoxedVoid +public record FakerefobjinqueryGetadditionalPropertiesBoxedVoid
+implements [FakerefobjinqueryGetadditionalPropertiesBoxed](#fakerefobjinquerygetadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakerefobjinqueryGetadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakerefobjinqueryGetadditionalPropertiesBoxedBoolean +public record FakerefobjinqueryGetadditionalPropertiesBoxedBoolean
+implements [FakerefobjinqueryGetadditionalPropertiesBoxed](#fakerefobjinquerygetadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakerefobjinqueryGetadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakerefobjinqueryGetadditionalPropertiesBoxedNumber +public record FakerefobjinqueryGetadditionalPropertiesBoxedNumber
+implements [FakerefobjinqueryGetadditionalPropertiesBoxed](#fakerefobjinquerygetadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakerefobjinqueryGetadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakerefobjinqueryGetadditionalPropertiesBoxedString +public record FakerefobjinqueryGetadditionalPropertiesBoxedString
+implements [FakerefobjinqueryGetadditionalPropertiesBoxed](#fakerefobjinquerygetadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakerefobjinqueryGetadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakerefobjinqueryGetadditionalPropertiesBoxedList +public record FakerefobjinqueryGetadditionalPropertiesBoxedList
+implements [FakerefobjinqueryGetadditionalPropertiesBoxed](#fakerefobjinquerygetadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakerefobjinqueryGetadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakerefobjinqueryGetadditionalPropertiesBoxedMap +public record FakerefobjinqueryGetadditionalPropertiesBoxedMap
+implements [FakerefobjinqueryGetadditionalPropertiesBoxed](#fakerefobjinquerygetadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakerefobjinqueryGetadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FakerefobjinqueryGetadditionalProperties +public static class FakerefobjinqueryGetadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakerefobjinquery/get/FakerefobjinqueryGetResponses.md b/samples/client/petstore/java/docs/paths/fakerefobjinquery/get/FakerefobjinqueryGetResponses.md new file mode 100644 index 00000000000..304f571b661 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefobjinquery/get/FakerefobjinqueryGetResponses.md @@ -0,0 +1,29 @@ +# FakerefobjinqueryGetResponses + +public class FakerefobjinqueryGetResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakerefobjinqueryGetCode200Response](#endpointfakerefobjinquerygetcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakerefobjinqueryGetCode200Response](#endpointfakerefobjinquerygetcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakerefobjinqueryGetCode200Response +public record EndpointFakerefobjinqueryGetCode200Response( + HttpResponse response, + Void body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakerefobjinquery/get/QueryParameters.md b/samples/client/petstore/java/docs/paths/fakerefobjinquery/get/QueryParameters.md deleted file mode 100644 index 8af143cb246..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefobjinquery/get/QueryParameters.md +++ /dev/null @@ -1,258 +0,0 @@ -# QueryParameters -public class QueryParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [QueryParameters.QueryParameters1Boxed](#queryparameters1boxed)
sealed interface for validated payloads | -| record | [QueryParameters.QueryParameters1BoxedMap](#queryparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [QueryParameters.QueryParameters1](#queryparameters1)
schema class | -| static class | [QueryParameters.QueryParametersMapBuilder](#queryparametersmapbuilder)
builder for Map payloads | -| static class | [QueryParameters.QueryParametersMap](#queryparametersmap)
output class for Map payloads | -| sealed interface | [QueryParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [QueryParameters.AdditionalProperties](#additionalproperties)
schema class | - -## QueryParameters1Boxed -public sealed interface QueryParameters1Boxed
-permits
-[QueryParameters1BoxedMap](#queryparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## QueryParameters1BoxedMap -public record QueryParameters1BoxedMap
-implements [QueryParameters1Boxed](#queryparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParameters1BoxedMap([QueryParametersMap](#queryparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap](#queryparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## QueryParameters1 -public static class QueryParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakerefobjinquery.get.QueryParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -QueryParameters.QueryParametersMap validatedPayload = - QueryParameters.QueryParameters1.validate( - new QueryParameters.QueryParametersMapBuilder() - .mapBean( - MapUtils.makeMap( - new AbstractMap.SimpleEntry( - "bar", - "a" - ) - ) - ) - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("mapBean", [Foo.Foo1.class](../../../components/schemas/Foo.md#foo1))
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap](#queryparametersmap) | validate([Map<?, ?>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [QueryParameters1BoxedMap](#queryparameters1boxedmap) | validateAndBox([Map<?, ?>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [QueryParameters1Boxed](#queryparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## QueryParametersMapBuilder -public class QueryParametersMapBuilder
-builder for `Map>` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map> | build()
Returns map input that should be used with Schema.validate | -| [QueryParametersMapBuilder](#queryparametersmapbuilder) | mapBean(Map value) | - -## QueryParametersMap -public static class QueryParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [QueryParametersMap](#queryparametersmap) | of([Map>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [Foo.FooMap](../../../components/schemas/Foo.md#foomap) | mapBean()
[optional] | - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/fakerefobjinquery/get/Responses.md b/samples/client/petstore/java/docs/paths/fakerefobjinquery/get/Responses.md deleted file mode 100644 index d4bf4fdb8f5..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefobjinquery/get/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakerefobjinquery/get/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakerefobjinquery/get/responses/Code200Response.md deleted file mode 100644 index e89c75b2e12..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefobjinquery/get/responses/Code200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# Code200Response - -public class Code200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) - -A class (extended from the $ref class) that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## Code200Response1 -public static class Code200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
- -a class that deserializes responses, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/fakerefobjinquery/get/responses/FakerefobjinqueryGetCode200Response.md b/samples/client/petstore/java/docs/paths/fakerefobjinquery/get/responses/FakerefobjinqueryGetCode200Response.md new file mode 100644 index 00000000000..01ca962f7f5 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefobjinquery/get/responses/FakerefobjinqueryGetCode200Response.md @@ -0,0 +1,17 @@ +# FakerefobjinqueryGetCode200Response + +public class FakerefobjinqueryGetCode200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) + +A class (extended from the $ref class) that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [FakerefobjinqueryGetCode200Response.FakerefobjinqueryGetCode200Response1](#fakerefobjinquerygetcode200response1)
class that deserializes responses | + +## FakerefobjinqueryGetCode200Response1 +public static class FakerefobjinqueryGetCode200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
+ +a class that deserializes responses, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/fakerefsarraymodel/FakerefsarraymodelPost.md b/samples/client/petstore/java/docs/paths/fakerefsarraymodel/FakerefsarraymodelPost.md new file mode 100644 index 00000000000..0e158006b5c --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsarraymodel/FakerefsarraymodelPost.md @@ -0,0 +1,145 @@ +# FakerefsarraymodelPost + +public class FakerefsarraymodelPost + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Post](#post)
The class that has a post method to call the endpoint | +| interface | [ArrayModelOperation](#arraymodeloperation)
The interface that has a arrayModel method to call the endpoint | +| static class | [PostRequest](#postrequest)
The request inputs class | +| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | + +## Post +public static class Post extends ApiClient.ApiClient1 implements PostOperation
+ +a class that allows one to call the endpoint using a method named post + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakerefsarraymodel.post.FakerefsarraymodelPostRequestBody; +import org.openapijsonschematools.client.components.schemas.AnimalFarm; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefsarraymodel.post.responses.FakerefsarraymodelPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakerefsarraymodel.FakerefsarraymodelPost; +import org.openapijsonschematools.client.paths.fakerefsarraymodel.post.FakerefsarraymodelPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakerefsarraymodelPost.Post apiClient = new FakerefsarraymodelPost.Post(apiConfiguration, schemaConfiguration); + + +var request = new FakerefsarraymodelPost.PostRequestBuilder().build(); + +FakerefsarraymodelPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefsarraymodelPostResponses.EndpointFakerefsarraymodelPostCode200Response castResponse = (FakerefsarraymodelPostResponses.EndpointFakerefsarraymodelPostCode200Response) response; +FakerefsarraymodelPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakerefsarraymodelPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefsarraymodelPostResponses.EndpointResponse](../../paths/fakerefsarraymodel/post/FakerefsarraymodelPostResponses.md#endpointresponse) | post([PostRequest](#postrequest) request) | + +## ArrayModelOperation +public interface ArrayModelOperation
+ +an interface that allows one to call the endpoint using a method named arrayModel by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefsarraymodelPostResponses.EndpointResponse](../../paths/fakerefsarraymodel/post/FakerefsarraymodelPostResponses.md#endpointresponse) | arrayModel([PostRequest](#postrequest) request) | + +## PostRequest +public static class PostRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakerefsarraymodelPostRequestBody.@Nullable SealedRequestBody](../../paths/fakerefsarraymodel/post/FakerefsarraymodelPostRequestBody.md#sealedrequestbody) | requestBody
optional | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PostRequestBuilder +public static class PostRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PostRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | +| [PostRequestBuilder](#postrequestbuilder) | requestBody([FakerefsarraymodelPostRequestBody.SealedRequestBody](../../paths/fakerefsarraymodel/post/FakerefsarraymodelPostRequestBody.md#sealedrequestbody) requestBody)
sets the optional property | +| [PostRequestBuilder](#postrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [PostRequestBuilder](#postrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakerefsarraymodel/Post.md b/samples/client/petstore/java/docs/paths/fakerefsarraymodel/Post.md deleted file mode 100644 index 4bc163fabaa..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsarraymodel/Post.md +++ /dev/null @@ -1,134 +0,0 @@ -# Post - -public class Post - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Post1](#post1)
The class that has a post method to call the endpoint | -| static class | [PostRequest](#postrequest)
The request inputs class | -| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | - -## Post1 -public static class Post1 extends ApiClient.ApiClient1 implements PostOperation
- -a class that allows one to call the endpoint using a method named post - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakerefsarraymodel.post.RequestBody; -import org.openapijsonschematools.client.components.schemas.AnimalFarm; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakerefsarraymodel.post.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakerefsarraymodel.Post; -import org.openapijsonschematools.client.paths.fakerefsarraymodel.post.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Post.Post1 apiClient = new Post.Post1(apiConfiguration, schemaConfiguration); - - -var request = new PostRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.post(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -Code200Response.ApplicationjsonResponseBody deserializedBody = (Code200Response.ApplicationjsonResponseBody) castResponse.body; -// handle deserialized body here -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakerefsarraymodel/post/Responses.md#endpointresponse) | post([PostRequest](#postrequest) request) | - -## PostRequest -public static class PostRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fakerefsarraymodel/post/RequestBody.md#sealedrequestbody) | requestBody
optional | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PostRequestBuilder -public static class PostRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PostRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | -| [PostRequestBuilder](#postrequestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/fakerefsarraymodel/post/RequestBody.md#sealedrequestbody) requestBody)
sets the optional property | -| [PostRequestBuilder](#postrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [PostRequestBuilder](#postrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakerefsarraymodel/post/FakerefsarraymodelPostRequestBody.md b/samples/client/petstore/java/docs/paths/fakerefsarraymodel/post/FakerefsarraymodelPostRequestBody.md new file mode 100644 index 00000000000..b0185b64bfb --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsarraymodel/post/FakerefsarraymodelPostRequestBody.md @@ -0,0 +1,90 @@ +# FakerefsarraymodelPostRequestBody + +public class FakerefsarraymodelPostRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakerefsarraymodelPostRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakerefsarraymodelPostRequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| static class | [FakerefsarraymodelPostRequestBody.FakerefsarraymodelPostRequestBody1](#fakerefsarraymodelpostrequestbody1)
class that serializes request bodies | +| sealed interface | [FakerefsarraymodelPostRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [FakerefsarraymodelPostRequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsarraymodel/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsarraymodel/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## FakerefsarraymodelPostRequestBody1 +public static class FakerefsarraymodelPostRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakerefsarraymodelPostRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = false
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[ApplicationjsonRequestBody](#applicationjsonrequestbody) + +sealed interface that stores request contentType + validated schema data + +## ApplicationjsonRequestBody +public record ApplicationjsonRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonRequestBody(ApplicationjsonSchema.[AnimalFarm1Boxed](../../../components/schemas/AnimalFarm.md#animalfarm1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "application/json" | +| ApplicationjsonSchema.[AnimalFarm1Boxed](../../../components/schemas/AnimalFarm.md#animalfarm1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakerefsarraymodel/post/FakerefsarraymodelPostResponses.md b/samples/client/petstore/java/docs/paths/fakerefsarraymodel/post/FakerefsarraymodelPostResponses.md new file mode 100644 index 00000000000..b6954fefd6a --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsarraymodel/post/FakerefsarraymodelPostResponses.md @@ -0,0 +1,29 @@ +# FakerefsarraymodelPostResponses + +public class FakerefsarraymodelPostResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakerefsarraymodelPostCode200Response](#endpointfakerefsarraymodelpostcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakerefsarraymodelPostCode200Response](#endpointfakerefsarraymodelpostcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakerefsarraymodelPostCode200Response +public record EndpointFakerefsarraymodelPostCode200Response( + HttpResponse response, + [FakerefsarraymodelPostCode200Response.SealedResponseBody](../../../paths/fakerefsarraymodel/post/responses/FakerefsarraymodelPostCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakerefsarraymodel/post/RequestBody.md b/samples/client/petstore/java/docs/paths/fakerefsarraymodel/post/RequestBody.md deleted file mode 100644 index 759fe5a28e5..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsarraymodel/post/RequestBody.md +++ /dev/null @@ -1,90 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsarraymodel/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsarraymodel/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = false
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[ApplicationjsonRequestBody](#applicationjsonrequestbody) - -sealed interface that stores request contentType + validated schema data - -## ApplicationjsonRequestBody -public record ApplicationjsonRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonRequestBody(ApplicationjsonSchema.[AnimalFarm1Boxed](../../../components/schemas/AnimalFarm.md#animalfarm1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "application/json" | -| ApplicationjsonSchema.[AnimalFarm1Boxed](../../../components/schemas/AnimalFarm.md#animalfarm1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakerefsarraymodel/post/Responses.md b/samples/client/petstore/java/docs/paths/fakerefsarraymodel/post/Responses.md deleted file mode 100644 index 6297447a44e..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsarraymodel/post/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/fakerefsarraymodel/post/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakerefsarraymodel/post/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakerefsarraymodel/post/responses/Code200Response.md deleted file mode 100644 index 485cbd98023..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsarraymodel/post/responses/Code200Response.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsarraymodel/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsarraymodel/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.[AnimalFarm1Boxed](../../../../components/schemas/AnimalFarm.md#animalfarm1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.[AnimalFarm1Boxed](../../../../components/schemas/AnimalFarm.md#animalfarm1boxed) | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakerefsarraymodel/post/responses/FakerefsarraymodelPostCode200Response.md b/samples/client/petstore/java/docs/paths/fakerefsarraymodel/post/responses/FakerefsarraymodelPostCode200Response.md new file mode 100644 index 00000000000..1642d910d0d --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsarraymodel/post/responses/FakerefsarraymodelPostCode200Response.md @@ -0,0 +1,87 @@ +# FakerefsarraymodelPostCode200Response + +public class FakerefsarraymodelPostCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakerefsarraymodelPostCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakerefsarraymodelPostCode200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakerefsarraymodelPostCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakerefsarraymodelPostCode200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [FakerefsarraymodelPostCode200Response.FakerefsarraymodelPostCode200Response1](#fakerefsarraymodelpostcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsarraymodel/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsarraymodel/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.[AnimalFarm1Boxed](../../../../components/schemas/AnimalFarm.md#animalfarm1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.[AnimalFarm1Boxed](../../../../components/schemas/AnimalFarm.md#animalfarm1boxed) | body()
returns the body passed in in the constructor | + +## FakerefsarraymodelPostCode200Response1 +public static class FakerefsarraymodelPostCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakerefsarraymodelPostCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/FakerefsarrayofenumsPost.md b/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/FakerefsarrayofenumsPost.md new file mode 100644 index 00000000000..9544acc04e7 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/FakerefsarrayofenumsPost.md @@ -0,0 +1,145 @@ +# FakerefsarrayofenumsPost + +public class FakerefsarrayofenumsPost + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Post](#post)
The class that has a post method to call the endpoint | +| interface | [ArrayOfEnumsOperation](#arrayofenumsoperation)
The interface that has a arrayOfEnums method to call the endpoint | +| static class | [PostRequest](#postrequest)
The request inputs class | +| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | + +## Post +public static class Post extends ApiClient.ApiClient1 implements PostOperation
+ +a class that allows one to call the endpoint using a method named post + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakerefsarrayofenums.post.FakerefsarrayofenumsPostRequestBody; +import org.openapijsonschematools.client.components.schemas.ArrayOfEnums; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefsarrayofenums.post.responses.FakerefsarrayofenumsPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakerefsarrayofenums.FakerefsarrayofenumsPost; +import org.openapijsonschematools.client.paths.fakerefsarrayofenums.post.FakerefsarrayofenumsPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakerefsarrayofenumsPost.Post apiClient = new FakerefsarrayofenumsPost.Post(apiConfiguration, schemaConfiguration); + + +var request = new FakerefsarrayofenumsPost.PostRequestBuilder().build(); + +FakerefsarrayofenumsPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefsarrayofenumsPostResponses.EndpointFakerefsarrayofenumsPostCode200Response castResponse = (FakerefsarrayofenumsPostResponses.EndpointFakerefsarrayofenumsPostCode200Response) response; +FakerefsarrayofenumsPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakerefsarrayofenumsPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefsarrayofenumsPostResponses.EndpointResponse](../../paths/fakerefsarrayofenums/post/FakerefsarrayofenumsPostResponses.md#endpointresponse) | post([PostRequest](#postrequest) request) | + +## ArrayOfEnumsOperation +public interface ArrayOfEnumsOperation
+ +an interface that allows one to call the endpoint using a method named arrayOfEnums by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefsarrayofenumsPostResponses.EndpointResponse](../../paths/fakerefsarrayofenums/post/FakerefsarrayofenumsPostResponses.md#endpointresponse) | arrayOfEnums([PostRequest](#postrequest) request) | + +## PostRequest +public static class PostRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakerefsarrayofenumsPostRequestBody.@Nullable SealedRequestBody](../../paths/fakerefsarrayofenums/post/FakerefsarrayofenumsPostRequestBody.md#sealedrequestbody) | requestBody
optional | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PostRequestBuilder +public static class PostRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PostRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | +| [PostRequestBuilder](#postrequestbuilder) | requestBody([FakerefsarrayofenumsPostRequestBody.SealedRequestBody](../../paths/fakerefsarrayofenums/post/FakerefsarrayofenumsPostRequestBody.md#sealedrequestbody) requestBody)
sets the optional property | +| [PostRequestBuilder](#postrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [PostRequestBuilder](#postrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/Post.md b/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/Post.md deleted file mode 100644 index 200542c4704..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/Post.md +++ /dev/null @@ -1,134 +0,0 @@ -# Post - -public class Post - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Post1](#post1)
The class that has a post method to call the endpoint | -| static class | [PostRequest](#postrequest)
The request inputs class | -| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | - -## Post1 -public static class Post1 extends ApiClient.ApiClient1 implements PostOperation
- -a class that allows one to call the endpoint using a method named post - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakerefsarrayofenums.post.RequestBody; -import org.openapijsonschematools.client.components.schemas.ArrayOfEnums; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakerefsarrayofenums.post.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakerefsarrayofenums.Post; -import org.openapijsonschematools.client.paths.fakerefsarrayofenums.post.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Post.Post1 apiClient = new Post.Post1(apiConfiguration, schemaConfiguration); - - -var request = new PostRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.post(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -Code200Response.ApplicationjsonResponseBody deserializedBody = (Code200Response.ApplicationjsonResponseBody) castResponse.body; -// handle deserialized body here -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakerefsarrayofenums/post/Responses.md#endpointresponse) | post([PostRequest](#postrequest) request) | - -## PostRequest -public static class PostRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fakerefsarrayofenums/post/RequestBody.md#sealedrequestbody) | requestBody
optional | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PostRequestBuilder -public static class PostRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PostRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | -| [PostRequestBuilder](#postrequestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/fakerefsarrayofenums/post/RequestBody.md#sealedrequestbody) requestBody)
sets the optional property | -| [PostRequestBuilder](#postrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [PostRequestBuilder](#postrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/post/FakerefsarrayofenumsPostRequestBody.md b/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/post/FakerefsarrayofenumsPostRequestBody.md new file mode 100644 index 00000000000..985f2555e68 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/post/FakerefsarrayofenumsPostRequestBody.md @@ -0,0 +1,90 @@ +# FakerefsarrayofenumsPostRequestBody + +public class FakerefsarrayofenumsPostRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakerefsarrayofenumsPostRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakerefsarrayofenumsPostRequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| static class | [FakerefsarrayofenumsPostRequestBody.FakerefsarrayofenumsPostRequestBody1](#fakerefsarrayofenumspostrequestbody1)
class that serializes request bodies | +| sealed interface | [FakerefsarrayofenumsPostRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [FakerefsarrayofenumsPostRequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsarrayofenums/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsarrayofenums/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## FakerefsarrayofenumsPostRequestBody1 +public static class FakerefsarrayofenumsPostRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakerefsarrayofenumsPostRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = false
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[ApplicationjsonRequestBody](#applicationjsonrequestbody) + +sealed interface that stores request contentType + validated schema data + +## ApplicationjsonRequestBody +public record ApplicationjsonRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonRequestBody(ApplicationjsonSchema.[ArrayOfEnums1Boxed](../../../components/schemas/ArrayOfEnums.md#arrayofenums1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "application/json" | +| ApplicationjsonSchema.[ArrayOfEnums1Boxed](../../../components/schemas/ArrayOfEnums.md#arrayofenums1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/post/FakerefsarrayofenumsPostResponses.md b/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/post/FakerefsarrayofenumsPostResponses.md new file mode 100644 index 00000000000..45c6dbc66be --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/post/FakerefsarrayofenumsPostResponses.md @@ -0,0 +1,29 @@ +# FakerefsarrayofenumsPostResponses + +public class FakerefsarrayofenumsPostResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakerefsarrayofenumsPostCode200Response](#endpointfakerefsarrayofenumspostcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakerefsarrayofenumsPostCode200Response](#endpointfakerefsarrayofenumspostcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakerefsarrayofenumsPostCode200Response +public record EndpointFakerefsarrayofenumsPostCode200Response( + HttpResponse response, + [FakerefsarrayofenumsPostCode200Response.SealedResponseBody](../../../paths/fakerefsarrayofenums/post/responses/FakerefsarrayofenumsPostCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/post/RequestBody.md b/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/post/RequestBody.md deleted file mode 100644 index 8cdc705b119..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/post/RequestBody.md +++ /dev/null @@ -1,90 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsarrayofenums/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsarrayofenums/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = false
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[ApplicationjsonRequestBody](#applicationjsonrequestbody) - -sealed interface that stores request contentType + validated schema data - -## ApplicationjsonRequestBody -public record ApplicationjsonRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonRequestBody(ApplicationjsonSchema.[ArrayOfEnums1Boxed](../../../components/schemas/ArrayOfEnums.md#arrayofenums1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "application/json" | -| ApplicationjsonSchema.[ArrayOfEnums1Boxed](../../../components/schemas/ArrayOfEnums.md#arrayofenums1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/post/Responses.md b/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/post/Responses.md deleted file mode 100644 index 7b6fc2c175b..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/post/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/fakerefsarrayofenums/post/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/post/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/post/responses/Code200Response.md deleted file mode 100644 index dfa9fdf6f04..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/post/responses/Code200Response.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsarrayofenums/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsarrayofenums/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.[ArrayOfEnums1Boxed](../../../../components/schemas/ArrayOfEnums.md#arrayofenums1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.[ArrayOfEnums1Boxed](../../../../components/schemas/ArrayOfEnums.md#arrayofenums1boxed) | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/post/responses/FakerefsarrayofenumsPostCode200Response.md b/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/post/responses/FakerefsarrayofenumsPostCode200Response.md new file mode 100644 index 00000000000..0fac3a28e7a --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsarrayofenums/post/responses/FakerefsarrayofenumsPostCode200Response.md @@ -0,0 +1,87 @@ +# FakerefsarrayofenumsPostCode200Response + +public class FakerefsarrayofenumsPostCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakerefsarrayofenumsPostCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakerefsarrayofenumsPostCode200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakerefsarrayofenumsPostCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakerefsarrayofenumsPostCode200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [FakerefsarrayofenumsPostCode200Response.FakerefsarrayofenumsPostCode200Response1](#fakerefsarrayofenumspostcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsarrayofenums/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsarrayofenums/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.[ArrayOfEnums1Boxed](../../../../components/schemas/ArrayOfEnums.md#arrayofenums1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.[ArrayOfEnums1Boxed](../../../../components/schemas/ArrayOfEnums.md#arrayofenums1boxed) | body()
returns the body passed in in the constructor | + +## FakerefsarrayofenumsPostCode200Response1 +public static class FakerefsarrayofenumsPostCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakerefsarrayofenumsPostCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakerefsboolean/FakerefsbooleanPost.md b/samples/client/petstore/java/docs/paths/fakerefsboolean/FakerefsbooleanPost.md new file mode 100644 index 00000000000..e89fc899063 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsboolean/FakerefsbooleanPost.md @@ -0,0 +1,145 @@ +# FakerefsbooleanPost + +public class FakerefsbooleanPost + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Post](#post)
The class that has a post method to call the endpoint | +| interface | [ModelBooleanOperation](#modelbooleanoperation)
The interface that has a modelBoolean method to call the endpoint | +| static class | [PostRequest](#postrequest)
The request inputs class | +| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | + +## Post +public static class Post extends ApiClient.ApiClient1 implements PostOperation
+ +a class that allows one to call the endpoint using a method named post + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakerefsboolean.post.FakerefsbooleanPostRequestBody; +import org.openapijsonschematools.client.components.schemas.BooleanSchema; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefsboolean.post.responses.FakerefsbooleanPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakerefsboolean.FakerefsbooleanPost; +import org.openapijsonschematools.client.paths.fakerefsboolean.post.FakerefsbooleanPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakerefsbooleanPost.Post apiClient = new FakerefsbooleanPost.Post(apiConfiguration, schemaConfiguration); + + +var request = new FakerefsbooleanPost.PostRequestBuilder().build(); + +FakerefsbooleanPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefsbooleanPostResponses.EndpointFakerefsbooleanPostCode200Response castResponse = (FakerefsbooleanPostResponses.EndpointFakerefsbooleanPostCode200Response) response; +FakerefsbooleanPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakerefsbooleanPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefsbooleanPostResponses.EndpointResponse](../../paths/fakerefsboolean/post/FakerefsbooleanPostResponses.md#endpointresponse) | post([PostRequest](#postrequest) request) | + +## ModelBooleanOperation +public interface ModelBooleanOperation
+ +an interface that allows one to call the endpoint using a method named modelBoolean by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefsbooleanPostResponses.EndpointResponse](../../paths/fakerefsboolean/post/FakerefsbooleanPostResponses.md#endpointresponse) | modelBoolean([PostRequest](#postrequest) request) | + +## PostRequest +public static class PostRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakerefsbooleanPostRequestBody.@Nullable SealedRequestBody](../../paths/fakerefsboolean/post/FakerefsbooleanPostRequestBody.md#sealedrequestbody) | requestBody
optional | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PostRequestBuilder +public static class PostRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PostRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | +| [PostRequestBuilder](#postrequestbuilder) | requestBody([FakerefsbooleanPostRequestBody.SealedRequestBody](../../paths/fakerefsboolean/post/FakerefsbooleanPostRequestBody.md#sealedrequestbody) requestBody)
sets the optional property | +| [PostRequestBuilder](#postrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [PostRequestBuilder](#postrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakerefsboolean/Post.md b/samples/client/petstore/java/docs/paths/fakerefsboolean/Post.md deleted file mode 100644 index 7df44e941e1..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsboolean/Post.md +++ /dev/null @@ -1,134 +0,0 @@ -# Post - -public class Post - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Post1](#post1)
The class that has a post method to call the endpoint | -| static class | [PostRequest](#postrequest)
The request inputs class | -| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | - -## Post1 -public static class Post1 extends ApiClient.ApiClient1 implements PostOperation
- -a class that allows one to call the endpoint using a method named post - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakerefsboolean.post.RequestBody; -import org.openapijsonschematools.client.components.schemas.BooleanSchema; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakerefsboolean.post.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakerefsboolean.Post; -import org.openapijsonschematools.client.paths.fakerefsboolean.post.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Post.Post1 apiClient = new Post.Post1(apiConfiguration, schemaConfiguration); - - -var request = new PostRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.post(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -Code200Response.ApplicationjsonResponseBody deserializedBody = (Code200Response.ApplicationjsonResponseBody) castResponse.body; -// handle deserialized body here -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakerefsboolean/post/Responses.md#endpointresponse) | post([PostRequest](#postrequest) request) | - -## PostRequest -public static class PostRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fakerefsboolean/post/RequestBody.md#sealedrequestbody) | requestBody
optional | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PostRequestBuilder -public static class PostRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PostRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | -| [PostRequestBuilder](#postrequestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/fakerefsboolean/post/RequestBody.md#sealedrequestbody) requestBody)
sets the optional property | -| [PostRequestBuilder](#postrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [PostRequestBuilder](#postrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakerefsboolean/post/FakerefsbooleanPostRequestBody.md b/samples/client/petstore/java/docs/paths/fakerefsboolean/post/FakerefsbooleanPostRequestBody.md new file mode 100644 index 00000000000..a03b0522105 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsboolean/post/FakerefsbooleanPostRequestBody.md @@ -0,0 +1,90 @@ +# FakerefsbooleanPostRequestBody + +public class FakerefsbooleanPostRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakerefsbooleanPostRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakerefsbooleanPostRequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| static class | [FakerefsbooleanPostRequestBody.FakerefsbooleanPostRequestBody1](#fakerefsbooleanpostrequestbody1)
class that serializes request bodies | +| sealed interface | [FakerefsbooleanPostRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [FakerefsbooleanPostRequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsboolean/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsboolean/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## FakerefsbooleanPostRequestBody1 +public static class FakerefsbooleanPostRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakerefsbooleanPostRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = false
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[ApplicationjsonRequestBody](#applicationjsonrequestbody) + +sealed interface that stores request contentType + validated schema data + +## ApplicationjsonRequestBody +public record ApplicationjsonRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonRequestBody(ApplicationjsonSchema.BooleanJsonSchema1Boxed body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "application/json" | +| ApplicationjsonSchema.BooleanJsonSchema1Boxed | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakerefsboolean/post/FakerefsbooleanPostResponses.md b/samples/client/petstore/java/docs/paths/fakerefsboolean/post/FakerefsbooleanPostResponses.md new file mode 100644 index 00000000000..6a39490ec8f --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsboolean/post/FakerefsbooleanPostResponses.md @@ -0,0 +1,29 @@ +# FakerefsbooleanPostResponses + +public class FakerefsbooleanPostResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakerefsbooleanPostCode200Response](#endpointfakerefsbooleanpostcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakerefsbooleanPostCode200Response](#endpointfakerefsbooleanpostcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakerefsbooleanPostCode200Response +public record EndpointFakerefsbooleanPostCode200Response( + HttpResponse response, + [FakerefsbooleanPostCode200Response.SealedResponseBody](../../../paths/fakerefsboolean/post/responses/FakerefsbooleanPostCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakerefsboolean/post/RequestBody.md b/samples/client/petstore/java/docs/paths/fakerefsboolean/post/RequestBody.md deleted file mode 100644 index 6097f74bea9..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsboolean/post/RequestBody.md +++ /dev/null @@ -1,90 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsboolean/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsboolean/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = false
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[ApplicationjsonRequestBody](#applicationjsonrequestbody) - -sealed interface that stores request contentType + validated schema data - -## ApplicationjsonRequestBody -public record ApplicationjsonRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonRequestBody(ApplicationjsonSchema.BooleanJsonSchema1Boxed body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "application/json" | -| ApplicationjsonSchema.BooleanJsonSchema1Boxed | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakerefsboolean/post/Responses.md b/samples/client/petstore/java/docs/paths/fakerefsboolean/post/Responses.md deleted file mode 100644 index 5d06682ddec..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsboolean/post/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/fakerefsboolean/post/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakerefsboolean/post/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakerefsboolean/post/responses/Code200Response.md deleted file mode 100644 index 9929792ca0e..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsboolean/post/responses/Code200Response.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsboolean/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsboolean/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.BooleanJsonSchema1Boxed body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.BooleanJsonSchema1Boxed | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakerefsboolean/post/responses/FakerefsbooleanPostCode200Response.md b/samples/client/petstore/java/docs/paths/fakerefsboolean/post/responses/FakerefsbooleanPostCode200Response.md new file mode 100644 index 00000000000..c85cd66f858 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsboolean/post/responses/FakerefsbooleanPostCode200Response.md @@ -0,0 +1,87 @@ +# FakerefsbooleanPostCode200Response + +public class FakerefsbooleanPostCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakerefsbooleanPostCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakerefsbooleanPostCode200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakerefsbooleanPostCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakerefsbooleanPostCode200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [FakerefsbooleanPostCode200Response.FakerefsbooleanPostCode200Response1](#fakerefsbooleanpostcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsboolean/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsboolean/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.BooleanJsonSchema1Boxed body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.BooleanJsonSchema1Boxed | body()
returns the body passed in in the constructor | + +## FakerefsbooleanPostCode200Response1 +public static class FakerefsbooleanPostCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakerefsbooleanPostCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/FakerefscomposedoneofnumberwithvalidationsPost.md b/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/FakerefscomposedoneofnumberwithvalidationsPost.md new file mode 100644 index 00000000000..2bac04d35ba --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/FakerefscomposedoneofnumberwithvalidationsPost.md @@ -0,0 +1,145 @@ +# FakerefscomposedoneofnumberwithvalidationsPost + +public class FakerefscomposedoneofnumberwithvalidationsPost + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Post](#post)
The class that has a post method to call the endpoint | +| interface | [ComposedOneOfDifferentTypesOperation](#composedoneofdifferenttypesoperation)
The interface that has a composedOneOfDifferentTypes method to call the endpoint | +| static class | [PostRequest](#postrequest)
The request inputs class | +| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | + +## Post +public static class Post extends ApiClient.ApiClient1 implements PostOperation
+ +a class that allows one to call the endpoint using a method named post + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post.FakerefscomposedoneofnumberwithvalidationsPostRequestBody; +import org.openapijsonschematools.client.components.schemas.ComposedOneOfDifferentTypes; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post.responses.FakerefscomposedoneofnumberwithvalidationsPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.FakerefscomposedoneofnumberwithvalidationsPost; +import org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post.FakerefscomposedoneofnumberwithvalidationsPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakerefscomposedoneofnumberwithvalidationsPost.Post apiClient = new FakerefscomposedoneofnumberwithvalidationsPost.Post(apiConfiguration, schemaConfiguration); + + +var request = new FakerefscomposedoneofnumberwithvalidationsPost.PostRequestBuilder().build(); + +FakerefscomposedoneofnumberwithvalidationsPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefscomposedoneofnumberwithvalidationsPostResponses.EndpointFakerefscomposedoneofnumberwithvalidationsPostCode200Response castResponse = (FakerefscomposedoneofnumberwithvalidationsPostResponses.EndpointFakerefscomposedoneofnumberwithvalidationsPostCode200Response) response; +FakerefscomposedoneofnumberwithvalidationsPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakerefscomposedoneofnumberwithvalidationsPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefscomposedoneofnumberwithvalidationsPostResponses.EndpointResponse](../../paths/fakerefscomposedoneofnumberwithvalidations/post/FakerefscomposedoneofnumberwithvalidationsPostResponses.md#endpointresponse) | post([PostRequest](#postrequest) request) | + +## ComposedOneOfDifferentTypesOperation +public interface ComposedOneOfDifferentTypesOperation
+ +an interface that allows one to call the endpoint using a method named composedOneOfDifferentTypes by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefscomposedoneofnumberwithvalidationsPostResponses.EndpointResponse](../../paths/fakerefscomposedoneofnumberwithvalidations/post/FakerefscomposedoneofnumberwithvalidationsPostResponses.md#endpointresponse) | composedOneOfDifferentTypes([PostRequest](#postrequest) request) | + +## PostRequest +public static class PostRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakerefscomposedoneofnumberwithvalidationsPostRequestBody.@Nullable SealedRequestBody](../../paths/fakerefscomposedoneofnumberwithvalidations/post/FakerefscomposedoneofnumberwithvalidationsPostRequestBody.md#sealedrequestbody) | requestBody
optional | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PostRequestBuilder +public static class PostRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PostRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | +| [PostRequestBuilder](#postrequestbuilder) | requestBody([FakerefscomposedoneofnumberwithvalidationsPostRequestBody.SealedRequestBody](../../paths/fakerefscomposedoneofnumberwithvalidations/post/FakerefscomposedoneofnumberwithvalidationsPostRequestBody.md#sealedrequestbody) requestBody)
sets the optional property | +| [PostRequestBuilder](#postrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [PostRequestBuilder](#postrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/Post.md b/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/Post.md deleted file mode 100644 index 4b26f154cf2..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/Post.md +++ /dev/null @@ -1,134 +0,0 @@ -# Post - -public class Post - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Post1](#post1)
The class that has a post method to call the endpoint | -| static class | [PostRequest](#postrequest)
The request inputs class | -| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | - -## Post1 -public static class Post1 extends ApiClient.ApiClient1 implements PostOperation
- -a class that allows one to call the endpoint using a method named post - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post.RequestBody; -import org.openapijsonschematools.client.components.schemas.ComposedOneOfDifferentTypes; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.Post; -import org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Post.Post1 apiClient = new Post.Post1(apiConfiguration, schemaConfiguration); - - -var request = new PostRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.post(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -Code200Response.ApplicationjsonResponseBody deserializedBody = (Code200Response.ApplicationjsonResponseBody) castResponse.body; -// handle deserialized body here -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakerefscomposedoneofnumberwithvalidations/post/Responses.md#endpointresponse) | post([PostRequest](#postrequest) request) | - -## PostRequest -public static class PostRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fakerefscomposedoneofnumberwithvalidations/post/RequestBody.md#sealedrequestbody) | requestBody
optional | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PostRequestBuilder -public static class PostRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PostRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | -| [PostRequestBuilder](#postrequestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/fakerefscomposedoneofnumberwithvalidations/post/RequestBody.md#sealedrequestbody) requestBody)
sets the optional property | -| [PostRequestBuilder](#postrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [PostRequestBuilder](#postrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/post/FakerefscomposedoneofnumberwithvalidationsPostRequestBody.md b/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/post/FakerefscomposedoneofnumberwithvalidationsPostRequestBody.md new file mode 100644 index 00000000000..f93cdc72bd3 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/post/FakerefscomposedoneofnumberwithvalidationsPostRequestBody.md @@ -0,0 +1,90 @@ +# FakerefscomposedoneofnumberwithvalidationsPostRequestBody + +public class FakerefscomposedoneofnumberwithvalidationsPostRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakerefscomposedoneofnumberwithvalidationsPostRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakerefscomposedoneofnumberwithvalidationsPostRequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| static class | [FakerefscomposedoneofnumberwithvalidationsPostRequestBody.FakerefscomposedoneofnumberwithvalidationsPostRequestBody1](#fakerefscomposedoneofnumberwithvalidationspostrequestbody1)
class that serializes request bodies | +| sealed interface | [FakerefscomposedoneofnumberwithvalidationsPostRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [FakerefscomposedoneofnumberwithvalidationsPostRequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefscomposedoneofnumberwithvalidations/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefscomposedoneofnumberwithvalidations/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## FakerefscomposedoneofnumberwithvalidationsPostRequestBody1 +public static class FakerefscomposedoneofnumberwithvalidationsPostRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakerefscomposedoneofnumberwithvalidationsPostRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = false
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[ApplicationjsonRequestBody](#applicationjsonrequestbody) + +sealed interface that stores request contentType + validated schema data + +## ApplicationjsonRequestBody +public record ApplicationjsonRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonRequestBody(ApplicationjsonSchema.[ComposedOneOfDifferentTypes1Boxed](../../../components/schemas/ComposedOneOfDifferentTypes.md#composedoneofdifferenttypes1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "application/json" | +| ApplicationjsonSchema.[ComposedOneOfDifferentTypes1Boxed](../../../components/schemas/ComposedOneOfDifferentTypes.md#composedoneofdifferenttypes1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/post/FakerefscomposedoneofnumberwithvalidationsPostResponses.md b/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/post/FakerefscomposedoneofnumberwithvalidationsPostResponses.md new file mode 100644 index 00000000000..e692dc2a79f --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/post/FakerefscomposedoneofnumberwithvalidationsPostResponses.md @@ -0,0 +1,29 @@ +# FakerefscomposedoneofnumberwithvalidationsPostResponses + +public class FakerefscomposedoneofnumberwithvalidationsPostResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakerefscomposedoneofnumberwithvalidationsPostCode200Response](#endpointfakerefscomposedoneofnumberwithvalidationspostcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakerefscomposedoneofnumberwithvalidationsPostCode200Response](#endpointfakerefscomposedoneofnumberwithvalidationspostcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakerefscomposedoneofnumberwithvalidationsPostCode200Response +public record EndpointFakerefscomposedoneofnumberwithvalidationsPostCode200Response( + HttpResponse response, + [FakerefscomposedoneofnumberwithvalidationsPostCode200Response.SealedResponseBody](../../../paths/fakerefscomposedoneofnumberwithvalidations/post/responses/FakerefscomposedoneofnumberwithvalidationsPostCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/post/RequestBody.md b/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/post/RequestBody.md deleted file mode 100644 index 0e61ede331b..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/post/RequestBody.md +++ /dev/null @@ -1,90 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefscomposedoneofnumberwithvalidations/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefscomposedoneofnumberwithvalidations/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = false
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[ApplicationjsonRequestBody](#applicationjsonrequestbody) - -sealed interface that stores request contentType + validated schema data - -## ApplicationjsonRequestBody -public record ApplicationjsonRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonRequestBody(ApplicationjsonSchema.[ComposedOneOfDifferentTypes1Boxed](../../../components/schemas/ComposedOneOfDifferentTypes.md#composedoneofdifferenttypes1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "application/json" | -| ApplicationjsonSchema.[ComposedOneOfDifferentTypes1Boxed](../../../components/schemas/ComposedOneOfDifferentTypes.md#composedoneofdifferenttypes1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/post/Responses.md b/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/post/Responses.md deleted file mode 100644 index b5d43f7cac0..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/post/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/fakerefscomposedoneofnumberwithvalidations/post/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/Code200Response.md deleted file mode 100644 index 1145364df95..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/Code200Response.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefscomposedoneofnumberwithvalidations/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefscomposedoneofnumberwithvalidations/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.[ComposedOneOfDifferentTypes1Boxed](../../../../components/schemas/ComposedOneOfDifferentTypes.md#composedoneofdifferenttypes1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.[ComposedOneOfDifferentTypes1Boxed](../../../../components/schemas/ComposedOneOfDifferentTypes.md#composedoneofdifferenttypes1boxed) | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/FakerefscomposedoneofnumberwithvalidationsPostCode200Response.md b/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/FakerefscomposedoneofnumberwithvalidationsPostCode200Response.md new file mode 100644 index 00000000000..9ba53ab13ea --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/FakerefscomposedoneofnumberwithvalidationsPostCode200Response.md @@ -0,0 +1,87 @@ +# FakerefscomposedoneofnumberwithvalidationsPostCode200Response + +public class FakerefscomposedoneofnumberwithvalidationsPostCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakerefscomposedoneofnumberwithvalidationsPostCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakerefscomposedoneofnumberwithvalidationsPostCode200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakerefscomposedoneofnumberwithvalidationsPostCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakerefscomposedoneofnumberwithvalidationsPostCode200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [FakerefscomposedoneofnumberwithvalidationsPostCode200Response.FakerefscomposedoneofnumberwithvalidationsPostCode200Response1](#fakerefscomposedoneofnumberwithvalidationspostcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefscomposedoneofnumberwithvalidations/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefscomposedoneofnumberwithvalidations/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.[ComposedOneOfDifferentTypes1Boxed](../../../../components/schemas/ComposedOneOfDifferentTypes.md#composedoneofdifferenttypes1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.[ComposedOneOfDifferentTypes1Boxed](../../../../components/schemas/ComposedOneOfDifferentTypes.md#composedoneofdifferenttypes1boxed) | body()
returns the body passed in in the constructor | + +## FakerefscomposedoneofnumberwithvalidationsPostCode200Response1 +public static class FakerefscomposedoneofnumberwithvalidationsPostCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakerefscomposedoneofnumberwithvalidationsPostCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakerefsenum/FakerefsenumPost.md b/samples/client/petstore/java/docs/paths/fakerefsenum/FakerefsenumPost.md new file mode 100644 index 00000000000..7b79118eb6b --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsenum/FakerefsenumPost.md @@ -0,0 +1,145 @@ +# FakerefsenumPost + +public class FakerefsenumPost + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Post](#post)
The class that has a post method to call the endpoint | +| interface | [StringEnumOperation](#stringenumoperation)
The interface that has a stringEnum method to call the endpoint | +| static class | [PostRequest](#postrequest)
The request inputs class | +| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | + +## Post +public static class Post extends ApiClient.ApiClient1 implements PostOperation
+ +a class that allows one to call the endpoint using a method named post + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakerefsenum.post.FakerefsenumPostRequestBody; +import org.openapijsonschematools.client.components.schemas.StringEnum; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefsenum.post.responses.FakerefsenumPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakerefsenum.FakerefsenumPost; +import org.openapijsonschematools.client.paths.fakerefsenum.post.FakerefsenumPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakerefsenumPost.Post apiClient = new FakerefsenumPost.Post(apiConfiguration, schemaConfiguration); + + +var request = new FakerefsenumPost.PostRequestBuilder().build(); + +FakerefsenumPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefsenumPostResponses.EndpointFakerefsenumPostCode200Response castResponse = (FakerefsenumPostResponses.EndpointFakerefsenumPostCode200Response) response; +FakerefsenumPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakerefsenumPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefsenumPostResponses.EndpointResponse](../../paths/fakerefsenum/post/FakerefsenumPostResponses.md#endpointresponse) | post([PostRequest](#postrequest) request) | + +## StringEnumOperation +public interface StringEnumOperation
+ +an interface that allows one to call the endpoint using a method named stringEnum by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefsenumPostResponses.EndpointResponse](../../paths/fakerefsenum/post/FakerefsenumPostResponses.md#endpointresponse) | stringEnum([PostRequest](#postrequest) request) | + +## PostRequest +public static class PostRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakerefsenumPostRequestBody.@Nullable SealedRequestBody](../../paths/fakerefsenum/post/FakerefsenumPostRequestBody.md#sealedrequestbody) | requestBody
optional | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PostRequestBuilder +public static class PostRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PostRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | +| [PostRequestBuilder](#postrequestbuilder) | requestBody([FakerefsenumPostRequestBody.SealedRequestBody](../../paths/fakerefsenum/post/FakerefsenumPostRequestBody.md#sealedrequestbody) requestBody)
sets the optional property | +| [PostRequestBuilder](#postrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [PostRequestBuilder](#postrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakerefsenum/Post.md b/samples/client/petstore/java/docs/paths/fakerefsenum/Post.md deleted file mode 100644 index 9c6f0dcd85f..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsenum/Post.md +++ /dev/null @@ -1,134 +0,0 @@ -# Post - -public class Post - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Post1](#post1)
The class that has a post method to call the endpoint | -| static class | [PostRequest](#postrequest)
The request inputs class | -| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | - -## Post1 -public static class Post1 extends ApiClient.ApiClient1 implements PostOperation
- -a class that allows one to call the endpoint using a method named post - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakerefsenum.post.RequestBody; -import org.openapijsonschematools.client.components.schemas.StringEnum; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakerefsenum.post.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakerefsenum.Post; -import org.openapijsonschematools.client.paths.fakerefsenum.post.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Post.Post1 apiClient = new Post.Post1(apiConfiguration, schemaConfiguration); - - -var request = new PostRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.post(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -Code200Response.ApplicationjsonResponseBody deserializedBody = (Code200Response.ApplicationjsonResponseBody) castResponse.body; -// handle deserialized body here -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakerefsenum/post/Responses.md#endpointresponse) | post([PostRequest](#postrequest) request) | - -## PostRequest -public static class PostRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fakerefsenum/post/RequestBody.md#sealedrequestbody) | requestBody
optional | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PostRequestBuilder -public static class PostRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PostRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | -| [PostRequestBuilder](#postrequestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/fakerefsenum/post/RequestBody.md#sealedrequestbody) requestBody)
sets the optional property | -| [PostRequestBuilder](#postrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [PostRequestBuilder](#postrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakerefsenum/post/FakerefsenumPostRequestBody.md b/samples/client/petstore/java/docs/paths/fakerefsenum/post/FakerefsenumPostRequestBody.md new file mode 100644 index 00000000000..37075fb26b1 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsenum/post/FakerefsenumPostRequestBody.md @@ -0,0 +1,90 @@ +# FakerefsenumPostRequestBody + +public class FakerefsenumPostRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakerefsenumPostRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakerefsenumPostRequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| static class | [FakerefsenumPostRequestBody.FakerefsenumPostRequestBody1](#fakerefsenumpostrequestbody1)
class that serializes request bodies | +| sealed interface | [FakerefsenumPostRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [FakerefsenumPostRequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsenum/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsenum/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## FakerefsenumPostRequestBody1 +public static class FakerefsenumPostRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakerefsenumPostRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = false
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[ApplicationjsonRequestBody](#applicationjsonrequestbody) + +sealed interface that stores request contentType + validated schema data + +## ApplicationjsonRequestBody +public record ApplicationjsonRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonRequestBody(ApplicationjsonSchema.[StringEnum1Boxed](../../../components/schemas/StringEnum.md#stringenum1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "application/json" | +| ApplicationjsonSchema.[StringEnum1Boxed](../../../components/schemas/StringEnum.md#stringenum1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakerefsenum/post/FakerefsenumPostResponses.md b/samples/client/petstore/java/docs/paths/fakerefsenum/post/FakerefsenumPostResponses.md new file mode 100644 index 00000000000..90cd1977718 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsenum/post/FakerefsenumPostResponses.md @@ -0,0 +1,29 @@ +# FakerefsenumPostResponses + +public class FakerefsenumPostResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakerefsenumPostCode200Response](#endpointfakerefsenumpostcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakerefsenumPostCode200Response](#endpointfakerefsenumpostcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakerefsenumPostCode200Response +public record EndpointFakerefsenumPostCode200Response( + HttpResponse response, + [FakerefsenumPostCode200Response.SealedResponseBody](../../../paths/fakerefsenum/post/responses/FakerefsenumPostCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakerefsenum/post/RequestBody.md b/samples/client/petstore/java/docs/paths/fakerefsenum/post/RequestBody.md deleted file mode 100644 index 385c2e4a878..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsenum/post/RequestBody.md +++ /dev/null @@ -1,90 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsenum/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsenum/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = false
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[ApplicationjsonRequestBody](#applicationjsonrequestbody) - -sealed interface that stores request contentType + validated schema data - -## ApplicationjsonRequestBody -public record ApplicationjsonRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonRequestBody(ApplicationjsonSchema.[StringEnum1Boxed](../../../components/schemas/StringEnum.md#stringenum1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "application/json" | -| ApplicationjsonSchema.[StringEnum1Boxed](../../../components/schemas/StringEnum.md#stringenum1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakerefsenum/post/Responses.md b/samples/client/petstore/java/docs/paths/fakerefsenum/post/Responses.md deleted file mode 100644 index ef682cd6d0e..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsenum/post/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/fakerefsenum/post/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakerefsenum/post/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakerefsenum/post/responses/Code200Response.md deleted file mode 100644 index 4d7406fe83c..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsenum/post/responses/Code200Response.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsenum/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsenum/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.[StringEnum1Boxed](../../../../components/schemas/StringEnum.md#stringenum1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.[StringEnum1Boxed](../../../../components/schemas/StringEnum.md#stringenum1boxed) | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakerefsenum/post/responses/FakerefsenumPostCode200Response.md b/samples/client/petstore/java/docs/paths/fakerefsenum/post/responses/FakerefsenumPostCode200Response.md new file mode 100644 index 00000000000..b5f96c362a3 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsenum/post/responses/FakerefsenumPostCode200Response.md @@ -0,0 +1,87 @@ +# FakerefsenumPostCode200Response + +public class FakerefsenumPostCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakerefsenumPostCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakerefsenumPostCode200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakerefsenumPostCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakerefsenumPostCode200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [FakerefsenumPostCode200Response.FakerefsenumPostCode200Response1](#fakerefsenumpostcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsenum/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsenum/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.[StringEnum1Boxed](../../../../components/schemas/StringEnum.md#stringenum1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.[StringEnum1Boxed](../../../../components/schemas/StringEnum.md#stringenum1boxed) | body()
returns the body passed in in the constructor | + +## FakerefsenumPostCode200Response1 +public static class FakerefsenumPostCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakerefsenumPostCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakerefsmammal/FakerefsmammalPost.md b/samples/client/petstore/java/docs/paths/fakerefsmammal/FakerefsmammalPost.md new file mode 100644 index 00000000000..ea741896a7e --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsmammal/FakerefsmammalPost.md @@ -0,0 +1,176 @@ +# FakerefsmammalPost + +public class FakerefsmammalPost + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Post](#post)
The class that has a post method to call the endpoint | +| interface | [MammalOperation](#mammaloperation)
The interface that has a mammal method to call the endpoint | +| static class | [PostRequest](#postrequest)
The final request inputs class | +| static class | [PostNullableRequest](#postnullablerequest)
The initial request inputs class | +| static class | [Post0RequestBuilder](#post0requestbuilder)
A builder for the request input class | +| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | + +## Post +public static class Post extends ApiClient.ApiClient1 implements PostOperation
+ +a class that allows one to call the endpoint using a method named post + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakerefsmammal.post.FakerefsmammalPostRequestBody; +import org.openapijsonschematools.client.components.schemas.Mammal; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefsmammal.post.responses.FakerefsmammalPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakerefsmammal.FakerefsmammalPost; +import org.openapijsonschematools.client.paths.fakerefsmammal.post.FakerefsmammalPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakerefsmammalPost.Post apiClient = new FakerefsmammalPost.Post(apiConfiguration, schemaConfiguration); + +FakerefsmammalPost.SealedRequestBody requestBody = new FakerefsmammalPost.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new FakerefsmammalPost.PostRequestBuilder() + .requestBody(requestBody) + .build(); + +FakerefsmammalPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefsmammalPostResponses.EndpointFakerefsmammalPostCode200Response castResponse = (FakerefsmammalPostResponses.EndpointFakerefsmammalPostCode200Response) response; +FakerefsmammalPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakerefsmammalPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefsmammalPostResponses.EndpointResponse](../../paths/fakerefsmammal/post/FakerefsmammalPostResponses.md#endpointresponse) | post([PostRequest](#postrequest) request) | + +## MammalOperation +public interface MammalOperation
+ +an interface that allows one to call the endpoint using a method named mammal by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefsmammalPostResponses.EndpointResponse](../../paths/fakerefsmammal/post/FakerefsmammalPostResponses.md#endpointresponse) | mammal([PostRequest](#postrequest) request) | + +## PostRequest +public static class PostRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakerefsmammalPostRequestBody.SealedRequestBody](../../paths/fakerefsmammal/post/FakerefsmammalPostRequestBody.md#sealedrequestbody) | requestBody | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PostNullableRequest +public static class PostNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakerefsmammalPostRequestBody.@Nullable SealedRequestBody](../../paths/fakerefsmammal/post/FakerefsmammalPostRequestBody.md#sealedrequestbody) | requestBody | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| @Nullable Duration | timeout | + +## Post0RequestBuilder +public static class Post0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post0RequestBuilder(Post0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | +| [Post0RequestBuilder](#post0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Post0RequestBuilder](#post0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## PostRequestBuilder +public static class PostRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PostRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Post0RequestBuilder](#post0requestbuilder) | requestBody([FakerefsmammalPostRequestBody.SealedRequestBody](../../paths/fakerefsmammal/post/FakerefsmammalPostRequestBody.md#sealedrequestbody) requestBody)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakerefsmammal/Post.md b/samples/client/petstore/java/docs/paths/fakerefsmammal/Post.md deleted file mode 100644 index e346a48bda1..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsmammal/Post.md +++ /dev/null @@ -1,165 +0,0 @@ -# Post - -public class Post - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Post1](#post1)
The class that has a post method to call the endpoint | -| static class | [PostRequest](#postrequest)
The final request inputs class | -| static class | [PostNullableRequest](#postnullablerequest)
The initial request inputs class | -| static class | [Post0RequestBuilder](#post0requestbuilder)
A builder for the request input class | -| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | - -## Post1 -public static class Post1 extends ApiClient.ApiClient1 implements PostOperation
- -a class that allows one to call the endpoint using a method named post - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakerefsmammal.post.RequestBody; -import org.openapijsonschematools.client.components.schemas.Mammal; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakerefsmammal.post.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakerefsmammal.Post; -import org.openapijsonschematools.client.paths.fakerefsmammal.post.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Post.Post1 apiClient = new Post.Post1(apiConfiguration, schemaConfiguration); - -Post.SealedRequestBody requestBody = new Post.ApplicationjsonRequestBody(requestBodyPayload); - -var request = new PostRequestBuilder() - .requestBody(requestBody) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.post(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -Code200Response.ApplicationjsonResponseBody deserializedBody = (Code200Response.ApplicationjsonResponseBody) castResponse.body; -// handle deserialized body here -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakerefsmammal/post/Responses.md#endpointresponse) | post([PostRequest](#postrequest) request) | - -## PostRequest -public static class PostRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.SealedRequestBody](../../paths/fakerefsmammal/post/RequestBody.md#sealedrequestbody) | requestBody | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PostNullableRequest -public static class PostNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fakerefsmammal/post/RequestBody.md#sealedrequestbody) | requestBody | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| @Nullable Duration | timeout | - -## Post0RequestBuilder -public static class Post0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post0RequestBuilder(Post0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | -| [Post0RequestBuilder](#post0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Post0RequestBuilder](#post0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## PostRequestBuilder -public static class PostRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PostRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Post0RequestBuilder](#post0requestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/fakerefsmammal/post/RequestBody.md#sealedrequestbody) requestBody)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakerefsmammal/post/FakerefsmammalPostRequestBody.md b/samples/client/petstore/java/docs/paths/fakerefsmammal/post/FakerefsmammalPostRequestBody.md new file mode 100644 index 00000000000..c690512c787 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsmammal/post/FakerefsmammalPostRequestBody.md @@ -0,0 +1,90 @@ +# FakerefsmammalPostRequestBody + +public class FakerefsmammalPostRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakerefsmammalPostRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakerefsmammalPostRequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| static class | [FakerefsmammalPostRequestBody.FakerefsmammalPostRequestBody1](#fakerefsmammalpostrequestbody1)
class that serializes request bodies | +| sealed interface | [FakerefsmammalPostRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [FakerefsmammalPostRequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsmammal/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsmammal/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## FakerefsmammalPostRequestBody1 +public static class FakerefsmammalPostRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakerefsmammalPostRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = true
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[ApplicationjsonRequestBody](#applicationjsonrequestbody) + +sealed interface that stores request contentType + validated schema data + +## ApplicationjsonRequestBody +public record ApplicationjsonRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonRequestBody(ApplicationjsonSchema.[Mammal1Boxed](../../../components/schemas/Mammal.md#mammal1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "application/json" | +| ApplicationjsonSchema.[Mammal1Boxed](../../../components/schemas/Mammal.md#mammal1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakerefsmammal/post/FakerefsmammalPostResponses.md b/samples/client/petstore/java/docs/paths/fakerefsmammal/post/FakerefsmammalPostResponses.md new file mode 100644 index 00000000000..7f56fbe1cc0 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsmammal/post/FakerefsmammalPostResponses.md @@ -0,0 +1,29 @@ +# FakerefsmammalPostResponses + +public class FakerefsmammalPostResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakerefsmammalPostCode200Response](#endpointfakerefsmammalpostcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakerefsmammalPostCode200Response](#endpointfakerefsmammalpostcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakerefsmammalPostCode200Response +public record EndpointFakerefsmammalPostCode200Response( + HttpResponse response, + [FakerefsmammalPostCode200Response.SealedResponseBody](../../../paths/fakerefsmammal/post/responses/FakerefsmammalPostCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakerefsmammal/post/RequestBody.md b/samples/client/petstore/java/docs/paths/fakerefsmammal/post/RequestBody.md deleted file mode 100644 index 64fb8aa98e1..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsmammal/post/RequestBody.md +++ /dev/null @@ -1,90 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsmammal/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsmammal/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = true
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[ApplicationjsonRequestBody](#applicationjsonrequestbody) - -sealed interface that stores request contentType + validated schema data - -## ApplicationjsonRequestBody -public record ApplicationjsonRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonRequestBody(ApplicationjsonSchema.[Mammal1Boxed](../../../components/schemas/Mammal.md#mammal1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "application/json" | -| ApplicationjsonSchema.[Mammal1Boxed](../../../components/schemas/Mammal.md#mammal1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakerefsmammal/post/Responses.md b/samples/client/petstore/java/docs/paths/fakerefsmammal/post/Responses.md deleted file mode 100644 index a494d891252..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsmammal/post/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/fakerefsmammal/post/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakerefsmammal/post/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakerefsmammal/post/responses/Code200Response.md deleted file mode 100644 index 306cb9c0fd4..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsmammal/post/responses/Code200Response.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsmammal/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsmammal/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.[Mammal1Boxed](../../../../components/schemas/Mammal.md#mammal1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.[Mammal1Boxed](../../../../components/schemas/Mammal.md#mammal1boxed) | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakerefsmammal/post/responses/FakerefsmammalPostCode200Response.md b/samples/client/petstore/java/docs/paths/fakerefsmammal/post/responses/FakerefsmammalPostCode200Response.md new file mode 100644 index 00000000000..efd2fc83196 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsmammal/post/responses/FakerefsmammalPostCode200Response.md @@ -0,0 +1,87 @@ +# FakerefsmammalPostCode200Response + +public class FakerefsmammalPostCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakerefsmammalPostCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakerefsmammalPostCode200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakerefsmammalPostCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakerefsmammalPostCode200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [FakerefsmammalPostCode200Response.FakerefsmammalPostCode200Response1](#fakerefsmammalpostcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsmammal/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsmammal/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.[Mammal1Boxed](../../../../components/schemas/Mammal.md#mammal1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.[Mammal1Boxed](../../../../components/schemas/Mammal.md#mammal1boxed) | body()
returns the body passed in in the constructor | + +## FakerefsmammalPostCode200Response1 +public static class FakerefsmammalPostCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakerefsmammalPostCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakerefsnumber/FakerefsnumberPost.md b/samples/client/petstore/java/docs/paths/fakerefsnumber/FakerefsnumberPost.md new file mode 100644 index 00000000000..48623046b25 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsnumber/FakerefsnumberPost.md @@ -0,0 +1,145 @@ +# FakerefsnumberPost + +public class FakerefsnumberPost + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Post](#post)
The class that has a post method to call the endpoint | +| interface | [NumberWithValidationsOperation](#numberwithvalidationsoperation)
The interface that has a numberWithValidations method to call the endpoint | +| static class | [PostRequest](#postrequest)
The request inputs class | +| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | + +## Post +public static class Post extends ApiClient.ApiClient1 implements PostOperation
+ +a class that allows one to call the endpoint using a method named post + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakerefsnumber.post.FakerefsnumberPostRequestBody; +import org.openapijsonschematools.client.components.schemas.NumberWithValidations; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefsnumber.post.responses.FakerefsnumberPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakerefsnumber.FakerefsnumberPost; +import org.openapijsonschematools.client.paths.fakerefsnumber.post.FakerefsnumberPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakerefsnumberPost.Post apiClient = new FakerefsnumberPost.Post(apiConfiguration, schemaConfiguration); + + +var request = new FakerefsnumberPost.PostRequestBuilder().build(); + +FakerefsnumberPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefsnumberPostResponses.EndpointFakerefsnumberPostCode200Response castResponse = (FakerefsnumberPostResponses.EndpointFakerefsnumberPostCode200Response) response; +FakerefsnumberPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakerefsnumberPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefsnumberPostResponses.EndpointResponse](../../paths/fakerefsnumber/post/FakerefsnumberPostResponses.md#endpointresponse) | post([PostRequest](#postrequest) request) | + +## NumberWithValidationsOperation +public interface NumberWithValidationsOperation
+ +an interface that allows one to call the endpoint using a method named numberWithValidations by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefsnumberPostResponses.EndpointResponse](../../paths/fakerefsnumber/post/FakerefsnumberPostResponses.md#endpointresponse) | numberWithValidations([PostRequest](#postrequest) request) | + +## PostRequest +public static class PostRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakerefsnumberPostRequestBody.@Nullable SealedRequestBody](../../paths/fakerefsnumber/post/FakerefsnumberPostRequestBody.md#sealedrequestbody) | requestBody
optional | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PostRequestBuilder +public static class PostRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PostRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | +| [PostRequestBuilder](#postrequestbuilder) | requestBody([FakerefsnumberPostRequestBody.SealedRequestBody](../../paths/fakerefsnumber/post/FakerefsnumberPostRequestBody.md#sealedrequestbody) requestBody)
sets the optional property | +| [PostRequestBuilder](#postrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [PostRequestBuilder](#postrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakerefsnumber/Post.md b/samples/client/petstore/java/docs/paths/fakerefsnumber/Post.md deleted file mode 100644 index 41bcd1d2a69..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsnumber/Post.md +++ /dev/null @@ -1,134 +0,0 @@ -# Post - -public class Post - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Post1](#post1)
The class that has a post method to call the endpoint | -| static class | [PostRequest](#postrequest)
The request inputs class | -| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | - -## Post1 -public static class Post1 extends ApiClient.ApiClient1 implements PostOperation
- -a class that allows one to call the endpoint using a method named post - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakerefsnumber.post.RequestBody; -import org.openapijsonschematools.client.components.schemas.NumberWithValidations; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakerefsnumber.post.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakerefsnumber.Post; -import org.openapijsonschematools.client.paths.fakerefsnumber.post.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Post.Post1 apiClient = new Post.Post1(apiConfiguration, schemaConfiguration); - - -var request = new PostRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.post(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -Code200Response.ApplicationjsonResponseBody deserializedBody = (Code200Response.ApplicationjsonResponseBody) castResponse.body; -// handle deserialized body here -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakerefsnumber/post/Responses.md#endpointresponse) | post([PostRequest](#postrequest) request) | - -## PostRequest -public static class PostRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fakerefsnumber/post/RequestBody.md#sealedrequestbody) | requestBody
optional | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PostRequestBuilder -public static class PostRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PostRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | -| [PostRequestBuilder](#postrequestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/fakerefsnumber/post/RequestBody.md#sealedrequestbody) requestBody)
sets the optional property | -| [PostRequestBuilder](#postrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [PostRequestBuilder](#postrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakerefsnumber/post/FakerefsnumberPostRequestBody.md b/samples/client/petstore/java/docs/paths/fakerefsnumber/post/FakerefsnumberPostRequestBody.md new file mode 100644 index 00000000000..b17bef8adae --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsnumber/post/FakerefsnumberPostRequestBody.md @@ -0,0 +1,90 @@ +# FakerefsnumberPostRequestBody + +public class FakerefsnumberPostRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakerefsnumberPostRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakerefsnumberPostRequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| static class | [FakerefsnumberPostRequestBody.FakerefsnumberPostRequestBody1](#fakerefsnumberpostrequestbody1)
class that serializes request bodies | +| sealed interface | [FakerefsnumberPostRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [FakerefsnumberPostRequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsnumber/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsnumber/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## FakerefsnumberPostRequestBody1 +public static class FakerefsnumberPostRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakerefsnumberPostRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = false
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[ApplicationjsonRequestBody](#applicationjsonrequestbody) + +sealed interface that stores request contentType + validated schema data + +## ApplicationjsonRequestBody +public record ApplicationjsonRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonRequestBody(ApplicationjsonSchema.[NumberWithValidations1Boxed](../../../components/schemas/NumberWithValidations.md#numberwithvalidations1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "application/json" | +| ApplicationjsonSchema.[NumberWithValidations1Boxed](../../../components/schemas/NumberWithValidations.md#numberwithvalidations1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakerefsnumber/post/FakerefsnumberPostResponses.md b/samples/client/petstore/java/docs/paths/fakerefsnumber/post/FakerefsnumberPostResponses.md new file mode 100644 index 00000000000..210666926f6 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsnumber/post/FakerefsnumberPostResponses.md @@ -0,0 +1,29 @@ +# FakerefsnumberPostResponses + +public class FakerefsnumberPostResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakerefsnumberPostCode200Response](#endpointfakerefsnumberpostcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakerefsnumberPostCode200Response](#endpointfakerefsnumberpostcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakerefsnumberPostCode200Response +public record EndpointFakerefsnumberPostCode200Response( + HttpResponse response, + [FakerefsnumberPostCode200Response.SealedResponseBody](../../../paths/fakerefsnumber/post/responses/FakerefsnumberPostCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakerefsnumber/post/RequestBody.md b/samples/client/petstore/java/docs/paths/fakerefsnumber/post/RequestBody.md deleted file mode 100644 index bf52e31b42d..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsnumber/post/RequestBody.md +++ /dev/null @@ -1,90 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsnumber/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsnumber/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = false
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[ApplicationjsonRequestBody](#applicationjsonrequestbody) - -sealed interface that stores request contentType + validated schema data - -## ApplicationjsonRequestBody -public record ApplicationjsonRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonRequestBody(ApplicationjsonSchema.[NumberWithValidations1Boxed](../../../components/schemas/NumberWithValidations.md#numberwithvalidations1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "application/json" | -| ApplicationjsonSchema.[NumberWithValidations1Boxed](../../../components/schemas/NumberWithValidations.md#numberwithvalidations1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakerefsnumber/post/Responses.md b/samples/client/petstore/java/docs/paths/fakerefsnumber/post/Responses.md deleted file mode 100644 index 2d78359ac0d..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsnumber/post/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/fakerefsnumber/post/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakerefsnumber/post/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakerefsnumber/post/responses/Code200Response.md deleted file mode 100644 index fa79fa5553f..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsnumber/post/responses/Code200Response.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsnumber/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsnumber/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.[NumberWithValidations1Boxed](../../../../components/schemas/NumberWithValidations.md#numberwithvalidations1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.[NumberWithValidations1Boxed](../../../../components/schemas/NumberWithValidations.md#numberwithvalidations1boxed) | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakerefsnumber/post/responses/FakerefsnumberPostCode200Response.md b/samples/client/petstore/java/docs/paths/fakerefsnumber/post/responses/FakerefsnumberPostCode200Response.md new file mode 100644 index 00000000000..872b78c9847 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsnumber/post/responses/FakerefsnumberPostCode200Response.md @@ -0,0 +1,87 @@ +# FakerefsnumberPostCode200Response + +public class FakerefsnumberPostCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakerefsnumberPostCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakerefsnumberPostCode200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakerefsnumberPostCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakerefsnumberPostCode200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [FakerefsnumberPostCode200Response.FakerefsnumberPostCode200Response1](#fakerefsnumberpostcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsnumber/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsnumber/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.[NumberWithValidations1Boxed](../../../../components/schemas/NumberWithValidations.md#numberwithvalidations1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.[NumberWithValidations1Boxed](../../../../components/schemas/NumberWithValidations.md#numberwithvalidations1boxed) | body()
returns the body passed in in the constructor | + +## FakerefsnumberPostCode200Response1 +public static class FakerefsnumberPostCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakerefsnumberPostCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/FakerefsobjectmodelwithrefpropsPost.md b/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/FakerefsobjectmodelwithrefpropsPost.md new file mode 100644 index 00000000000..a266053875e --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/FakerefsobjectmodelwithrefpropsPost.md @@ -0,0 +1,145 @@ +# FakerefsobjectmodelwithrefpropsPost + +public class FakerefsobjectmodelwithrefpropsPost + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Post](#post)
The class that has a post method to call the endpoint | +| interface | [ObjectModelWithRefPropsOperation](#objectmodelwithrefpropsoperation)
The interface that has a objectModelWithRefProps method to call the endpoint | +| static class | [PostRequest](#postrequest)
The request inputs class | +| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | + +## Post +public static class Post extends ApiClient.ApiClient1 implements PostOperation
+ +a class that allows one to call the endpoint using a method named post + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post.FakerefsobjectmodelwithrefpropsPostRequestBody; +import org.openapijsonschematools.client.components.schemas.ObjectModelWithRefProps; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post.responses.FakerefsobjectmodelwithrefpropsPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.FakerefsobjectmodelwithrefpropsPost; +import org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post.FakerefsobjectmodelwithrefpropsPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakerefsobjectmodelwithrefpropsPost.Post apiClient = new FakerefsobjectmodelwithrefpropsPost.Post(apiConfiguration, schemaConfiguration); + + +var request = new FakerefsobjectmodelwithrefpropsPost.PostRequestBuilder().build(); + +FakerefsobjectmodelwithrefpropsPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefsobjectmodelwithrefpropsPostResponses.EndpointFakerefsobjectmodelwithrefpropsPostCode200Response castResponse = (FakerefsobjectmodelwithrefpropsPostResponses.EndpointFakerefsobjectmodelwithrefpropsPostCode200Response) response; +FakerefsobjectmodelwithrefpropsPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakerefsobjectmodelwithrefpropsPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefsobjectmodelwithrefpropsPostResponses.EndpointResponse](../../paths/fakerefsobjectmodelwithrefprops/post/FakerefsobjectmodelwithrefpropsPostResponses.md#endpointresponse) | post([PostRequest](#postrequest) request) | + +## ObjectModelWithRefPropsOperation +public interface ObjectModelWithRefPropsOperation
+ +an interface that allows one to call the endpoint using a method named objectModelWithRefProps by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefsobjectmodelwithrefpropsPostResponses.EndpointResponse](../../paths/fakerefsobjectmodelwithrefprops/post/FakerefsobjectmodelwithrefpropsPostResponses.md#endpointresponse) | objectModelWithRefProps([PostRequest](#postrequest) request) | + +## PostRequest +public static class PostRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakerefsobjectmodelwithrefpropsPostRequestBody.@Nullable SealedRequestBody](../../paths/fakerefsobjectmodelwithrefprops/post/FakerefsobjectmodelwithrefpropsPostRequestBody.md#sealedrequestbody) | requestBody
optional | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PostRequestBuilder +public static class PostRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PostRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | +| [PostRequestBuilder](#postrequestbuilder) | requestBody([FakerefsobjectmodelwithrefpropsPostRequestBody.SealedRequestBody](../../paths/fakerefsobjectmodelwithrefprops/post/FakerefsobjectmodelwithrefpropsPostRequestBody.md#sealedrequestbody) requestBody)
sets the optional property | +| [PostRequestBuilder](#postrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [PostRequestBuilder](#postrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/Post.md b/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/Post.md deleted file mode 100644 index a897bfcdcc9..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/Post.md +++ /dev/null @@ -1,134 +0,0 @@ -# Post - -public class Post - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Post1](#post1)
The class that has a post method to call the endpoint | -| static class | [PostRequest](#postrequest)
The request inputs class | -| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | - -## Post1 -public static class Post1 extends ApiClient.ApiClient1 implements PostOperation
- -a class that allows one to call the endpoint using a method named post - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post.RequestBody; -import org.openapijsonschematools.client.components.schemas.ObjectModelWithRefProps; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.Post; -import org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Post.Post1 apiClient = new Post.Post1(apiConfiguration, schemaConfiguration); - - -var request = new PostRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.post(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -Code200Response.ApplicationjsonResponseBody deserializedBody = (Code200Response.ApplicationjsonResponseBody) castResponse.body; -// handle deserialized body here -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakerefsobjectmodelwithrefprops/post/Responses.md#endpointresponse) | post([PostRequest](#postrequest) request) | - -## PostRequest -public static class PostRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fakerefsobjectmodelwithrefprops/post/RequestBody.md#sealedrequestbody) | requestBody
optional | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PostRequestBuilder -public static class PostRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PostRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | -| [PostRequestBuilder](#postrequestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/fakerefsobjectmodelwithrefprops/post/RequestBody.md#sealedrequestbody) requestBody)
sets the optional property | -| [PostRequestBuilder](#postrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [PostRequestBuilder](#postrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/post/FakerefsobjectmodelwithrefpropsPostRequestBody.md b/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/post/FakerefsobjectmodelwithrefpropsPostRequestBody.md new file mode 100644 index 00000000000..e0846150c44 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/post/FakerefsobjectmodelwithrefpropsPostRequestBody.md @@ -0,0 +1,90 @@ +# FakerefsobjectmodelwithrefpropsPostRequestBody + +public class FakerefsobjectmodelwithrefpropsPostRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakerefsobjectmodelwithrefpropsPostRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakerefsobjectmodelwithrefpropsPostRequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| static class | [FakerefsobjectmodelwithrefpropsPostRequestBody.FakerefsobjectmodelwithrefpropsPostRequestBody1](#fakerefsobjectmodelwithrefpropspostrequestbody1)
class that serializes request bodies | +| sealed interface | [FakerefsobjectmodelwithrefpropsPostRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [FakerefsobjectmodelwithrefpropsPostRequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsobjectmodelwithrefprops/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsobjectmodelwithrefprops/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## FakerefsobjectmodelwithrefpropsPostRequestBody1 +public static class FakerefsobjectmodelwithrefpropsPostRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakerefsobjectmodelwithrefpropsPostRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = false
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[ApplicationjsonRequestBody](#applicationjsonrequestbody) + +sealed interface that stores request contentType + validated schema data + +## ApplicationjsonRequestBody +public record ApplicationjsonRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonRequestBody(ApplicationjsonSchema.[ObjectModelWithRefProps1Boxed](../../../components/schemas/ObjectModelWithRefProps.md#objectmodelwithrefprops1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "application/json" | +| ApplicationjsonSchema.[ObjectModelWithRefProps1Boxed](../../../components/schemas/ObjectModelWithRefProps.md#objectmodelwithrefprops1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/post/FakerefsobjectmodelwithrefpropsPostResponses.md b/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/post/FakerefsobjectmodelwithrefpropsPostResponses.md new file mode 100644 index 00000000000..27e6230d866 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/post/FakerefsobjectmodelwithrefpropsPostResponses.md @@ -0,0 +1,29 @@ +# FakerefsobjectmodelwithrefpropsPostResponses + +public class FakerefsobjectmodelwithrefpropsPostResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakerefsobjectmodelwithrefpropsPostCode200Response](#endpointfakerefsobjectmodelwithrefpropspostcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakerefsobjectmodelwithrefpropsPostCode200Response](#endpointfakerefsobjectmodelwithrefpropspostcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakerefsobjectmodelwithrefpropsPostCode200Response +public record EndpointFakerefsobjectmodelwithrefpropsPostCode200Response( + HttpResponse response, + [FakerefsobjectmodelwithrefpropsPostCode200Response.SealedResponseBody](../../../paths/fakerefsobjectmodelwithrefprops/post/responses/FakerefsobjectmodelwithrefpropsPostCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/post/RequestBody.md b/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/post/RequestBody.md deleted file mode 100644 index fa402eba521..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/post/RequestBody.md +++ /dev/null @@ -1,90 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsobjectmodelwithrefprops/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsobjectmodelwithrefprops/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = false
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[ApplicationjsonRequestBody](#applicationjsonrequestbody) - -sealed interface that stores request contentType + validated schema data - -## ApplicationjsonRequestBody -public record ApplicationjsonRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonRequestBody(ApplicationjsonSchema.[ObjectModelWithRefProps1Boxed](../../../components/schemas/ObjectModelWithRefProps.md#objectmodelwithrefprops1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "application/json" | -| ApplicationjsonSchema.[ObjectModelWithRefProps1Boxed](../../../components/schemas/ObjectModelWithRefProps.md#objectmodelwithrefprops1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/post/Responses.md b/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/post/Responses.md deleted file mode 100644 index 1b5db48eba7..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/post/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/fakerefsobjectmodelwithrefprops/post/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/post/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/post/responses/Code200Response.md deleted file mode 100644 index ec15e24f629..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/post/responses/Code200Response.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsobjectmodelwithrefprops/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsobjectmodelwithrefprops/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.[ObjectModelWithRefProps1Boxed](../../../../components/schemas/ObjectModelWithRefProps.md#objectmodelwithrefprops1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.[ObjectModelWithRefProps1Boxed](../../../../components/schemas/ObjectModelWithRefProps.md#objectmodelwithrefprops1boxed) | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/post/responses/FakerefsobjectmodelwithrefpropsPostCode200Response.md b/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/post/responses/FakerefsobjectmodelwithrefpropsPostCode200Response.md new file mode 100644 index 00000000000..920816b5528 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsobjectmodelwithrefprops/post/responses/FakerefsobjectmodelwithrefpropsPostCode200Response.md @@ -0,0 +1,87 @@ +# FakerefsobjectmodelwithrefpropsPostCode200Response + +public class FakerefsobjectmodelwithrefpropsPostCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakerefsobjectmodelwithrefpropsPostCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakerefsobjectmodelwithrefpropsPostCode200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakerefsobjectmodelwithrefpropsPostCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakerefsobjectmodelwithrefpropsPostCode200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [FakerefsobjectmodelwithrefpropsPostCode200Response.FakerefsobjectmodelwithrefpropsPostCode200Response1](#fakerefsobjectmodelwithrefpropspostcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsobjectmodelwithrefprops/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsobjectmodelwithrefprops/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.[ObjectModelWithRefProps1Boxed](../../../../components/schemas/ObjectModelWithRefProps.md#objectmodelwithrefprops1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.[ObjectModelWithRefProps1Boxed](../../../../components/schemas/ObjectModelWithRefProps.md#objectmodelwithrefprops1boxed) | body()
returns the body passed in in the constructor | + +## FakerefsobjectmodelwithrefpropsPostCode200Response1 +public static class FakerefsobjectmodelwithrefpropsPostCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakerefsobjectmodelwithrefpropsPostCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakerefsstring/FakerefsstringPost.md b/samples/client/petstore/java/docs/paths/fakerefsstring/FakerefsstringPost.md new file mode 100644 index 00000000000..80963690b66 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsstring/FakerefsstringPost.md @@ -0,0 +1,145 @@ +# FakerefsstringPost + +public class FakerefsstringPost + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Post](#post)
The class that has a post method to call the endpoint | +| interface | [ModelStringOperation](#modelstringoperation)
The interface that has a modelString method to call the endpoint | +| static class | [PostRequest](#postrequest)
The request inputs class | +| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | + +## Post +public static class Post extends ApiClient.ApiClient1 implements PostOperation
+ +a class that allows one to call the endpoint using a method named post + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakerefsstring.post.FakerefsstringPostRequestBody; +import org.openapijsonschematools.client.components.schemas.StringSchema; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakerefsstring.post.responses.FakerefsstringPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakerefsstring.FakerefsstringPost; +import org.openapijsonschematools.client.paths.fakerefsstring.post.FakerefsstringPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakerefsstringPost.Post apiClient = new FakerefsstringPost.Post(apiConfiguration, schemaConfiguration); + + +var request = new FakerefsstringPost.PostRequestBuilder().build(); + +FakerefsstringPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakerefsstringPostResponses.EndpointFakerefsstringPostCode200Response castResponse = (FakerefsstringPostResponses.EndpointFakerefsstringPostCode200Response) response; +FakerefsstringPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakerefsstringPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefsstringPostResponses.EndpointResponse](../../paths/fakerefsstring/post/FakerefsstringPostResponses.md#endpointresponse) | post([PostRequest](#postrequest) request) | + +## ModelStringOperation +public interface ModelStringOperation
+ +an interface that allows one to call the endpoint using a method named modelString by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakerefsstringPostResponses.EndpointResponse](../../paths/fakerefsstring/post/FakerefsstringPostResponses.md#endpointresponse) | modelString([PostRequest](#postrequest) request) | + +## PostRequest +public static class PostRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakerefsstringPostRequestBody.@Nullable SealedRequestBody](../../paths/fakerefsstring/post/FakerefsstringPostRequestBody.md#sealedrequestbody) | requestBody
optional | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PostRequestBuilder +public static class PostRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PostRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | +| [PostRequestBuilder](#postrequestbuilder) | requestBody([FakerefsstringPostRequestBody.SealedRequestBody](../../paths/fakerefsstring/post/FakerefsstringPostRequestBody.md#sealedrequestbody) requestBody)
sets the optional property | +| [PostRequestBuilder](#postrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [PostRequestBuilder](#postrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakerefsstring/Post.md b/samples/client/petstore/java/docs/paths/fakerefsstring/Post.md deleted file mode 100644 index 8586be22c86..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsstring/Post.md +++ /dev/null @@ -1,134 +0,0 @@ -# Post - -public class Post - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Post1](#post1)
The class that has a post method to call the endpoint | -| static class | [PostRequest](#postrequest)
The request inputs class | -| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | - -## Post1 -public static class Post1 extends ApiClient.ApiClient1 implements PostOperation
- -a class that allows one to call the endpoint using a method named post - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakerefsstring.post.RequestBody; -import org.openapijsonschematools.client.components.schemas.StringSchema; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakerefsstring.post.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakerefsstring.Post; -import org.openapijsonschematools.client.paths.fakerefsstring.post.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Post.Post1 apiClient = new Post.Post1(apiConfiguration, schemaConfiguration); - - -var request = new PostRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.post(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -Code200Response.ApplicationjsonResponseBody deserializedBody = (Code200Response.ApplicationjsonResponseBody) castResponse.body; -// handle deserialized body here -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakerefsstring/post/Responses.md#endpointresponse) | post([PostRequest](#postrequest) request) | - -## PostRequest -public static class PostRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fakerefsstring/post/RequestBody.md#sealedrequestbody) | requestBody
optional | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PostRequestBuilder -public static class PostRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PostRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | -| [PostRequestBuilder](#postrequestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/fakerefsstring/post/RequestBody.md#sealedrequestbody) requestBody)
sets the optional property | -| [PostRequestBuilder](#postrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [PostRequestBuilder](#postrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakerefsstring/post/FakerefsstringPostRequestBody.md b/samples/client/petstore/java/docs/paths/fakerefsstring/post/FakerefsstringPostRequestBody.md new file mode 100644 index 00000000000..d9351381bcf --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsstring/post/FakerefsstringPostRequestBody.md @@ -0,0 +1,90 @@ +# FakerefsstringPostRequestBody + +public class FakerefsstringPostRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakerefsstringPostRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakerefsstringPostRequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| static class | [FakerefsstringPostRequestBody.FakerefsstringPostRequestBody1](#fakerefsstringpostrequestbody1)
class that serializes request bodies | +| sealed interface | [FakerefsstringPostRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [FakerefsstringPostRequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsstring/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsstring/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## FakerefsstringPostRequestBody1 +public static class FakerefsstringPostRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakerefsstringPostRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = false
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[ApplicationjsonRequestBody](#applicationjsonrequestbody) + +sealed interface that stores request contentType + validated schema data + +## ApplicationjsonRequestBody +public record ApplicationjsonRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonRequestBody(ApplicationjsonSchema.StringJsonSchema1Boxed body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "application/json" | +| ApplicationjsonSchema.StringJsonSchema1Boxed | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakerefsstring/post/FakerefsstringPostResponses.md b/samples/client/petstore/java/docs/paths/fakerefsstring/post/FakerefsstringPostResponses.md new file mode 100644 index 00000000000..dc00e6ebc01 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsstring/post/FakerefsstringPostResponses.md @@ -0,0 +1,29 @@ +# FakerefsstringPostResponses + +public class FakerefsstringPostResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakerefsstringPostCode200Response](#endpointfakerefsstringpostcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakerefsstringPostCode200Response](#endpointfakerefsstringpostcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakerefsstringPostCode200Response +public record EndpointFakerefsstringPostCode200Response( + HttpResponse response, + [FakerefsstringPostCode200Response.SealedResponseBody](../../../paths/fakerefsstring/post/responses/FakerefsstringPostCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakerefsstring/post/RequestBody.md b/samples/client/petstore/java/docs/paths/fakerefsstring/post/RequestBody.md deleted file mode 100644 index dadb1fcd877..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsstring/post/RequestBody.md +++ /dev/null @@ -1,90 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsstring/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/fakerefsstring/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = false
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[ApplicationjsonRequestBody](#applicationjsonrequestbody) - -sealed interface that stores request contentType + validated schema data - -## ApplicationjsonRequestBody -public record ApplicationjsonRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonRequestBody(ApplicationjsonSchema.StringJsonSchema1Boxed body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "application/json" | -| ApplicationjsonSchema.StringJsonSchema1Boxed | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakerefsstring/post/Responses.md b/samples/client/petstore/java/docs/paths/fakerefsstring/post/Responses.md deleted file mode 100644 index bfcb28ad840..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsstring/post/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/fakerefsstring/post/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakerefsstring/post/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakerefsstring/post/responses/Code200Response.md deleted file mode 100644 index 20b8d640587..00000000000 --- a/samples/client/petstore/java/docs/paths/fakerefsstring/post/responses/Code200Response.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsstring/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsstring/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.StringJsonSchema1Boxed body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.StringJsonSchema1Boxed | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakerefsstring/post/responses/FakerefsstringPostCode200Response.md b/samples/client/petstore/java/docs/paths/fakerefsstring/post/responses/FakerefsstringPostCode200Response.md new file mode 100644 index 00000000000..d01efb93215 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakerefsstring/post/responses/FakerefsstringPostCode200Response.md @@ -0,0 +1,87 @@ +# FakerefsstringPostCode200Response + +public class FakerefsstringPostCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakerefsstringPostCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakerefsstringPostCode200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakerefsstringPostCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakerefsstringPostCode200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [FakerefsstringPostCode200Response.FakerefsstringPostCode200Response1](#fakerefsstringpostcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsstring/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakerefsstring/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.StringJsonSchema1Boxed body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.StringJsonSchema1Boxed | body()
returns the body passed in in the constructor | + +## FakerefsstringPostCode200Response1 +public static class FakerefsstringPostCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakerefsstringPostCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakeresponsewithoutschema/FakeresponsewithoutschemaGet.md b/samples/client/petstore/java/docs/paths/fakeresponsewithoutschema/FakeresponsewithoutschemaGet.md new file mode 100644 index 00000000000..4e0f92b77c1 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeresponsewithoutschema/FakeresponsewithoutschemaGet.md @@ -0,0 +1,139 @@ +# FakeresponsewithoutschemaGet + +public class FakeresponsewithoutschemaGet + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Get](#get)
The class that has a get method to call the endpoint | +| interface | [ResponseWithoutSchemaOperation](#responsewithoutschemaoperation)
The interface that has a responseWithoutSchema method to call the endpoint | +| static class | [GetRequest](#getrequest)
The request inputs class | +| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | + +## Get +public static class Get extends ApiClient.ApiClient1 implements GetOperation
+ +a class that allows one to call the endpoint using a method named get + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeresponsewithoutschema.get.responses.FakeresponsewithoutschemaGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeresponsewithoutschema.FakeresponsewithoutschemaGet; +import org.openapijsonschematools.client.paths.fakeresponsewithoutschema.get.FakeresponsewithoutschemaGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakeresponsewithoutschemaGet.Get apiClient = new FakeresponsewithoutschemaGet.Get(apiConfiguration, schemaConfiguration); + + +var request = new FakeresponsewithoutschemaGet.GetRequestBuilder().build(); + +FakeresponsewithoutschemaGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeresponsewithoutschemaGetResponses.EndpointFakeresponsewithoutschemaGetCode200Response castResponse = (FakeresponsewithoutschemaGetResponses.EndpointFakeresponsewithoutschemaGetCode200Response) response; +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeresponsewithoutschemaGetResponses.EndpointResponse](../../paths/fakeresponsewithoutschema/get/FakeresponsewithoutschemaGetResponses.md#endpointresponse) | get([GetRequest](#getrequest) request) | + +## ResponseWithoutSchemaOperation +public interface ResponseWithoutSchemaOperation
+ +an interface that allows one to call the endpoint using a method named responseWithoutSchema by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeresponsewithoutschemaGetResponses.EndpointResponse](../../paths/fakeresponsewithoutschema/get/FakeresponsewithoutschemaGetResponses.md#endpointresponse) | responseWithoutSchema([GetRequest](#getrequest) request) | + +## GetRequest +public static class GetRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## GetRequestBuilder +public static class GetRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| GetRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | +| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakeresponsewithoutschema/Get.md b/samples/client/petstore/java/docs/paths/fakeresponsewithoutschema/Get.md deleted file mode 100644 index 2cd0d406ab3..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeresponsewithoutschema/Get.md +++ /dev/null @@ -1,128 +0,0 @@ -# Get - -public class Get - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Get1](#get1)
The class that has a get method to call the endpoint | -| static class | [GetRequest](#getrequest)
The request inputs class | -| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | - -## Get1 -public static class Get1 extends ApiClient.ApiClient1 implements GetOperation
- -a class that allows one to call the endpoint using a method named get - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakeresponsewithoutschema.get.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakeresponsewithoutschema.Get; -import org.openapijsonschematools.client.paths.fakeresponsewithoutschema.get.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Get.Get1 apiClient = new Get.Get1(apiConfiguration, schemaConfiguration); - - -var request = new GetRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.get(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakeresponsewithoutschema/get/Responses.md#endpointresponse) | get([GetRequest](#getrequest) request) | - -## GetRequest -public static class GetRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## GetRequestBuilder -public static class GetRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| GetRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | -| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakeresponsewithoutschema/get/FakeresponsewithoutschemaGetResponses.md b/samples/client/petstore/java/docs/paths/fakeresponsewithoutschema/get/FakeresponsewithoutschemaGetResponses.md new file mode 100644 index 00000000000..0927c61dc2a --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeresponsewithoutschema/get/FakeresponsewithoutschemaGetResponses.md @@ -0,0 +1,29 @@ +# FakeresponsewithoutschemaGetResponses + +public class FakeresponsewithoutschemaGetResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakeresponsewithoutschemaGetCode200Response](#endpointfakeresponsewithoutschemagetcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakeresponsewithoutschemaGetCode200Response](#endpointfakeresponsewithoutschemagetcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakeresponsewithoutschemaGetCode200Response +public record EndpointFakeresponsewithoutschemaGetCode200Response( + HttpResponse response, + Void body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakeresponsewithoutschema/get/Responses.md b/samples/client/petstore/java/docs/paths/fakeresponsewithoutschema/get/Responses.md deleted file mode 100644 index d4bf4fdb8f5..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeresponsewithoutschema/get/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakeresponsewithoutschema/get/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakeresponsewithoutschema/get/responses/Code200Response.md deleted file mode 100644 index ec9f58ca80a..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeresponsewithoutschema/get/responses/Code200Response.md +++ /dev/null @@ -1,32 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = MapUtils.makeMap(
    new AbstractMap.SimpleEntry<>("application/json", null),
    new AbstractMap.SimpleEntry<>("application/xml", null)
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakeresponsewithoutschema/get/responses/FakeresponsewithoutschemaGetCode200Response.md b/samples/client/petstore/java/docs/paths/fakeresponsewithoutschema/get/responses/FakeresponsewithoutschemaGetCode200Response.md new file mode 100644 index 00000000000..79949c77d66 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeresponsewithoutschema/get/responses/FakeresponsewithoutschemaGetCode200Response.md @@ -0,0 +1,32 @@ +# FakeresponsewithoutschemaGetCode200Response + +public class FakeresponsewithoutschemaGetCode200Response + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [FakeresponsewithoutschemaGetCode200Response.FakeresponsewithoutschemaGetCode200Response1](#fakeresponsewithoutschemagetcode200response1)
class that deserializes responses | + +## FakeresponsewithoutschemaGetCode200Response1 +public static class FakeresponsewithoutschemaGetCode200Response1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeresponsewithoutschemaGetCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
    new AbstractMap.SimpleEntry<>("application/json", null),
    new AbstractMap.SimpleEntry<>("application/xml", null)
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/faketestqueryparamters/FaketestqueryparamtersPut.md b/samples/client/petstore/java/docs/paths/faketestqueryparamters/FaketestqueryparamtersPut.md new file mode 100644 index 00000000000..fe0ce1b5a84 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/faketestqueryparamters/FaketestqueryparamtersPut.md @@ -0,0 +1,207 @@ +# FaketestqueryparamtersPut + +public class FaketestqueryparamtersPut + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Put](#put)
The class that has a put method to call the endpoint | +| interface | [QueryParameterCollectionFormatOperation](#queryparametercollectionformatoperation)
The interface that has a queryParameterCollectionFormat method to call the endpoint | +| static class | [PutRequest](#putrequest)
The final request inputs class | +| static class | [PutNullableRequest](#putnullablerequest)
The initial request inputs class | +| static class | [Put0RequestBuilder](#put0requestbuilder)
A builder for the request input class | +| static class | [PutRequestBuilder](#putrequestbuilder)
A builder for the request input class | + +## Put +public static class Put extends ApiClient.ApiClient1 implements PutOperation
+ +a class that allows one to call the endpoint using a method named put + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.faketestqueryparamters.put.FaketestqueryparamtersPutQueryParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.faketestqueryparamters.put.responses.FaketestqueryparamtersPutCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.faketestqueryparamters.FaketestqueryparamtersPut; +import org.openapijsonschematools.client.paths.faketestqueryparamters.put.FaketestqueryparamtersPutResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FaketestqueryparamtersPut.Put apiClient = new FaketestqueryparamtersPut.Put(apiConfiguration, schemaConfiguration); + + +// Map validation +FaketestqueryparamtersPutQueryParameters.FaketestqueryparamtersPutQueryParametersMap queryParameters = + FaketestqueryparamtersPutQueryParameters.FaketestqueryparamtersPutQueryParameters1.validate( + new FaketestqueryparamtersPutQueryParameters.FaketestqueryparamtersPutQueryParametersMapBuilder() + .context( + Arrays.asList( + "a" + ) + ) + .http( + Arrays.asList( + "a" + ) + ) + .ioutil( + Arrays.asList( + "a" + ) + ) + .pipe( + Arrays.asList( + "a" + ) + ) + .refParam("a") + + .url( + Arrays.asList( + "a" + ) + ) + .build(), + schemaConfiguration +); + +var request = new FaketestqueryparamtersPut.PutRequestBuilder() + .queryParameters(queryParameters) + .build(); + +FaketestqueryparamtersPutResponses.EndpointResponse response; +try { + response = apiClient.put(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FaketestqueryparamtersPutResponses.EndpointFaketestqueryparamtersPutCode200Response castResponse = (FaketestqueryparamtersPutResponses.EndpointFaketestqueryparamtersPutCode200Response) response; +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Put(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutResponses.EndpointResponse](../../paths/faketestqueryparamters/put/FaketestqueryparamtersPutResponses.md#endpointresponse) | put([PutRequest](#putrequest) request) | + +## QueryParameterCollectionFormatOperation +public interface QueryParameterCollectionFormatOperation
+ +an interface that allows one to call the endpoint using a method named queryParameterCollectionFormat by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutResponses.EndpointResponse](../../paths/faketestqueryparamters/put/FaketestqueryparamtersPutResponses.md#endpointresponse) | queryParameterCollectionFormat([PutRequest](#putrequest) request) | + +## PutRequest +public static class PutRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FaketestqueryparamtersPutQueryParameters.FaketestqueryparamtersPutQueryParametersMap](../../paths/faketestqueryparamters/put/FaketestqueryparamtersPutQueryParameters.md#faketestqueryparamtersputqueryparametersmap) | queryParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PutNullableRequest +public static class PutNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FaketestqueryparamtersPutQueryParameters.@Nullable FaketestqueryparamtersPutQueryParametersMap](../../paths/faketestqueryparamters/put/FaketestqueryparamtersPutQueryParameters.md#faketestqueryparamtersputqueryparametersmap) | queryParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| @Nullable Duration | timeout | + +## Put0RequestBuilder +public static class Put0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Put0RequestBuilder(Put0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PutRequest](#putrequest) | build()
Returns the request input used to call an endpoint method | +| [Put0RequestBuilder](#put0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Put0RequestBuilder](#put0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## PutRequestBuilder +public static class PutRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PutRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Put0RequestBuilder](#put0requestbuilder) | queryParameters([FaketestqueryparamtersPutQueryParametersFaketestqueryparamtersPutQueryParametersMap](../../paths/faketestqueryparamters/put/FaketestqueryparamtersPutQueryParameters.md#faketestqueryparamtersputqueryparametersmap) queryParameters)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/faketestqueryparamters/Put.md b/samples/client/petstore/java/docs/paths/faketestqueryparamters/Put.md deleted file mode 100644 index c9832cb9a3f..00000000000 --- a/samples/client/petstore/java/docs/paths/faketestqueryparamters/Put.md +++ /dev/null @@ -1,196 +0,0 @@ -# Put - -public class Put - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Put1](#put1)
The class that has a put method to call the endpoint | -| static class | [PutRequest](#putrequest)
The final request inputs class | -| static class | [PutNullableRequest](#putnullablerequest)
The initial request inputs class | -| static class | [Put0RequestBuilder](#put0requestbuilder)
A builder for the request input class | -| static class | [PutRequestBuilder](#putrequestbuilder)
A builder for the request input class | - -## Put1 -public static class Put1 extends ApiClient.ApiClient1 implements PutOperation
- -a class that allows one to call the endpoint using a method named put - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.faketestqueryparamters.put.QueryParameters; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.faketestqueryparamters.put.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.faketestqueryparamters.Put; -import org.openapijsonschematools.client.paths.faketestqueryparamters.put.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Put.Put1 apiClient = new Put.Put1(apiConfiguration, schemaConfiguration); - - -// Map validation -QueryParameters.QueryParametersMap queryParameters = - QueryParameters.QueryParameters1.validate( - new QueryParameters.QueryParametersMapBuilder() - .context( - Arrays.asList( - "a" - ) - ) - .http( - Arrays.asList( - "a" - ) - ) - .ioutil( - Arrays.asList( - "a" - ) - ) - .pipe( - Arrays.asList( - "a" - ) - ) - .refParam("a") - - .url( - Arrays.asList( - "a" - ) - ) - .build(), - schemaConfiguration -); - -var request = new PutRequestBuilder() - .queryParameters(queryParameters) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.put(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Put1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/faketestqueryparamters/put/Responses.md#endpointresponse) | put([PutRequest](#putrequest) request) | - -## PutRequest -public static class PutRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [QueryParameters.QueryParametersMap](../../paths/faketestqueryparamters/put/QueryParameters.md#queryparametersmap) | queryParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PutNullableRequest -public static class PutNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [QueryParameters.@Nullable QueryParametersMap](../../paths/faketestqueryparamters/put/QueryParameters.md#queryparametersmap) | queryParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| @Nullable Duration | timeout | - -## Put0RequestBuilder -public static class Put0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Put0RequestBuilder(Put0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PutRequest](#putrequest) | build()
Returns the request input used to call an endpoint method | -| [Put0RequestBuilder](#put0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Put0RequestBuilder](#put0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## PutRequestBuilder -public static class PutRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PutRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Put0RequestBuilder](#put0requestbuilder) | queryParameters([QueryParametersQueryParametersMap](../../paths/faketestqueryparamters/put/QueryParameters.md#queryparametersmap) queryParameters)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/FaketestqueryparamtersPutQueryParameters.md b/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/FaketestqueryparamtersPutQueryParameters.md new file mode 100644 index 00000000000..4e6592928d0 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/FaketestqueryparamtersPutQueryParameters.md @@ -0,0 +1,1419 @@ +# FaketestqueryparamtersPutQueryParameters +public class FaketestqueryparamtersPutQueryParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [FaketestqueryparamtersPutQueryParameters.FaketestqueryparamtersPutQueryParameters1Boxed](#faketestqueryparamtersputqueryparameters1boxed)
sealed interface for validated payloads | +| record | [FaketestqueryparamtersPutQueryParameters.FaketestqueryparamtersPutQueryParameters1BoxedMap](#faketestqueryparamtersputqueryparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [FaketestqueryparamtersPutQueryParameters.FaketestqueryparamtersPutQueryParameters1](#faketestqueryparamtersputqueryparameters1)
schema class | +| static class | [FaketestqueryparamtersPutQueryParameters.FaketestqueryparamtersPutQueryParametersMapBuilder](#faketestqueryparamtersputqueryparametersmapbuilder)
builder for Map payloads | +| static class | [FaketestqueryparamtersPutQueryParameters.FaketestqueryparamtersPutQueryParametersMap](#faketestqueryparamtersputqueryparametersmap)
output class for Map payloads | +| sealed interface | [FaketestqueryparamtersPutQueryParameters.FaketestqueryparamtersPutadditionalPropertiesBoxed](#faketestqueryparamtersputadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [FaketestqueryparamtersPutQueryParameters.FaketestqueryparamtersPutadditionalPropertiesBoxedVoid](#faketestqueryparamtersputadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [FaketestqueryparamtersPutQueryParameters.FaketestqueryparamtersPutadditionalPropertiesBoxedBoolean](#faketestqueryparamtersputadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [FaketestqueryparamtersPutQueryParameters.FaketestqueryparamtersPutadditionalPropertiesBoxedNumber](#faketestqueryparamtersputadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [FaketestqueryparamtersPutQueryParameters.FaketestqueryparamtersPutadditionalPropertiesBoxedString](#faketestqueryparamtersputadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [FaketestqueryparamtersPutQueryParameters.FaketestqueryparamtersPutadditionalPropertiesBoxedList](#faketestqueryparamtersputadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [FaketestqueryparamtersPutQueryParameters.FaketestqueryparamtersPutadditionalPropertiesBoxedMap](#faketestqueryparamtersputadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [FaketestqueryparamtersPutQueryParameters.FaketestqueryparamtersPutadditionalProperties](#faketestqueryparamtersputadditionalproperties)
schema class | + +## FaketestqueryparamtersPutQueryParameters1Boxed +public sealed interface FaketestqueryparamtersPutQueryParameters1Boxed
+permits
+[FaketestqueryparamtersPutQueryParameters1BoxedMap](#faketestqueryparamtersputqueryparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## FaketestqueryparamtersPutQueryParameters1BoxedMap +public record FaketestqueryparamtersPutQueryParameters1BoxedMap
+implements [FaketestqueryparamtersPutQueryParameters1Boxed](#faketestqueryparamtersputqueryparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParameters1BoxedMap([FaketestqueryparamtersPutQueryParametersMap](#faketestqueryparamtersputqueryparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap](#faketestqueryparamtersputqueryparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FaketestqueryparamtersPutQueryParameters1 +public static class FaketestqueryparamtersPutQueryParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.faketestqueryparamters.put.FaketestqueryparamtersPutQueryParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +FaketestqueryparamtersPutQueryParameters.FaketestqueryparamtersPutQueryParametersMap validatedPayload = + FaketestqueryparamtersPutQueryParameters.FaketestqueryparamtersPutQueryParameters1.validate( + new FaketestqueryparamtersPutQueryParameters.FaketestqueryparamtersPutQueryParametersMapBuilder() + .context( + Arrays.asList( + "a" + ) + ) + .http( + Arrays.asList( + "a" + ) + ) + .ioutil( + Arrays.asList( + "a" + ) + ) + .pipe( + Arrays.asList( + "a" + ) + ) + .refParam("a") + + .url( + Arrays.asList( + "a" + ) + ) + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("refParam", [StringWithValidation.StringWithValidation1.class](../../../components/schemas/StringWithValidation.md#stringwithvalidation1)),
    new PropertyEntry("ioutil", [Schema1.Schema11.class](../../../paths/faketestqueryparamters/put/parameters/parameter1/Schema1.md#schema11)),
    new PropertyEntry("context", [Schema4.Schema41.class](../../../paths/faketestqueryparamters/put/parameters/parameter4/Schema4.md#schema41)),
    new PropertyEntry("http", [Schema2.Schema21.class](../../../paths/faketestqueryparamters/put/parameters/parameter2/Schema2.md#schema21)),
    new PropertyEntry("pipe", [Schema0.Schema01.class](../../../paths/faketestqueryparamters/put/parameters/parameter0/Schema0.md#schema01)),
    new PropertyEntry("url", [Schema3.Schema31.class](../../../paths/faketestqueryparamters/put/parameters/parameter3/Schema3.md#schema31))
)
| +| Set | required = Set.of(
    "context",
    "http",
    "ioutil",
    "pipe",
    "refParam",
    "url"
)
| +| Class | additionalProperties = [FaketestqueryparamtersPutadditionalProperties.class](#faketestqueryparamtersputadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap](#faketestqueryparamtersputqueryparametersmap) | validate([Map<?, ?>](#faketestqueryparamtersputqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [FaketestqueryparamtersPutQueryParameters1BoxedMap](#faketestqueryparamtersputqueryparameters1boxedmap) | validateAndBox([Map<?, ?>](#faketestqueryparamtersputqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [FaketestqueryparamtersPutQueryParameters1Boxed](#faketestqueryparamtersputqueryparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## FaketestqueryparamtersPutQueryParametersMap000000Builder +public class FaketestqueryparamtersPutQueryParametersMap000000Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap000000Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | + +## FaketestqueryparamtersPutQueryParametersMap000001Builder +public class FaketestqueryparamtersPutQueryParametersMap000001Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap000001Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000000Builder](#faketestqueryparamtersputqueryparametersmap000000builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap000010Builder +public class FaketestqueryparamtersPutQueryParametersMap000010Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap000010Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000000Builder](#faketestqueryparamtersputqueryparametersmap000000builder) | refParam(String value) | + +## FaketestqueryparamtersPutQueryParametersMap000011Builder +public class FaketestqueryparamtersPutQueryParametersMap000011Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap000011Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000001Builder](#faketestqueryparamtersputqueryparametersmap000001builder) | refParam(String value) | +| [FaketestqueryparamtersPutQueryParametersMap000010Builder](#faketestqueryparamtersputqueryparametersmap000010builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap000100Builder +public class FaketestqueryparamtersPutQueryParametersMap000100Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap000100Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000000Builder](#faketestqueryparamtersputqueryparametersmap000000builder) | pipe(List value) | + +## FaketestqueryparamtersPutQueryParametersMap000101Builder +public class FaketestqueryparamtersPutQueryParametersMap000101Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap000101Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000001Builder](#faketestqueryparamtersputqueryparametersmap000001builder) | pipe(List value) | +| [FaketestqueryparamtersPutQueryParametersMap000100Builder](#faketestqueryparamtersputqueryparametersmap000100builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap000110Builder +public class FaketestqueryparamtersPutQueryParametersMap000110Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap000110Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000010Builder](#faketestqueryparamtersputqueryparametersmap000010builder) | pipe(List value) | +| [FaketestqueryparamtersPutQueryParametersMap000100Builder](#faketestqueryparamtersputqueryparametersmap000100builder) | refParam(String value) | + +## FaketestqueryparamtersPutQueryParametersMap000111Builder +public class FaketestqueryparamtersPutQueryParametersMap000111Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap000111Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000011Builder](#faketestqueryparamtersputqueryparametersmap000011builder) | pipe(List value) | +| [FaketestqueryparamtersPutQueryParametersMap000101Builder](#faketestqueryparamtersputqueryparametersmap000101builder) | refParam(String value) | +| [FaketestqueryparamtersPutQueryParametersMap000110Builder](#faketestqueryparamtersputqueryparametersmap000110builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap001000Builder +public class FaketestqueryparamtersPutQueryParametersMap001000Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap001000Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000000Builder](#faketestqueryparamtersputqueryparametersmap000000builder) | ioutil(List value) | + +## FaketestqueryparamtersPutQueryParametersMap001001Builder +public class FaketestqueryparamtersPutQueryParametersMap001001Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap001001Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000001Builder](#faketestqueryparamtersputqueryparametersmap000001builder) | ioutil(List value) | +| [FaketestqueryparamtersPutQueryParametersMap001000Builder](#faketestqueryparamtersputqueryparametersmap001000builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap001010Builder +public class FaketestqueryparamtersPutQueryParametersMap001010Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap001010Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000010Builder](#faketestqueryparamtersputqueryparametersmap000010builder) | ioutil(List value) | +| [FaketestqueryparamtersPutQueryParametersMap001000Builder](#faketestqueryparamtersputqueryparametersmap001000builder) | refParam(String value) | + +## FaketestqueryparamtersPutQueryParametersMap001011Builder +public class FaketestqueryparamtersPutQueryParametersMap001011Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap001011Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000011Builder](#faketestqueryparamtersputqueryparametersmap000011builder) | ioutil(List value) | +| [FaketestqueryparamtersPutQueryParametersMap001001Builder](#faketestqueryparamtersputqueryparametersmap001001builder) | refParam(String value) | +| [FaketestqueryparamtersPutQueryParametersMap001010Builder](#faketestqueryparamtersputqueryparametersmap001010builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap001100Builder +public class FaketestqueryparamtersPutQueryParametersMap001100Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap001100Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000100Builder](#faketestqueryparamtersputqueryparametersmap000100builder) | ioutil(List value) | +| [FaketestqueryparamtersPutQueryParametersMap001000Builder](#faketestqueryparamtersputqueryparametersmap001000builder) | pipe(List value) | + +## FaketestqueryparamtersPutQueryParametersMap001101Builder +public class FaketestqueryparamtersPutQueryParametersMap001101Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap001101Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000101Builder](#faketestqueryparamtersputqueryparametersmap000101builder) | ioutil(List value) | +| [FaketestqueryparamtersPutQueryParametersMap001001Builder](#faketestqueryparamtersputqueryparametersmap001001builder) | pipe(List value) | +| [FaketestqueryparamtersPutQueryParametersMap001100Builder](#faketestqueryparamtersputqueryparametersmap001100builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap001110Builder +public class FaketestqueryparamtersPutQueryParametersMap001110Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap001110Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000110Builder](#faketestqueryparamtersputqueryparametersmap000110builder) | ioutil(List value) | +| [FaketestqueryparamtersPutQueryParametersMap001010Builder](#faketestqueryparamtersputqueryparametersmap001010builder) | pipe(List value) | +| [FaketestqueryparamtersPutQueryParametersMap001100Builder](#faketestqueryparamtersputqueryparametersmap001100builder) | refParam(String value) | + +## FaketestqueryparamtersPutQueryParametersMap001111Builder +public class FaketestqueryparamtersPutQueryParametersMap001111Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap001111Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000111Builder](#faketestqueryparamtersputqueryparametersmap000111builder) | ioutil(List value) | +| [FaketestqueryparamtersPutQueryParametersMap001011Builder](#faketestqueryparamtersputqueryparametersmap001011builder) | pipe(List value) | +| [FaketestqueryparamtersPutQueryParametersMap001101Builder](#faketestqueryparamtersputqueryparametersmap001101builder) | refParam(String value) | +| [FaketestqueryparamtersPutQueryParametersMap001110Builder](#faketestqueryparamtersputqueryparametersmap001110builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap010000Builder +public class FaketestqueryparamtersPutQueryParametersMap010000Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap010000Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000000Builder](#faketestqueryparamtersputqueryparametersmap000000builder) | http(List value) | + +## FaketestqueryparamtersPutQueryParametersMap010001Builder +public class FaketestqueryparamtersPutQueryParametersMap010001Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap010001Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000001Builder](#faketestqueryparamtersputqueryparametersmap000001builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap010000Builder](#faketestqueryparamtersputqueryparametersmap010000builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap010010Builder +public class FaketestqueryparamtersPutQueryParametersMap010010Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap010010Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000010Builder](#faketestqueryparamtersputqueryparametersmap000010builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap010000Builder](#faketestqueryparamtersputqueryparametersmap010000builder) | refParam(String value) | + +## FaketestqueryparamtersPutQueryParametersMap010011Builder +public class FaketestqueryparamtersPutQueryParametersMap010011Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap010011Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000011Builder](#faketestqueryparamtersputqueryparametersmap000011builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap010001Builder](#faketestqueryparamtersputqueryparametersmap010001builder) | refParam(String value) | +| [FaketestqueryparamtersPutQueryParametersMap010010Builder](#faketestqueryparamtersputqueryparametersmap010010builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap010100Builder +public class FaketestqueryparamtersPutQueryParametersMap010100Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap010100Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000100Builder](#faketestqueryparamtersputqueryparametersmap000100builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap010000Builder](#faketestqueryparamtersputqueryparametersmap010000builder) | pipe(List value) | + +## FaketestqueryparamtersPutQueryParametersMap010101Builder +public class FaketestqueryparamtersPutQueryParametersMap010101Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap010101Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000101Builder](#faketestqueryparamtersputqueryparametersmap000101builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap010001Builder](#faketestqueryparamtersputqueryparametersmap010001builder) | pipe(List value) | +| [FaketestqueryparamtersPutQueryParametersMap010100Builder](#faketestqueryparamtersputqueryparametersmap010100builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap010110Builder +public class FaketestqueryparamtersPutQueryParametersMap010110Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap010110Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000110Builder](#faketestqueryparamtersputqueryparametersmap000110builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap010010Builder](#faketestqueryparamtersputqueryparametersmap010010builder) | pipe(List value) | +| [FaketestqueryparamtersPutQueryParametersMap010100Builder](#faketestqueryparamtersputqueryparametersmap010100builder) | refParam(String value) | + +## FaketestqueryparamtersPutQueryParametersMap010111Builder +public class FaketestqueryparamtersPutQueryParametersMap010111Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap010111Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000111Builder](#faketestqueryparamtersputqueryparametersmap000111builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap010011Builder](#faketestqueryparamtersputqueryparametersmap010011builder) | pipe(List value) | +| [FaketestqueryparamtersPutQueryParametersMap010101Builder](#faketestqueryparamtersputqueryparametersmap010101builder) | refParam(String value) | +| [FaketestqueryparamtersPutQueryParametersMap010110Builder](#faketestqueryparamtersputqueryparametersmap010110builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap011000Builder +public class FaketestqueryparamtersPutQueryParametersMap011000Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap011000Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap001000Builder](#faketestqueryparamtersputqueryparametersmap001000builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap010000Builder](#faketestqueryparamtersputqueryparametersmap010000builder) | ioutil(List value) | + +## FaketestqueryparamtersPutQueryParametersMap011001Builder +public class FaketestqueryparamtersPutQueryParametersMap011001Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap011001Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap001001Builder](#faketestqueryparamtersputqueryparametersmap001001builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap010001Builder](#faketestqueryparamtersputqueryparametersmap010001builder) | ioutil(List value) | +| [FaketestqueryparamtersPutQueryParametersMap011000Builder](#faketestqueryparamtersputqueryparametersmap011000builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap011010Builder +public class FaketestqueryparamtersPutQueryParametersMap011010Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap011010Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap001010Builder](#faketestqueryparamtersputqueryparametersmap001010builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap010010Builder](#faketestqueryparamtersputqueryparametersmap010010builder) | ioutil(List value) | +| [FaketestqueryparamtersPutQueryParametersMap011000Builder](#faketestqueryparamtersputqueryparametersmap011000builder) | refParam(String value) | + +## FaketestqueryparamtersPutQueryParametersMap011011Builder +public class FaketestqueryparamtersPutQueryParametersMap011011Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap011011Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap001011Builder](#faketestqueryparamtersputqueryparametersmap001011builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap010011Builder](#faketestqueryparamtersputqueryparametersmap010011builder) | ioutil(List value) | +| [FaketestqueryparamtersPutQueryParametersMap011001Builder](#faketestqueryparamtersputqueryparametersmap011001builder) | refParam(String value) | +| [FaketestqueryparamtersPutQueryParametersMap011010Builder](#faketestqueryparamtersputqueryparametersmap011010builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap011100Builder +public class FaketestqueryparamtersPutQueryParametersMap011100Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap011100Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap001100Builder](#faketestqueryparamtersputqueryparametersmap001100builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap010100Builder](#faketestqueryparamtersputqueryparametersmap010100builder) | ioutil(List value) | +| [FaketestqueryparamtersPutQueryParametersMap011000Builder](#faketestqueryparamtersputqueryparametersmap011000builder) | pipe(List value) | + +## FaketestqueryparamtersPutQueryParametersMap011101Builder +public class FaketestqueryparamtersPutQueryParametersMap011101Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap011101Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap001101Builder](#faketestqueryparamtersputqueryparametersmap001101builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap010101Builder](#faketestqueryparamtersputqueryparametersmap010101builder) | ioutil(List value) | +| [FaketestqueryparamtersPutQueryParametersMap011001Builder](#faketestqueryparamtersputqueryparametersmap011001builder) | pipe(List value) | +| [FaketestqueryparamtersPutQueryParametersMap011100Builder](#faketestqueryparamtersputqueryparametersmap011100builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap011110Builder +public class FaketestqueryparamtersPutQueryParametersMap011110Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap011110Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap001110Builder](#faketestqueryparamtersputqueryparametersmap001110builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap010110Builder](#faketestqueryparamtersputqueryparametersmap010110builder) | ioutil(List value) | +| [FaketestqueryparamtersPutQueryParametersMap011010Builder](#faketestqueryparamtersputqueryparametersmap011010builder) | pipe(List value) | +| [FaketestqueryparamtersPutQueryParametersMap011100Builder](#faketestqueryparamtersputqueryparametersmap011100builder) | refParam(String value) | + +## FaketestqueryparamtersPutQueryParametersMap011111Builder +public class FaketestqueryparamtersPutQueryParametersMap011111Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap011111Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap001111Builder](#faketestqueryparamtersputqueryparametersmap001111builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap010111Builder](#faketestqueryparamtersputqueryparametersmap010111builder) | ioutil(List value) | +| [FaketestqueryparamtersPutQueryParametersMap011011Builder](#faketestqueryparamtersputqueryparametersmap011011builder) | pipe(List value) | +| [FaketestqueryparamtersPutQueryParametersMap011101Builder](#faketestqueryparamtersputqueryparametersmap011101builder) | refParam(String value) | +| [FaketestqueryparamtersPutQueryParametersMap011110Builder](#faketestqueryparamtersputqueryparametersmap011110builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap100000Builder +public class FaketestqueryparamtersPutQueryParametersMap100000Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap100000Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000000Builder](#faketestqueryparamtersputqueryparametersmap000000builder) | context(List value) | + +## FaketestqueryparamtersPutQueryParametersMap100001Builder +public class FaketestqueryparamtersPutQueryParametersMap100001Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap100001Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000001Builder](#faketestqueryparamtersputqueryparametersmap000001builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap100000Builder](#faketestqueryparamtersputqueryparametersmap100000builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap100010Builder +public class FaketestqueryparamtersPutQueryParametersMap100010Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap100010Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000010Builder](#faketestqueryparamtersputqueryparametersmap000010builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap100000Builder](#faketestqueryparamtersputqueryparametersmap100000builder) | refParam(String value) | + +## FaketestqueryparamtersPutQueryParametersMap100011Builder +public class FaketestqueryparamtersPutQueryParametersMap100011Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap100011Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000011Builder](#faketestqueryparamtersputqueryparametersmap000011builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap100001Builder](#faketestqueryparamtersputqueryparametersmap100001builder) | refParam(String value) | +| [FaketestqueryparamtersPutQueryParametersMap100010Builder](#faketestqueryparamtersputqueryparametersmap100010builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap100100Builder +public class FaketestqueryparamtersPutQueryParametersMap100100Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap100100Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000100Builder](#faketestqueryparamtersputqueryparametersmap000100builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap100000Builder](#faketestqueryparamtersputqueryparametersmap100000builder) | pipe(List value) | + +## FaketestqueryparamtersPutQueryParametersMap100101Builder +public class FaketestqueryparamtersPutQueryParametersMap100101Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap100101Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000101Builder](#faketestqueryparamtersputqueryparametersmap000101builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap100001Builder](#faketestqueryparamtersputqueryparametersmap100001builder) | pipe(List value) | +| [FaketestqueryparamtersPutQueryParametersMap100100Builder](#faketestqueryparamtersputqueryparametersmap100100builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap100110Builder +public class FaketestqueryparamtersPutQueryParametersMap100110Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap100110Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000110Builder](#faketestqueryparamtersputqueryparametersmap000110builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap100010Builder](#faketestqueryparamtersputqueryparametersmap100010builder) | pipe(List value) | +| [FaketestqueryparamtersPutQueryParametersMap100100Builder](#faketestqueryparamtersputqueryparametersmap100100builder) | refParam(String value) | + +## FaketestqueryparamtersPutQueryParametersMap100111Builder +public class FaketestqueryparamtersPutQueryParametersMap100111Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap100111Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap000111Builder](#faketestqueryparamtersputqueryparametersmap000111builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap100011Builder](#faketestqueryparamtersputqueryparametersmap100011builder) | pipe(List value) | +| [FaketestqueryparamtersPutQueryParametersMap100101Builder](#faketestqueryparamtersputqueryparametersmap100101builder) | refParam(String value) | +| [FaketestqueryparamtersPutQueryParametersMap100110Builder](#faketestqueryparamtersputqueryparametersmap100110builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap101000Builder +public class FaketestqueryparamtersPutQueryParametersMap101000Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap101000Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap001000Builder](#faketestqueryparamtersputqueryparametersmap001000builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap100000Builder](#faketestqueryparamtersputqueryparametersmap100000builder) | ioutil(List value) | + +## FaketestqueryparamtersPutQueryParametersMap101001Builder +public class FaketestqueryparamtersPutQueryParametersMap101001Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap101001Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap001001Builder](#faketestqueryparamtersputqueryparametersmap001001builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap100001Builder](#faketestqueryparamtersputqueryparametersmap100001builder) | ioutil(List value) | +| [FaketestqueryparamtersPutQueryParametersMap101000Builder](#faketestqueryparamtersputqueryparametersmap101000builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap101010Builder +public class FaketestqueryparamtersPutQueryParametersMap101010Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap101010Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap001010Builder](#faketestqueryparamtersputqueryparametersmap001010builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap100010Builder](#faketestqueryparamtersputqueryparametersmap100010builder) | ioutil(List value) | +| [FaketestqueryparamtersPutQueryParametersMap101000Builder](#faketestqueryparamtersputqueryparametersmap101000builder) | refParam(String value) | + +## FaketestqueryparamtersPutQueryParametersMap101011Builder +public class FaketestqueryparamtersPutQueryParametersMap101011Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap101011Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap001011Builder](#faketestqueryparamtersputqueryparametersmap001011builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap100011Builder](#faketestqueryparamtersputqueryparametersmap100011builder) | ioutil(List value) | +| [FaketestqueryparamtersPutQueryParametersMap101001Builder](#faketestqueryparamtersputqueryparametersmap101001builder) | refParam(String value) | +| [FaketestqueryparamtersPutQueryParametersMap101010Builder](#faketestqueryparamtersputqueryparametersmap101010builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap101100Builder +public class FaketestqueryparamtersPutQueryParametersMap101100Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap101100Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap001100Builder](#faketestqueryparamtersputqueryparametersmap001100builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap100100Builder](#faketestqueryparamtersputqueryparametersmap100100builder) | ioutil(List value) | +| [FaketestqueryparamtersPutQueryParametersMap101000Builder](#faketestqueryparamtersputqueryparametersmap101000builder) | pipe(List value) | + +## FaketestqueryparamtersPutQueryParametersMap101101Builder +public class FaketestqueryparamtersPutQueryParametersMap101101Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap101101Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap001101Builder](#faketestqueryparamtersputqueryparametersmap001101builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap100101Builder](#faketestqueryparamtersputqueryparametersmap100101builder) | ioutil(List value) | +| [FaketestqueryparamtersPutQueryParametersMap101001Builder](#faketestqueryparamtersputqueryparametersmap101001builder) | pipe(List value) | +| [FaketestqueryparamtersPutQueryParametersMap101100Builder](#faketestqueryparamtersputqueryparametersmap101100builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap101110Builder +public class FaketestqueryparamtersPutQueryParametersMap101110Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap101110Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap001110Builder](#faketestqueryparamtersputqueryparametersmap001110builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap100110Builder](#faketestqueryparamtersputqueryparametersmap100110builder) | ioutil(List value) | +| [FaketestqueryparamtersPutQueryParametersMap101010Builder](#faketestqueryparamtersputqueryparametersmap101010builder) | pipe(List value) | +| [FaketestqueryparamtersPutQueryParametersMap101100Builder](#faketestqueryparamtersputqueryparametersmap101100builder) | refParam(String value) | + +## FaketestqueryparamtersPutQueryParametersMap101111Builder +public class FaketestqueryparamtersPutQueryParametersMap101111Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap101111Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap001111Builder](#faketestqueryparamtersputqueryparametersmap001111builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap100111Builder](#faketestqueryparamtersputqueryparametersmap100111builder) | ioutil(List value) | +| [FaketestqueryparamtersPutQueryParametersMap101011Builder](#faketestqueryparamtersputqueryparametersmap101011builder) | pipe(List value) | +| [FaketestqueryparamtersPutQueryParametersMap101101Builder](#faketestqueryparamtersputqueryparametersmap101101builder) | refParam(String value) | +| [FaketestqueryparamtersPutQueryParametersMap101110Builder](#faketestqueryparamtersputqueryparametersmap101110builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap110000Builder +public class FaketestqueryparamtersPutQueryParametersMap110000Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap110000Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap010000Builder](#faketestqueryparamtersputqueryparametersmap010000builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap100000Builder](#faketestqueryparamtersputqueryparametersmap100000builder) | http(List value) | + +## FaketestqueryparamtersPutQueryParametersMap110001Builder +public class FaketestqueryparamtersPutQueryParametersMap110001Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap110001Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap010001Builder](#faketestqueryparamtersputqueryparametersmap010001builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap100001Builder](#faketestqueryparamtersputqueryparametersmap100001builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap110000Builder](#faketestqueryparamtersputqueryparametersmap110000builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap110010Builder +public class FaketestqueryparamtersPutQueryParametersMap110010Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap110010Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap010010Builder](#faketestqueryparamtersputqueryparametersmap010010builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap100010Builder](#faketestqueryparamtersputqueryparametersmap100010builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap110000Builder](#faketestqueryparamtersputqueryparametersmap110000builder) | refParam(String value) | + +## FaketestqueryparamtersPutQueryParametersMap110011Builder +public class FaketestqueryparamtersPutQueryParametersMap110011Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap110011Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap010011Builder](#faketestqueryparamtersputqueryparametersmap010011builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap100011Builder](#faketestqueryparamtersputqueryparametersmap100011builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap110001Builder](#faketestqueryparamtersputqueryparametersmap110001builder) | refParam(String value) | +| [FaketestqueryparamtersPutQueryParametersMap110010Builder](#faketestqueryparamtersputqueryparametersmap110010builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap110100Builder +public class FaketestqueryparamtersPutQueryParametersMap110100Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap110100Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap010100Builder](#faketestqueryparamtersputqueryparametersmap010100builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap100100Builder](#faketestqueryparamtersputqueryparametersmap100100builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap110000Builder](#faketestqueryparamtersputqueryparametersmap110000builder) | pipe(List value) | + +## FaketestqueryparamtersPutQueryParametersMap110101Builder +public class FaketestqueryparamtersPutQueryParametersMap110101Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap110101Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap010101Builder](#faketestqueryparamtersputqueryparametersmap010101builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap100101Builder](#faketestqueryparamtersputqueryparametersmap100101builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap110001Builder](#faketestqueryparamtersputqueryparametersmap110001builder) | pipe(List value) | +| [FaketestqueryparamtersPutQueryParametersMap110100Builder](#faketestqueryparamtersputqueryparametersmap110100builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap110110Builder +public class FaketestqueryparamtersPutQueryParametersMap110110Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap110110Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap010110Builder](#faketestqueryparamtersputqueryparametersmap010110builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap100110Builder](#faketestqueryparamtersputqueryparametersmap100110builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap110010Builder](#faketestqueryparamtersputqueryparametersmap110010builder) | pipe(List value) | +| [FaketestqueryparamtersPutQueryParametersMap110100Builder](#faketestqueryparamtersputqueryparametersmap110100builder) | refParam(String value) | + +## FaketestqueryparamtersPutQueryParametersMap110111Builder +public class FaketestqueryparamtersPutQueryParametersMap110111Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap110111Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap010111Builder](#faketestqueryparamtersputqueryparametersmap010111builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap100111Builder](#faketestqueryparamtersputqueryparametersmap100111builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap110011Builder](#faketestqueryparamtersputqueryparametersmap110011builder) | pipe(List value) | +| [FaketestqueryparamtersPutQueryParametersMap110101Builder](#faketestqueryparamtersputqueryparametersmap110101builder) | refParam(String value) | +| [FaketestqueryparamtersPutQueryParametersMap110110Builder](#faketestqueryparamtersputqueryparametersmap110110builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap111000Builder +public class FaketestqueryparamtersPutQueryParametersMap111000Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap111000Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap011000Builder](#faketestqueryparamtersputqueryparametersmap011000builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap101000Builder](#faketestqueryparamtersputqueryparametersmap101000builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap110000Builder](#faketestqueryparamtersputqueryparametersmap110000builder) | ioutil(List value) | + +## FaketestqueryparamtersPutQueryParametersMap111001Builder +public class FaketestqueryparamtersPutQueryParametersMap111001Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap111001Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap011001Builder](#faketestqueryparamtersputqueryparametersmap011001builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap101001Builder](#faketestqueryparamtersputqueryparametersmap101001builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap110001Builder](#faketestqueryparamtersputqueryparametersmap110001builder) | ioutil(List value) | +| [FaketestqueryparamtersPutQueryParametersMap111000Builder](#faketestqueryparamtersputqueryparametersmap111000builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap111010Builder +public class FaketestqueryparamtersPutQueryParametersMap111010Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap111010Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap011010Builder](#faketestqueryparamtersputqueryparametersmap011010builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap101010Builder](#faketestqueryparamtersputqueryparametersmap101010builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap110010Builder](#faketestqueryparamtersputqueryparametersmap110010builder) | ioutil(List value) | +| [FaketestqueryparamtersPutQueryParametersMap111000Builder](#faketestqueryparamtersputqueryparametersmap111000builder) | refParam(String value) | + +## FaketestqueryparamtersPutQueryParametersMap111011Builder +public class FaketestqueryparamtersPutQueryParametersMap111011Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap111011Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap011011Builder](#faketestqueryparamtersputqueryparametersmap011011builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap101011Builder](#faketestqueryparamtersputqueryparametersmap101011builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap110011Builder](#faketestqueryparamtersputqueryparametersmap110011builder) | ioutil(List value) | +| [FaketestqueryparamtersPutQueryParametersMap111001Builder](#faketestqueryparamtersputqueryparametersmap111001builder) | refParam(String value) | +| [FaketestqueryparamtersPutQueryParametersMap111010Builder](#faketestqueryparamtersputqueryparametersmap111010builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap111100Builder +public class FaketestqueryparamtersPutQueryParametersMap111100Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap111100Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap011100Builder](#faketestqueryparamtersputqueryparametersmap011100builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap101100Builder](#faketestqueryparamtersputqueryparametersmap101100builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap110100Builder](#faketestqueryparamtersputqueryparametersmap110100builder) | ioutil(List value) | +| [FaketestqueryparamtersPutQueryParametersMap111000Builder](#faketestqueryparamtersputqueryparametersmap111000builder) | pipe(List value) | + +## FaketestqueryparamtersPutQueryParametersMap111101Builder +public class FaketestqueryparamtersPutQueryParametersMap111101Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap111101Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap011101Builder](#faketestqueryparamtersputqueryparametersmap011101builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap101101Builder](#faketestqueryparamtersputqueryparametersmap101101builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap110101Builder](#faketestqueryparamtersputqueryparametersmap110101builder) | ioutil(List value) | +| [FaketestqueryparamtersPutQueryParametersMap111001Builder](#faketestqueryparamtersputqueryparametersmap111001builder) | pipe(List value) | +| [FaketestqueryparamtersPutQueryParametersMap111100Builder](#faketestqueryparamtersputqueryparametersmap111100builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap111110Builder +public class FaketestqueryparamtersPutQueryParametersMap111110Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMap111110Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap011110Builder](#faketestqueryparamtersputqueryparametersmap011110builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap101110Builder](#faketestqueryparamtersputqueryparametersmap101110builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap110110Builder](#faketestqueryparamtersputqueryparametersmap110110builder) | ioutil(List value) | +| [FaketestqueryparamtersPutQueryParametersMap111010Builder](#faketestqueryparamtersputqueryparametersmap111010builder) | pipe(List value) | +| [FaketestqueryparamtersPutQueryParametersMap111100Builder](#faketestqueryparamtersputqueryparametersmap111100builder) | refParam(String value) | + +## FaketestqueryparamtersPutQueryParametersMapBuilder +public class FaketestqueryparamtersPutQueryParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutQueryParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FaketestqueryparamtersPutQueryParametersMap011111Builder](#faketestqueryparamtersputqueryparametersmap011111builder) | context(List value) | +| [FaketestqueryparamtersPutQueryParametersMap101111Builder](#faketestqueryparamtersputqueryparametersmap101111builder) | http(List value) | +| [FaketestqueryparamtersPutQueryParametersMap110111Builder](#faketestqueryparamtersputqueryparametersmap110111builder) | ioutil(List value) | +| [FaketestqueryparamtersPutQueryParametersMap111011Builder](#faketestqueryparamtersputqueryparametersmap111011builder) | pipe(List value) | +| [FaketestqueryparamtersPutQueryParametersMap111101Builder](#faketestqueryparamtersputqueryparametersmap111101builder) | refParam(String value) | +| [FaketestqueryparamtersPutQueryParametersMap111110Builder](#faketestqueryparamtersputqueryparametersmap111110builder) | url(List value) | + +## FaketestqueryparamtersPutQueryParametersMap +public static class FaketestqueryparamtersPutQueryParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [FaketestqueryparamtersPutQueryParametersMap](#faketestqueryparamtersputqueryparametersmap) | of([Map](#faketestqueryparamtersputqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [Schema4.SchemaList4](../../../paths/faketestqueryparamters/put/parameters/parameter4/Schema4.md#schemalist4) | context()
| +| [Schema2.SchemaList2](../../../paths/faketestqueryparamters/put/parameters/parameter2/Schema2.md#schemalist2) | http()
| +| [Schema1.SchemaList1](../../../paths/faketestqueryparamters/put/parameters/parameter1/Schema1.md#schemalist1) | ioutil()
| +| [Schema0.SchemaList0](../../../paths/faketestqueryparamters/put/parameters/parameter0/Schema0.md#schemalist0) | pipe()
| +| String | refParam()
| +| [Schema3.SchemaList3](../../../paths/faketestqueryparamters/put/parameters/parameter3/Schema3.md#schemalist3) | url()
| + +## FaketestqueryparamtersPutadditionalPropertiesBoxed +public sealed interface FaketestqueryparamtersPutadditionalPropertiesBoxed
+permits
+[FaketestqueryparamtersPutadditionalPropertiesBoxedVoid](#faketestqueryparamtersputadditionalpropertiesboxedvoid), +[FaketestqueryparamtersPutadditionalPropertiesBoxedBoolean](#faketestqueryparamtersputadditionalpropertiesboxedboolean), +[FaketestqueryparamtersPutadditionalPropertiesBoxedNumber](#faketestqueryparamtersputadditionalpropertiesboxednumber), +[FaketestqueryparamtersPutadditionalPropertiesBoxedString](#faketestqueryparamtersputadditionalpropertiesboxedstring), +[FaketestqueryparamtersPutadditionalPropertiesBoxedList](#faketestqueryparamtersputadditionalpropertiesboxedlist), +[FaketestqueryparamtersPutadditionalPropertiesBoxedMap](#faketestqueryparamtersputadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## FaketestqueryparamtersPutadditionalPropertiesBoxedVoid +public record FaketestqueryparamtersPutadditionalPropertiesBoxedVoid
+implements [FaketestqueryparamtersPutadditionalPropertiesBoxed](#faketestqueryparamtersputadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FaketestqueryparamtersPutadditionalPropertiesBoxedBoolean +public record FaketestqueryparamtersPutadditionalPropertiesBoxedBoolean
+implements [FaketestqueryparamtersPutadditionalPropertiesBoxed](#faketestqueryparamtersputadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FaketestqueryparamtersPutadditionalPropertiesBoxedNumber +public record FaketestqueryparamtersPutadditionalPropertiesBoxedNumber
+implements [FaketestqueryparamtersPutadditionalPropertiesBoxed](#faketestqueryparamtersputadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FaketestqueryparamtersPutadditionalPropertiesBoxedString +public record FaketestqueryparamtersPutadditionalPropertiesBoxedString
+implements [FaketestqueryparamtersPutadditionalPropertiesBoxed](#faketestqueryparamtersputadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FaketestqueryparamtersPutadditionalPropertiesBoxedList +public record FaketestqueryparamtersPutadditionalPropertiesBoxedList
+implements [FaketestqueryparamtersPutadditionalPropertiesBoxed](#faketestqueryparamtersputadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FaketestqueryparamtersPutadditionalPropertiesBoxedMap +public record FaketestqueryparamtersPutadditionalPropertiesBoxedMap
+implements [FaketestqueryparamtersPutadditionalPropertiesBoxed](#faketestqueryparamtersputadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FaketestqueryparamtersPutadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## FaketestqueryparamtersPutadditionalProperties +public static class FaketestqueryparamtersPutadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/FaketestqueryparamtersPutResponses.md b/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/FaketestqueryparamtersPutResponses.md new file mode 100644 index 00000000000..2107a4d5471 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/FaketestqueryparamtersPutResponses.md @@ -0,0 +1,29 @@ +# FaketestqueryparamtersPutResponses + +public class FaketestqueryparamtersPutResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFaketestqueryparamtersPutCode200Response](#endpointfaketestqueryparamtersputcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFaketestqueryparamtersPutCode200Response](#endpointfaketestqueryparamtersputcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFaketestqueryparamtersPutCode200Response +public record EndpointFaketestqueryparamtersPutCode200Response( + HttpResponse response, + Void body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/QueryParameters.md b/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/QueryParameters.md deleted file mode 100644 index bec63067e78..00000000000 --- a/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/QueryParameters.md +++ /dev/null @@ -1,1419 +0,0 @@ -# QueryParameters -public class QueryParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [QueryParameters.QueryParameters1Boxed](#queryparameters1boxed)
sealed interface for validated payloads | -| record | [QueryParameters.QueryParameters1BoxedMap](#queryparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [QueryParameters.QueryParameters1](#queryparameters1)
schema class | -| static class | [QueryParameters.QueryParametersMapBuilder](#queryparametersmapbuilder)
builder for Map payloads | -| static class | [QueryParameters.QueryParametersMap](#queryparametersmap)
output class for Map payloads | -| sealed interface | [QueryParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [QueryParameters.AdditionalProperties](#additionalproperties)
schema class | - -## QueryParameters1Boxed -public sealed interface QueryParameters1Boxed
-permits
-[QueryParameters1BoxedMap](#queryparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## QueryParameters1BoxedMap -public record QueryParameters1BoxedMap
-implements [QueryParameters1Boxed](#queryparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParameters1BoxedMap([QueryParametersMap](#queryparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap](#queryparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## QueryParameters1 -public static class QueryParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.faketestqueryparamters.put.QueryParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -QueryParameters.QueryParametersMap validatedPayload = - QueryParameters.QueryParameters1.validate( - new QueryParameters.QueryParametersMapBuilder() - .context( - Arrays.asList( - "a" - ) - ) - .http( - Arrays.asList( - "a" - ) - ) - .ioutil( - Arrays.asList( - "a" - ) - ) - .pipe( - Arrays.asList( - "a" - ) - ) - .refParam("a") - - .url( - Arrays.asList( - "a" - ) - ) - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("refParam", [StringWithValidation.StringWithValidation1.class](../../../components/schemas/StringWithValidation.md#stringwithvalidation1)),
    new PropertyEntry("ioutil", [Schema1.Schema11.class](../../../paths/faketestqueryparamters/put/parameters/parameter1/Schema1.md#schema11)),
    new PropertyEntry("context", [Schema4.Schema41.class](../../../paths/faketestqueryparamters/put/parameters/parameter4/Schema4.md#schema41)),
    new PropertyEntry("http", [Schema2.Schema21.class](../../../paths/faketestqueryparamters/put/parameters/parameter2/Schema2.md#schema21)),
    new PropertyEntry("pipe", [Schema0.Schema01.class](../../../paths/faketestqueryparamters/put/parameters/parameter0/Schema0.md#schema01)),
    new PropertyEntry("url", [Schema3.Schema31.class](../../../paths/faketestqueryparamters/put/parameters/parameter3/Schema3.md#schema31))
)
| -| Set | required = Set.of(
    "context",
    "http",
    "ioutil",
    "pipe",
    "refParam",
    "url"
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap](#queryparametersmap) | validate([Map<?, ?>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [QueryParameters1BoxedMap](#queryparameters1boxedmap) | validateAndBox([Map<?, ?>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [QueryParameters1Boxed](#queryparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## QueryParametersMap000000Builder -public class QueryParametersMap000000Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap000000Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | - -## QueryParametersMap000001Builder -public class QueryParametersMap000001Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap000001Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000000Builder](#queryparametersmap000000builder) | url(List value) | - -## QueryParametersMap000010Builder -public class QueryParametersMap000010Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap000010Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000000Builder](#queryparametersmap000000builder) | refParam(String value) | - -## QueryParametersMap000011Builder -public class QueryParametersMap000011Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap000011Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000001Builder](#queryparametersmap000001builder) | refParam(String value) | -| [QueryParametersMap000010Builder](#queryparametersmap000010builder) | url(List value) | - -## QueryParametersMap000100Builder -public class QueryParametersMap000100Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap000100Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000000Builder](#queryparametersmap000000builder) | pipe(List value) | - -## QueryParametersMap000101Builder -public class QueryParametersMap000101Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap000101Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000001Builder](#queryparametersmap000001builder) | pipe(List value) | -| [QueryParametersMap000100Builder](#queryparametersmap000100builder) | url(List value) | - -## QueryParametersMap000110Builder -public class QueryParametersMap000110Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap000110Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000010Builder](#queryparametersmap000010builder) | pipe(List value) | -| [QueryParametersMap000100Builder](#queryparametersmap000100builder) | refParam(String value) | - -## QueryParametersMap000111Builder -public class QueryParametersMap000111Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap000111Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000011Builder](#queryparametersmap000011builder) | pipe(List value) | -| [QueryParametersMap000101Builder](#queryparametersmap000101builder) | refParam(String value) | -| [QueryParametersMap000110Builder](#queryparametersmap000110builder) | url(List value) | - -## QueryParametersMap001000Builder -public class QueryParametersMap001000Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap001000Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000000Builder](#queryparametersmap000000builder) | ioutil(List value) | - -## QueryParametersMap001001Builder -public class QueryParametersMap001001Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap001001Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000001Builder](#queryparametersmap000001builder) | ioutil(List value) | -| [QueryParametersMap001000Builder](#queryparametersmap001000builder) | url(List value) | - -## QueryParametersMap001010Builder -public class QueryParametersMap001010Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap001010Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000010Builder](#queryparametersmap000010builder) | ioutil(List value) | -| [QueryParametersMap001000Builder](#queryparametersmap001000builder) | refParam(String value) | - -## QueryParametersMap001011Builder -public class QueryParametersMap001011Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap001011Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000011Builder](#queryparametersmap000011builder) | ioutil(List value) | -| [QueryParametersMap001001Builder](#queryparametersmap001001builder) | refParam(String value) | -| [QueryParametersMap001010Builder](#queryparametersmap001010builder) | url(List value) | - -## QueryParametersMap001100Builder -public class QueryParametersMap001100Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap001100Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000100Builder](#queryparametersmap000100builder) | ioutil(List value) | -| [QueryParametersMap001000Builder](#queryparametersmap001000builder) | pipe(List value) | - -## QueryParametersMap001101Builder -public class QueryParametersMap001101Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap001101Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000101Builder](#queryparametersmap000101builder) | ioutil(List value) | -| [QueryParametersMap001001Builder](#queryparametersmap001001builder) | pipe(List value) | -| [QueryParametersMap001100Builder](#queryparametersmap001100builder) | url(List value) | - -## QueryParametersMap001110Builder -public class QueryParametersMap001110Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap001110Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000110Builder](#queryparametersmap000110builder) | ioutil(List value) | -| [QueryParametersMap001010Builder](#queryparametersmap001010builder) | pipe(List value) | -| [QueryParametersMap001100Builder](#queryparametersmap001100builder) | refParam(String value) | - -## QueryParametersMap001111Builder -public class QueryParametersMap001111Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap001111Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000111Builder](#queryparametersmap000111builder) | ioutil(List value) | -| [QueryParametersMap001011Builder](#queryparametersmap001011builder) | pipe(List value) | -| [QueryParametersMap001101Builder](#queryparametersmap001101builder) | refParam(String value) | -| [QueryParametersMap001110Builder](#queryparametersmap001110builder) | url(List value) | - -## QueryParametersMap010000Builder -public class QueryParametersMap010000Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap010000Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000000Builder](#queryparametersmap000000builder) | http(List value) | - -## QueryParametersMap010001Builder -public class QueryParametersMap010001Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap010001Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000001Builder](#queryparametersmap000001builder) | http(List value) | -| [QueryParametersMap010000Builder](#queryparametersmap010000builder) | url(List value) | - -## QueryParametersMap010010Builder -public class QueryParametersMap010010Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap010010Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000010Builder](#queryparametersmap000010builder) | http(List value) | -| [QueryParametersMap010000Builder](#queryparametersmap010000builder) | refParam(String value) | - -## QueryParametersMap010011Builder -public class QueryParametersMap010011Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap010011Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000011Builder](#queryparametersmap000011builder) | http(List value) | -| [QueryParametersMap010001Builder](#queryparametersmap010001builder) | refParam(String value) | -| [QueryParametersMap010010Builder](#queryparametersmap010010builder) | url(List value) | - -## QueryParametersMap010100Builder -public class QueryParametersMap010100Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap010100Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000100Builder](#queryparametersmap000100builder) | http(List value) | -| [QueryParametersMap010000Builder](#queryparametersmap010000builder) | pipe(List value) | - -## QueryParametersMap010101Builder -public class QueryParametersMap010101Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap010101Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000101Builder](#queryparametersmap000101builder) | http(List value) | -| [QueryParametersMap010001Builder](#queryparametersmap010001builder) | pipe(List value) | -| [QueryParametersMap010100Builder](#queryparametersmap010100builder) | url(List value) | - -## QueryParametersMap010110Builder -public class QueryParametersMap010110Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap010110Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000110Builder](#queryparametersmap000110builder) | http(List value) | -| [QueryParametersMap010010Builder](#queryparametersmap010010builder) | pipe(List value) | -| [QueryParametersMap010100Builder](#queryparametersmap010100builder) | refParam(String value) | - -## QueryParametersMap010111Builder -public class QueryParametersMap010111Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap010111Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000111Builder](#queryparametersmap000111builder) | http(List value) | -| [QueryParametersMap010011Builder](#queryparametersmap010011builder) | pipe(List value) | -| [QueryParametersMap010101Builder](#queryparametersmap010101builder) | refParam(String value) | -| [QueryParametersMap010110Builder](#queryparametersmap010110builder) | url(List value) | - -## QueryParametersMap011000Builder -public class QueryParametersMap011000Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap011000Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap001000Builder](#queryparametersmap001000builder) | http(List value) | -| [QueryParametersMap010000Builder](#queryparametersmap010000builder) | ioutil(List value) | - -## QueryParametersMap011001Builder -public class QueryParametersMap011001Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap011001Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap001001Builder](#queryparametersmap001001builder) | http(List value) | -| [QueryParametersMap010001Builder](#queryparametersmap010001builder) | ioutil(List value) | -| [QueryParametersMap011000Builder](#queryparametersmap011000builder) | url(List value) | - -## QueryParametersMap011010Builder -public class QueryParametersMap011010Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap011010Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap001010Builder](#queryparametersmap001010builder) | http(List value) | -| [QueryParametersMap010010Builder](#queryparametersmap010010builder) | ioutil(List value) | -| [QueryParametersMap011000Builder](#queryparametersmap011000builder) | refParam(String value) | - -## QueryParametersMap011011Builder -public class QueryParametersMap011011Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap011011Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap001011Builder](#queryparametersmap001011builder) | http(List value) | -| [QueryParametersMap010011Builder](#queryparametersmap010011builder) | ioutil(List value) | -| [QueryParametersMap011001Builder](#queryparametersmap011001builder) | refParam(String value) | -| [QueryParametersMap011010Builder](#queryparametersmap011010builder) | url(List value) | - -## QueryParametersMap011100Builder -public class QueryParametersMap011100Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap011100Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap001100Builder](#queryparametersmap001100builder) | http(List value) | -| [QueryParametersMap010100Builder](#queryparametersmap010100builder) | ioutil(List value) | -| [QueryParametersMap011000Builder](#queryparametersmap011000builder) | pipe(List value) | - -## QueryParametersMap011101Builder -public class QueryParametersMap011101Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap011101Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap001101Builder](#queryparametersmap001101builder) | http(List value) | -| [QueryParametersMap010101Builder](#queryparametersmap010101builder) | ioutil(List value) | -| [QueryParametersMap011001Builder](#queryparametersmap011001builder) | pipe(List value) | -| [QueryParametersMap011100Builder](#queryparametersmap011100builder) | url(List value) | - -## QueryParametersMap011110Builder -public class QueryParametersMap011110Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap011110Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap001110Builder](#queryparametersmap001110builder) | http(List value) | -| [QueryParametersMap010110Builder](#queryparametersmap010110builder) | ioutil(List value) | -| [QueryParametersMap011010Builder](#queryparametersmap011010builder) | pipe(List value) | -| [QueryParametersMap011100Builder](#queryparametersmap011100builder) | refParam(String value) | - -## QueryParametersMap011111Builder -public class QueryParametersMap011111Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap011111Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap001111Builder](#queryparametersmap001111builder) | http(List value) | -| [QueryParametersMap010111Builder](#queryparametersmap010111builder) | ioutil(List value) | -| [QueryParametersMap011011Builder](#queryparametersmap011011builder) | pipe(List value) | -| [QueryParametersMap011101Builder](#queryparametersmap011101builder) | refParam(String value) | -| [QueryParametersMap011110Builder](#queryparametersmap011110builder) | url(List value) | - -## QueryParametersMap100000Builder -public class QueryParametersMap100000Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap100000Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000000Builder](#queryparametersmap000000builder) | context(List value) | - -## QueryParametersMap100001Builder -public class QueryParametersMap100001Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap100001Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000001Builder](#queryparametersmap000001builder) | context(List value) | -| [QueryParametersMap100000Builder](#queryparametersmap100000builder) | url(List value) | - -## QueryParametersMap100010Builder -public class QueryParametersMap100010Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap100010Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000010Builder](#queryparametersmap000010builder) | context(List value) | -| [QueryParametersMap100000Builder](#queryparametersmap100000builder) | refParam(String value) | - -## QueryParametersMap100011Builder -public class QueryParametersMap100011Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap100011Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000011Builder](#queryparametersmap000011builder) | context(List value) | -| [QueryParametersMap100001Builder](#queryparametersmap100001builder) | refParam(String value) | -| [QueryParametersMap100010Builder](#queryparametersmap100010builder) | url(List value) | - -## QueryParametersMap100100Builder -public class QueryParametersMap100100Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap100100Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000100Builder](#queryparametersmap000100builder) | context(List value) | -| [QueryParametersMap100000Builder](#queryparametersmap100000builder) | pipe(List value) | - -## QueryParametersMap100101Builder -public class QueryParametersMap100101Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap100101Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000101Builder](#queryparametersmap000101builder) | context(List value) | -| [QueryParametersMap100001Builder](#queryparametersmap100001builder) | pipe(List value) | -| [QueryParametersMap100100Builder](#queryparametersmap100100builder) | url(List value) | - -## QueryParametersMap100110Builder -public class QueryParametersMap100110Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap100110Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000110Builder](#queryparametersmap000110builder) | context(List value) | -| [QueryParametersMap100010Builder](#queryparametersmap100010builder) | pipe(List value) | -| [QueryParametersMap100100Builder](#queryparametersmap100100builder) | refParam(String value) | - -## QueryParametersMap100111Builder -public class QueryParametersMap100111Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap100111Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap000111Builder](#queryparametersmap000111builder) | context(List value) | -| [QueryParametersMap100011Builder](#queryparametersmap100011builder) | pipe(List value) | -| [QueryParametersMap100101Builder](#queryparametersmap100101builder) | refParam(String value) | -| [QueryParametersMap100110Builder](#queryparametersmap100110builder) | url(List value) | - -## QueryParametersMap101000Builder -public class QueryParametersMap101000Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap101000Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap001000Builder](#queryparametersmap001000builder) | context(List value) | -| [QueryParametersMap100000Builder](#queryparametersmap100000builder) | ioutil(List value) | - -## QueryParametersMap101001Builder -public class QueryParametersMap101001Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap101001Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap001001Builder](#queryparametersmap001001builder) | context(List value) | -| [QueryParametersMap100001Builder](#queryparametersmap100001builder) | ioutil(List value) | -| [QueryParametersMap101000Builder](#queryparametersmap101000builder) | url(List value) | - -## QueryParametersMap101010Builder -public class QueryParametersMap101010Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap101010Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap001010Builder](#queryparametersmap001010builder) | context(List value) | -| [QueryParametersMap100010Builder](#queryparametersmap100010builder) | ioutil(List value) | -| [QueryParametersMap101000Builder](#queryparametersmap101000builder) | refParam(String value) | - -## QueryParametersMap101011Builder -public class QueryParametersMap101011Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap101011Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap001011Builder](#queryparametersmap001011builder) | context(List value) | -| [QueryParametersMap100011Builder](#queryparametersmap100011builder) | ioutil(List value) | -| [QueryParametersMap101001Builder](#queryparametersmap101001builder) | refParam(String value) | -| [QueryParametersMap101010Builder](#queryparametersmap101010builder) | url(List value) | - -## QueryParametersMap101100Builder -public class QueryParametersMap101100Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap101100Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap001100Builder](#queryparametersmap001100builder) | context(List value) | -| [QueryParametersMap100100Builder](#queryparametersmap100100builder) | ioutil(List value) | -| [QueryParametersMap101000Builder](#queryparametersmap101000builder) | pipe(List value) | - -## QueryParametersMap101101Builder -public class QueryParametersMap101101Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap101101Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap001101Builder](#queryparametersmap001101builder) | context(List value) | -| [QueryParametersMap100101Builder](#queryparametersmap100101builder) | ioutil(List value) | -| [QueryParametersMap101001Builder](#queryparametersmap101001builder) | pipe(List value) | -| [QueryParametersMap101100Builder](#queryparametersmap101100builder) | url(List value) | - -## QueryParametersMap101110Builder -public class QueryParametersMap101110Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap101110Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap001110Builder](#queryparametersmap001110builder) | context(List value) | -| [QueryParametersMap100110Builder](#queryparametersmap100110builder) | ioutil(List value) | -| [QueryParametersMap101010Builder](#queryparametersmap101010builder) | pipe(List value) | -| [QueryParametersMap101100Builder](#queryparametersmap101100builder) | refParam(String value) | - -## QueryParametersMap101111Builder -public class QueryParametersMap101111Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap101111Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap001111Builder](#queryparametersmap001111builder) | context(List value) | -| [QueryParametersMap100111Builder](#queryparametersmap100111builder) | ioutil(List value) | -| [QueryParametersMap101011Builder](#queryparametersmap101011builder) | pipe(List value) | -| [QueryParametersMap101101Builder](#queryparametersmap101101builder) | refParam(String value) | -| [QueryParametersMap101110Builder](#queryparametersmap101110builder) | url(List value) | - -## QueryParametersMap110000Builder -public class QueryParametersMap110000Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap110000Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap010000Builder](#queryparametersmap010000builder) | context(List value) | -| [QueryParametersMap100000Builder](#queryparametersmap100000builder) | http(List value) | - -## QueryParametersMap110001Builder -public class QueryParametersMap110001Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap110001Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap010001Builder](#queryparametersmap010001builder) | context(List value) | -| [QueryParametersMap100001Builder](#queryparametersmap100001builder) | http(List value) | -| [QueryParametersMap110000Builder](#queryparametersmap110000builder) | url(List value) | - -## QueryParametersMap110010Builder -public class QueryParametersMap110010Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap110010Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap010010Builder](#queryparametersmap010010builder) | context(List value) | -| [QueryParametersMap100010Builder](#queryparametersmap100010builder) | http(List value) | -| [QueryParametersMap110000Builder](#queryparametersmap110000builder) | refParam(String value) | - -## QueryParametersMap110011Builder -public class QueryParametersMap110011Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap110011Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap010011Builder](#queryparametersmap010011builder) | context(List value) | -| [QueryParametersMap100011Builder](#queryparametersmap100011builder) | http(List value) | -| [QueryParametersMap110001Builder](#queryparametersmap110001builder) | refParam(String value) | -| [QueryParametersMap110010Builder](#queryparametersmap110010builder) | url(List value) | - -## QueryParametersMap110100Builder -public class QueryParametersMap110100Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap110100Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap010100Builder](#queryparametersmap010100builder) | context(List value) | -| [QueryParametersMap100100Builder](#queryparametersmap100100builder) | http(List value) | -| [QueryParametersMap110000Builder](#queryparametersmap110000builder) | pipe(List value) | - -## QueryParametersMap110101Builder -public class QueryParametersMap110101Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap110101Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap010101Builder](#queryparametersmap010101builder) | context(List value) | -| [QueryParametersMap100101Builder](#queryparametersmap100101builder) | http(List value) | -| [QueryParametersMap110001Builder](#queryparametersmap110001builder) | pipe(List value) | -| [QueryParametersMap110100Builder](#queryparametersmap110100builder) | url(List value) | - -## QueryParametersMap110110Builder -public class QueryParametersMap110110Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap110110Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap010110Builder](#queryparametersmap010110builder) | context(List value) | -| [QueryParametersMap100110Builder](#queryparametersmap100110builder) | http(List value) | -| [QueryParametersMap110010Builder](#queryparametersmap110010builder) | pipe(List value) | -| [QueryParametersMap110100Builder](#queryparametersmap110100builder) | refParam(String value) | - -## QueryParametersMap110111Builder -public class QueryParametersMap110111Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap110111Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap010111Builder](#queryparametersmap010111builder) | context(List value) | -| [QueryParametersMap100111Builder](#queryparametersmap100111builder) | http(List value) | -| [QueryParametersMap110011Builder](#queryparametersmap110011builder) | pipe(List value) | -| [QueryParametersMap110101Builder](#queryparametersmap110101builder) | refParam(String value) | -| [QueryParametersMap110110Builder](#queryparametersmap110110builder) | url(List value) | - -## QueryParametersMap111000Builder -public class QueryParametersMap111000Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap111000Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap011000Builder](#queryparametersmap011000builder) | context(List value) | -| [QueryParametersMap101000Builder](#queryparametersmap101000builder) | http(List value) | -| [QueryParametersMap110000Builder](#queryparametersmap110000builder) | ioutil(List value) | - -## QueryParametersMap111001Builder -public class QueryParametersMap111001Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap111001Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap011001Builder](#queryparametersmap011001builder) | context(List value) | -| [QueryParametersMap101001Builder](#queryparametersmap101001builder) | http(List value) | -| [QueryParametersMap110001Builder](#queryparametersmap110001builder) | ioutil(List value) | -| [QueryParametersMap111000Builder](#queryparametersmap111000builder) | url(List value) | - -## QueryParametersMap111010Builder -public class QueryParametersMap111010Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap111010Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap011010Builder](#queryparametersmap011010builder) | context(List value) | -| [QueryParametersMap101010Builder](#queryparametersmap101010builder) | http(List value) | -| [QueryParametersMap110010Builder](#queryparametersmap110010builder) | ioutil(List value) | -| [QueryParametersMap111000Builder](#queryparametersmap111000builder) | refParam(String value) | - -## QueryParametersMap111011Builder -public class QueryParametersMap111011Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap111011Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap011011Builder](#queryparametersmap011011builder) | context(List value) | -| [QueryParametersMap101011Builder](#queryparametersmap101011builder) | http(List value) | -| [QueryParametersMap110011Builder](#queryparametersmap110011builder) | ioutil(List value) | -| [QueryParametersMap111001Builder](#queryparametersmap111001builder) | refParam(String value) | -| [QueryParametersMap111010Builder](#queryparametersmap111010builder) | url(List value) | - -## QueryParametersMap111100Builder -public class QueryParametersMap111100Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap111100Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap011100Builder](#queryparametersmap011100builder) | context(List value) | -| [QueryParametersMap101100Builder](#queryparametersmap101100builder) | http(List value) | -| [QueryParametersMap110100Builder](#queryparametersmap110100builder) | ioutil(List value) | -| [QueryParametersMap111000Builder](#queryparametersmap111000builder) | pipe(List value) | - -## QueryParametersMap111101Builder -public class QueryParametersMap111101Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap111101Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap011101Builder](#queryparametersmap011101builder) | context(List value) | -| [QueryParametersMap101101Builder](#queryparametersmap101101builder) | http(List value) | -| [QueryParametersMap110101Builder](#queryparametersmap110101builder) | ioutil(List value) | -| [QueryParametersMap111001Builder](#queryparametersmap111001builder) | pipe(List value) | -| [QueryParametersMap111100Builder](#queryparametersmap111100builder) | url(List value) | - -## QueryParametersMap111110Builder -public class QueryParametersMap111110Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap111110Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap011110Builder](#queryparametersmap011110builder) | context(List value) | -| [QueryParametersMap101110Builder](#queryparametersmap101110builder) | http(List value) | -| [QueryParametersMap110110Builder](#queryparametersmap110110builder) | ioutil(List value) | -| [QueryParametersMap111010Builder](#queryparametersmap111010builder) | pipe(List value) | -| [QueryParametersMap111100Builder](#queryparametersmap111100builder) | refParam(String value) | - -## QueryParametersMapBuilder -public class QueryParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap011111Builder](#queryparametersmap011111builder) | context(List value) | -| [QueryParametersMap101111Builder](#queryparametersmap101111builder) | http(List value) | -| [QueryParametersMap110111Builder](#queryparametersmap110111builder) | ioutil(List value) | -| [QueryParametersMap111011Builder](#queryparametersmap111011builder) | pipe(List value) | -| [QueryParametersMap111101Builder](#queryparametersmap111101builder) | refParam(String value) | -| [QueryParametersMap111110Builder](#queryparametersmap111110builder) | url(List value) | - -## QueryParametersMap -public static class QueryParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [QueryParametersMap](#queryparametersmap) | of([Map](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [Schema4.SchemaList4](../../../paths/faketestqueryparamters/put/parameters/parameter4/Schema4.md#schemalist4) | context()
| -| [Schema2.SchemaList2](../../../paths/faketestqueryparamters/put/parameters/parameter2/Schema2.md#schemalist2) | http()
| -| [Schema1.SchemaList1](../../../paths/faketestqueryparamters/put/parameters/parameter1/Schema1.md#schemalist1) | ioutil()
| -| [Schema0.SchemaList0](../../../paths/faketestqueryparamters/put/parameters/parameter0/Schema0.md#schemalist0) | pipe()
| -| String | refParam()
| -| [Schema3.SchemaList3](../../../paths/faketestqueryparamters/put/parameters/parameter3/Schema3.md#schemalist3) | url()
| - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/Responses.md b/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/Responses.md deleted file mode 100644 index d4bf4fdb8f5..00000000000 --- a/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/responses/Code200Response.md deleted file mode 100644 index e89c75b2e12..00000000000 --- a/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/responses/Code200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# Code200Response - -public class Code200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) - -A class (extended from the $ref class) that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## Code200Response1 -public static class Code200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
- -a class that deserializes responses, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/responses/FaketestqueryparamtersPutCode200Response.md b/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/responses/FaketestqueryparamtersPutCode200Response.md new file mode 100644 index 00000000000..078eb74fdbe --- /dev/null +++ b/samples/client/petstore/java/docs/paths/faketestqueryparamters/put/responses/FaketestqueryparamtersPutCode200Response.md @@ -0,0 +1,17 @@ +# FaketestqueryparamtersPutCode200Response + +public class FaketestqueryparamtersPutCode200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) + +A class (extended from the $ref class) that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [FaketestqueryparamtersPutCode200Response.FaketestqueryparamtersPutCode200Response1](#faketestqueryparamtersputcode200response1)
class that deserializes responses | + +## FaketestqueryparamtersPutCode200Response1 +public static class FaketestqueryparamtersPutCode200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
+ +a class that deserializes responses, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/FakeuploaddownloadfilePost.md b/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/FakeuploaddownloadfilePost.md new file mode 100644 index 00000000000..4b62fd5a54b --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/FakeuploaddownloadfilePost.md @@ -0,0 +1,181 @@ +# FakeuploaddownloadfilePost + +public class FakeuploaddownloadfilePost + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Post](#post)
The class that has a post method to call the endpoint | +| interface | [UploadDownloadFileOperation](#uploaddownloadfileoperation)
The interface that has a uploadDownloadFile method to call the endpoint | +| static class | [PostRequest](#postrequest)
The final request inputs class | +| static class | [PostNullableRequest](#postnullablerequest)
The initial request inputs class | +| static class | [Post0RequestBuilder](#post0requestbuilder)
A builder for the request input class | +| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | + +## Post +public static class Post extends ApiClient.ApiClient1 implements PostOperation
+ +a class that allows one to call the endpoint using a method named post + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.FakeuploaddownloadfilePostRequestBody; +import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.requestbody.content.applicationoctetstream.ApplicationoctetstreamSchema; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.responses.FakeuploaddownloadfilePostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.FakeuploaddownloadfilePost; +import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.FakeuploaddownloadfilePostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakeuploaddownloadfilePost.Post apiClient = new FakeuploaddownloadfilePost.Post(apiConfiguration, schemaConfiguration); + + +ApplicationoctetstreamSchema1BoxedString requestBodyPayload = ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1.validateAndBox( + "a", + schemaConfiguration +); +FakeuploaddownloadfilePost.SealedRequestBody requestBody = new FakeuploaddownloadfilePost.ApplicationoctetstreamRequestBody(requestBodyPayload); + +var request = new FakeuploaddownloadfilePost.PostRequestBuilder() + .requestBody(requestBody) + .build(); + +FakeuploaddownloadfilePostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeuploaddownloadfilePostResponses.EndpointFakeuploaddownloadfilePostCode200Response castResponse = (FakeuploaddownloadfilePostResponses.EndpointFakeuploaddownloadfilePostCode200Response) response; +FakeuploaddownloadfilePostCode200Response.ApplicationoctetstreamResponseBody deserializedBody = (FakeuploaddownloadfilePostCode200Response.ApplicationoctetstreamResponseBody) castResponse.body; +// handle deserialized body here +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeuploaddownloadfilePostResponses.EndpointResponse](../../paths/fakeuploaddownloadfile/post/FakeuploaddownloadfilePostResponses.md#endpointresponse) | post([PostRequest](#postrequest) request) | + +## UploadDownloadFileOperation +public interface UploadDownloadFileOperation
+ +an interface that allows one to call the endpoint using a method named uploadDownloadFile by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeuploaddownloadfilePostResponses.EndpointResponse](../../paths/fakeuploaddownloadfile/post/FakeuploaddownloadfilePostResponses.md#endpointresponse) | uploadDownloadFile([PostRequest](#postrequest) request) | + +## PostRequest +public static class PostRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakeuploaddownloadfilePostRequestBody.SealedRequestBody](../../paths/fakeuploaddownloadfile/post/FakeuploaddownloadfilePostRequestBody.md#sealedrequestbody) | requestBody | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PostNullableRequest +public static class PostNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakeuploaddownloadfilePostRequestBody.@Nullable SealedRequestBody](../../paths/fakeuploaddownloadfile/post/FakeuploaddownloadfilePostRequestBody.md#sealedrequestbody) | requestBody | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| @Nullable Duration | timeout | + +## Post0RequestBuilder +public static class Post0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post0RequestBuilder(Post0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | +| [Post0RequestBuilder](#post0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Post0RequestBuilder](#post0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## PostRequestBuilder +public static class PostRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PostRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Post0RequestBuilder](#post0requestbuilder) | requestBody([FakeuploaddownloadfilePostRequestBody.SealedRequestBody](../../paths/fakeuploaddownloadfile/post/FakeuploaddownloadfilePostRequestBody.md#sealedrequestbody) requestBody)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/Post.md b/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/Post.md deleted file mode 100644 index 35c1e1b7891..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/Post.md +++ /dev/null @@ -1,170 +0,0 @@ -# Post - -public class Post - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Post1](#post1)
The class that has a post method to call the endpoint | -| static class | [PostRequest](#postrequest)
The final request inputs class | -| static class | [PostNullableRequest](#postnullablerequest)
The initial request inputs class | -| static class | [Post0RequestBuilder](#post0requestbuilder)
A builder for the request input class | -| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | - -## Post1 -public static class Post1 extends ApiClient.ApiClient1 implements PostOperation
- -a class that allows one to call the endpoint using a method named post - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.RequestBody; -import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.requestbody.content.applicationoctetstream.ApplicationoctetstreamSchema; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.Post; -import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Post.Post1 apiClient = new Post.Post1(apiConfiguration, schemaConfiguration); - - -ApplicationoctetstreamSchema1BoxedString requestBodyPayload = ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1.validateAndBox( - "a", - schemaConfiguration -); -Post.SealedRequestBody requestBody = new Post.ApplicationoctetstreamRequestBody(requestBodyPayload); - -var request = new PostRequestBuilder() - .requestBody(requestBody) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.post(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -Code200Response.ApplicationoctetstreamResponseBody deserializedBody = (Code200Response.ApplicationoctetstreamResponseBody) castResponse.body; -// handle deserialized body here -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakeuploaddownloadfile/post/Responses.md#endpointresponse) | post([PostRequest](#postrequest) request) | - -## PostRequest -public static class PostRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.SealedRequestBody](../../paths/fakeuploaddownloadfile/post/RequestBody.md#sealedrequestbody) | requestBody | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PostNullableRequest -public static class PostNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fakeuploaddownloadfile/post/RequestBody.md#sealedrequestbody) | requestBody | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| @Nullable Duration | timeout | - -## Post0RequestBuilder -public static class Post0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post0RequestBuilder(Post0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | -| [Post0RequestBuilder](#post0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Post0RequestBuilder](#post0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## PostRequestBuilder -public static class PostRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PostRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Post0RequestBuilder](#post0requestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/fakeuploaddownloadfile/post/RequestBody.md#sealedrequestbody) requestBody)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/post/FakeuploaddownloadfilePostRequestBody.md b/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/post/FakeuploaddownloadfilePostRequestBody.md new file mode 100644 index 00000000000..42fa7a21828 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/post/FakeuploaddownloadfilePostRequestBody.md @@ -0,0 +1,90 @@ +# FakeuploaddownloadfilePostRequestBody + +public class FakeuploaddownloadfilePostRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakeuploaddownloadfilePostRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakeuploaddownloadfilePostRequestBody.ApplicationoctetstreamMediaType](#applicationoctetstreammediatype)
record storing schema + encoding for a specific contentType | +| static class | [FakeuploaddownloadfilePostRequestBody.FakeuploaddownloadfilePostRequestBody1](#fakeuploaddownloadfilepostrequestbody1)
class that serializes request bodies | +| sealed interface | [FakeuploaddownloadfilePostRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [FakeuploaddownloadfilePostRequestBody.ApplicationoctetstreamRequestBody](#applicationoctetstreamrequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationoctetstreamMediaType](#applicationoctetstreammediatype) + +sealed interface that stores schema and encoding info + + +## ApplicationoctetstreamMediaType +public record ApplicationoctetstreamMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1](../../../paths/fakeuploaddownloadfile/post/requestbody/content/applicationoctetstream/ApplicationoctetstreamSchema.md#applicationoctetstreamschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationoctetstreamMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1](../../../paths/fakeuploaddownloadfile/post/requestbody/content/applicationoctetstream/ApplicationoctetstreamSchema.md#applicationoctetstreamschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## FakeuploaddownloadfilePostRequestBody1 +public static class FakeuploaddownloadfilePostRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeuploaddownloadfilePostRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = true
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/octet-stream", new [ApplicationoctetstreamMediaType](#applicationoctetstreammediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[ApplicationoctetstreamRequestBody](#applicationoctetstreamrequestbody) + +sealed interface that stores request contentType + validated schema data + +## ApplicationoctetstreamRequestBody +public record ApplicationoctetstreamRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="application/octet-stream" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationoctetstreamRequestBody(ApplicationoctetstreamSchema.StringJsonSchema1Boxed body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "application/octet-stream" | +| ApplicationoctetstreamSchema.StringJsonSchema1Boxed | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/post/FakeuploaddownloadfilePostResponses.md b/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/post/FakeuploaddownloadfilePostResponses.md new file mode 100644 index 00000000000..f5e6266e68f --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/post/FakeuploaddownloadfilePostResponses.md @@ -0,0 +1,29 @@ +# FakeuploaddownloadfilePostResponses + +public class FakeuploaddownloadfilePostResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakeuploaddownloadfilePostCode200Response](#endpointfakeuploaddownloadfilepostcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakeuploaddownloadfilePostCode200Response](#endpointfakeuploaddownloadfilepostcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakeuploaddownloadfilePostCode200Response +public record EndpointFakeuploaddownloadfilePostCode200Response( + HttpResponse response, + [FakeuploaddownloadfilePostCode200Response.SealedResponseBody](../../../paths/fakeuploaddownloadfile/post/responses/FakeuploaddownloadfilePostCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/post/RequestBody.md b/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/post/RequestBody.md deleted file mode 100644 index f031c76d24d..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/post/RequestBody.md +++ /dev/null @@ -1,90 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.ApplicationoctetstreamMediaType](#applicationoctetstreammediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.ApplicationoctetstreamRequestBody](#applicationoctetstreamrequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationoctetstreamMediaType](#applicationoctetstreammediatype) - -sealed interface that stores schema and encoding info - - -## ApplicationoctetstreamMediaType -public record ApplicationoctetstreamMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1](../../../paths/fakeuploaddownloadfile/post/requestbody/content/applicationoctetstream/ApplicationoctetstreamSchema.md#applicationoctetstreamschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationoctetstreamMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1](../../../paths/fakeuploaddownloadfile/post/requestbody/content/applicationoctetstream/ApplicationoctetstreamSchema.md#applicationoctetstreamschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = true
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/octet-stream", new [ApplicationoctetstreamMediaType](#applicationoctetstreammediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[ApplicationoctetstreamRequestBody](#applicationoctetstreamrequestbody) - -sealed interface that stores request contentType + validated schema data - -## ApplicationoctetstreamRequestBody -public record ApplicationoctetstreamRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="application/octet-stream" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationoctetstreamRequestBody(ApplicationoctetstreamSchema.StringJsonSchema1Boxed body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "application/octet-stream" | -| ApplicationoctetstreamSchema.StringJsonSchema1Boxed | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/post/Responses.md b/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/post/Responses.md deleted file mode 100644 index cd70b93f9f9..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/post/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/fakeuploaddownloadfile/post/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/post/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/post/responses/Code200Response.md deleted file mode 100644 index b26037cabf6..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/post/responses/Code200Response.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationoctetstreamMediaType](#applicationoctetstreammediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationoctetstreamResponseBody](#applicationoctetstreamresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationoctetstreamMediaType](#applicationoctetstreammediatype) - -sealed interface that stores schema and encoding info - -## ApplicationoctetstreamMediaType -public record ApplicationoctetstreamMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1](../../../../paths/fakeuploaddownloadfile/post/responses/code200response/content/applicationoctetstream/ApplicationoctetstreamSchema.md#applicationoctetstreamschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationoctetstreamMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1](../../../../paths/fakeuploaddownloadfile/post/responses/code200response/content/applicationoctetstream/ApplicationoctetstreamSchema.md#applicationoctetstreamschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationoctetstreamResponseBody](#applicationoctetstreamresponsebody) - -sealed interface that stores response body - -## ApplicationoctetstreamResponseBody -public record ApplicationoctetstreamResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/octet-stream" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationoctetstreamResponseBody(ApplicationoctetstreamSchema.StringJsonSchema1Boxed body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationoctetstreamSchema.StringJsonSchema1Boxed | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/octet-stream", new [ApplicationoctetstreamMediaType](#applicationoctetstreammediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/post/responses/FakeuploaddownloadfilePostCode200Response.md b/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/post/responses/FakeuploaddownloadfilePostCode200Response.md new file mode 100644 index 00000000000..3a7e22da29c --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeuploaddownloadfile/post/responses/FakeuploaddownloadfilePostCode200Response.md @@ -0,0 +1,87 @@ +# FakeuploaddownloadfilePostCode200Response + +public class FakeuploaddownloadfilePostCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakeuploaddownloadfilePostCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakeuploaddownloadfilePostCode200Response.ApplicationoctetstreamMediaType](#applicationoctetstreammediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakeuploaddownloadfilePostCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakeuploaddownloadfilePostCode200Response.ApplicationoctetstreamResponseBody](#applicationoctetstreamresponsebody)
implements sealed interface to store response body | +| static class | [FakeuploaddownloadfilePostCode200Response.FakeuploaddownloadfilePostCode200Response1](#fakeuploaddownloadfilepostcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationoctetstreamMediaType](#applicationoctetstreammediatype) + +sealed interface that stores schema and encoding info + +## ApplicationoctetstreamMediaType +public record ApplicationoctetstreamMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1](../../../../paths/fakeuploaddownloadfile/post/responses/code200response/content/applicationoctetstream/ApplicationoctetstreamSchema.md#applicationoctetstreamschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationoctetstreamMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1](../../../../paths/fakeuploaddownloadfile/post/responses/code200response/content/applicationoctetstream/ApplicationoctetstreamSchema.md#applicationoctetstreamschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationoctetstreamResponseBody](#applicationoctetstreamresponsebody) + +sealed interface that stores response body + +## ApplicationoctetstreamResponseBody +public record ApplicationoctetstreamResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/octet-stream" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationoctetstreamResponseBody(ApplicationoctetstreamSchema.StringJsonSchema1Boxed body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationoctetstreamSchema.StringJsonSchema1Boxed | body()
returns the body passed in in the constructor | + +## FakeuploaddownloadfilePostCode200Response1 +public static class FakeuploaddownloadfilePostCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeuploaddownloadfilePostCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/octet-stream", new [ApplicationoctetstreamMediaType](#applicationoctetstreammediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakeuploadfile/FakeuploadfilePost.md b/samples/client/petstore/java/docs/paths/fakeuploadfile/FakeuploadfilePost.md new file mode 100644 index 00000000000..8f392916e85 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeuploadfile/FakeuploadfilePost.md @@ -0,0 +1,145 @@ +# FakeuploadfilePost + +public class FakeuploadfilePost + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Post](#post)
The class that has a post method to call the endpoint | +| interface | [UploadFileOperation](#uploadfileoperation)
The interface that has a uploadFile method to call the endpoint | +| static class | [PostRequest](#postrequest)
The request inputs class | +| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | + +## Post +public static class Post extends ApiClient.ApiClient1 implements PostOperation
+ +a class that allows one to call the endpoint using a method named post + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakeuploadfile.post.FakeuploadfilePostRequestBody; +import org.openapijsonschematools.client.paths.fakeuploadfile.post.requestbody.content.multipartformdata.MultipartformdataSchema; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeuploadfile.post.responses.FakeuploadfilePostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeuploadfile.FakeuploadfilePost; +import org.openapijsonschematools.client.paths.fakeuploadfile.post.FakeuploadfilePostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakeuploadfilePost.Post apiClient = new FakeuploadfilePost.Post(apiConfiguration, schemaConfiguration); + + +var request = new FakeuploadfilePost.PostRequestBuilder().build(); + +FakeuploadfilePostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeuploadfilePostResponses.EndpointFakeuploadfilePostCode200Response castResponse = (FakeuploadfilePostResponses.EndpointFakeuploadfilePostCode200Response) response; +FakeuploadfilePostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakeuploadfilePostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeuploadfilePostResponses.EndpointResponse](../../paths/fakeuploadfile/post/FakeuploadfilePostResponses.md#endpointresponse) | post([PostRequest](#postrequest) request) | + +## UploadFileOperation +public interface UploadFileOperation
+ +an interface that allows one to call the endpoint using a method named uploadFile by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeuploadfilePostResponses.EndpointResponse](../../paths/fakeuploadfile/post/FakeuploadfilePostResponses.md#endpointresponse) | uploadFile([PostRequest](#postrequest) request) | + +## PostRequest +public static class PostRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakeuploadfilePostRequestBody.@Nullable SealedRequestBody](../../paths/fakeuploadfile/post/FakeuploadfilePostRequestBody.md#sealedrequestbody) | requestBody
optional | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PostRequestBuilder +public static class PostRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PostRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | +| [PostRequestBuilder](#postrequestbuilder) | requestBody([FakeuploadfilePostRequestBody.SealedRequestBody](../../paths/fakeuploadfile/post/FakeuploadfilePostRequestBody.md#sealedrequestbody) requestBody)
sets the optional property | +| [PostRequestBuilder](#postrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [PostRequestBuilder](#postrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakeuploadfile/Post.md b/samples/client/petstore/java/docs/paths/fakeuploadfile/Post.md deleted file mode 100644 index 218e1cd247c..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeuploadfile/Post.md +++ /dev/null @@ -1,134 +0,0 @@ -# Post - -public class Post - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Post1](#post1)
The class that has a post method to call the endpoint | -| static class | [PostRequest](#postrequest)
The request inputs class | -| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | - -## Post1 -public static class Post1 extends ApiClient.ApiClient1 implements PostOperation
- -a class that allows one to call the endpoint using a method named post - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakeuploadfile.post.RequestBody; -import org.openapijsonschematools.client.paths.fakeuploadfile.post.requestbody.content.multipartformdata.MultipartformdataSchema; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakeuploadfile.post.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakeuploadfile.Post; -import org.openapijsonschematools.client.paths.fakeuploadfile.post.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Post.Post1 apiClient = new Post.Post1(apiConfiguration, schemaConfiguration); - - -var request = new PostRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.post(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -Code200Response.ApplicationjsonResponseBody deserializedBody = (Code200Response.ApplicationjsonResponseBody) castResponse.body; -// handle deserialized body here -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakeuploadfile/post/Responses.md#endpointresponse) | post([PostRequest](#postrequest) request) | - -## PostRequest -public static class PostRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fakeuploadfile/post/RequestBody.md#sealedrequestbody) | requestBody
optional | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PostRequestBuilder -public static class PostRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PostRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | -| [PostRequestBuilder](#postrequestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/fakeuploadfile/post/RequestBody.md#sealedrequestbody) requestBody)
sets the optional property | -| [PostRequestBuilder](#postrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [PostRequestBuilder](#postrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakeuploadfile/post/FakeuploadfilePostRequestBody.md b/samples/client/petstore/java/docs/paths/fakeuploadfile/post/FakeuploadfilePostRequestBody.md new file mode 100644 index 00000000000..eab07bac01a --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeuploadfile/post/FakeuploadfilePostRequestBody.md @@ -0,0 +1,90 @@ +# FakeuploadfilePostRequestBody + +public class FakeuploadfilePostRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakeuploadfilePostRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakeuploadfilePostRequestBody.MultipartformdataMediaType](#multipartformdatamediatype)
record storing schema + encoding for a specific contentType | +| static class | [FakeuploadfilePostRequestBody.FakeuploadfilePostRequestBody1](#fakeuploadfilepostrequestbody1)
class that serializes request bodies | +| sealed interface | [FakeuploadfilePostRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [FakeuploadfilePostRequestBody.MultipartformdataRequestBody](#multipartformdatarequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[MultipartformdataMediaType](#multipartformdatamediatype) + +sealed interface that stores schema and encoding info + + +## MultipartformdataMediaType +public record MultipartformdataMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[MultipartformdataSchema.MultipartformdataSchema1](../../../paths/fakeuploadfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| MultipartformdataMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [MultipartformdataSchema.MultipartformdataSchema1](../../../paths/fakeuploadfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## FakeuploadfilePostRequestBody1 +public static class FakeuploadfilePostRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeuploadfilePostRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = false
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("multipart/form-data", new [MultipartformdataMediaType](#multipartformdatamediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[MultipartformdataRequestBody](#multipartformdatarequestbody) + +sealed interface that stores request contentType + validated schema data + +## MultipartformdataRequestBody +public record MultipartformdataRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="multipart/form-data" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| MultipartformdataRequestBody(MultipartformdataSchema.[MultipartformdataSchema1Boxed](../../../paths/fakeuploadfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "multipart/form-data" | +| MultipartformdataSchema.[MultipartformdataSchema1Boxed](../../../paths/fakeuploadfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakeuploadfile/post/FakeuploadfilePostResponses.md b/samples/client/petstore/java/docs/paths/fakeuploadfile/post/FakeuploadfilePostResponses.md new file mode 100644 index 00000000000..19391fd23db --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeuploadfile/post/FakeuploadfilePostResponses.md @@ -0,0 +1,29 @@ +# FakeuploadfilePostResponses + +public class FakeuploadfilePostResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakeuploadfilePostCode200Response](#endpointfakeuploadfilepostcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakeuploadfilePostCode200Response](#endpointfakeuploadfilepostcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakeuploadfilePostCode200Response +public record EndpointFakeuploadfilePostCode200Response( + HttpResponse response, + [FakeuploadfilePostCode200Response.SealedResponseBody](../../../paths/fakeuploadfile/post/responses/FakeuploadfilePostCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakeuploadfile/post/RequestBody.md b/samples/client/petstore/java/docs/paths/fakeuploadfile/post/RequestBody.md deleted file mode 100644 index bd73b367e08..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeuploadfile/post/RequestBody.md +++ /dev/null @@ -1,90 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.MultipartformdataMediaType](#multipartformdatamediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.MultipartformdataRequestBody](#multipartformdatarequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[MultipartformdataMediaType](#multipartformdatamediatype) - -sealed interface that stores schema and encoding info - - -## MultipartformdataMediaType -public record MultipartformdataMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[MultipartformdataSchema.MultipartformdataSchema1](../../../paths/fakeuploadfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| MultipartformdataMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [MultipartformdataSchema.MultipartformdataSchema1](../../../paths/fakeuploadfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = false
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("multipart/form-data", new [MultipartformdataMediaType](#multipartformdatamediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[MultipartformdataRequestBody](#multipartformdatarequestbody) - -sealed interface that stores request contentType + validated schema data - -## MultipartformdataRequestBody -public record MultipartformdataRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="multipart/form-data" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| MultipartformdataRequestBody(MultipartformdataSchema.[MultipartformdataSchema1Boxed](../../../paths/fakeuploadfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "multipart/form-data" | -| MultipartformdataSchema.[MultipartformdataSchema1Boxed](../../../paths/fakeuploadfile/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakeuploadfile/post/Responses.md b/samples/client/petstore/java/docs/paths/fakeuploadfile/post/Responses.md deleted file mode 100644 index d0e24bc61c3..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeuploadfile/post/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/fakeuploadfile/post/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakeuploadfile/post/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakeuploadfile/post/responses/Code200Response.md deleted file mode 100644 index 8f882ed5315..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeuploadfile/post/responses/Code200Response.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakeuploadfile/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakeuploadfile/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.[ApiResponseSchema1Boxed](../../../../components/schemas/ApiResponseSchema.md#apiresponseschema1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.[ApiResponseSchema1Boxed](../../../../components/schemas/ApiResponseSchema.md#apiresponseschema1boxed) | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakeuploadfile/post/responses/FakeuploadfilePostCode200Response.md b/samples/client/petstore/java/docs/paths/fakeuploadfile/post/responses/FakeuploadfilePostCode200Response.md new file mode 100644 index 00000000000..9d6a4abeeb9 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeuploadfile/post/responses/FakeuploadfilePostCode200Response.md @@ -0,0 +1,87 @@ +# FakeuploadfilePostCode200Response + +public class FakeuploadfilePostCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakeuploadfilePostCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakeuploadfilePostCode200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakeuploadfilePostCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakeuploadfilePostCode200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [FakeuploadfilePostCode200Response.FakeuploadfilePostCode200Response1](#fakeuploadfilepostcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakeuploadfile/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakeuploadfile/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.[ApiResponseSchema1Boxed](../../../../components/schemas/ApiResponseSchema.md#apiresponseschema1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.[ApiResponseSchema1Boxed](../../../../components/schemas/ApiResponseSchema.md#apiresponseschema1boxed) | body()
returns the body passed in in the constructor | + +## FakeuploadfilePostCode200Response1 +public static class FakeuploadfilePostCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeuploadfilePostCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakeuploadfiles/FakeuploadfilesPost.md b/samples/client/petstore/java/docs/paths/fakeuploadfiles/FakeuploadfilesPost.md new file mode 100644 index 00000000000..c4c8d15a4d9 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeuploadfiles/FakeuploadfilesPost.md @@ -0,0 +1,145 @@ +# FakeuploadfilesPost + +public class FakeuploadfilesPost + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Post](#post)
The class that has a post method to call the endpoint | +| interface | [UploadFilesOperation](#uploadfilesoperation)
The interface that has a uploadFiles method to call the endpoint | +| static class | [PostRequest](#postrequest)
The request inputs class | +| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | + +## Post +public static class Post extends ApiClient.ApiClient1 implements PostOperation
+ +a class that allows one to call the endpoint using a method named post + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.fakeuploadfiles.post.FakeuploadfilesPostRequestBody; +import org.openapijsonschematools.client.paths.fakeuploadfiles.post.requestbody.content.multipartformdata.MultipartformdataSchema; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakeuploadfiles.post.responses.FakeuploadfilesPostCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeuploadfiles.FakeuploadfilesPost; +import org.openapijsonschematools.client.paths.fakeuploadfiles.post.FakeuploadfilesPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakeuploadfilesPost.Post apiClient = new FakeuploadfilesPost.Post(apiConfiguration, schemaConfiguration); + + +var request = new FakeuploadfilesPost.PostRequestBuilder().build(); + +FakeuploadfilesPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FakeuploadfilesPostResponses.EndpointFakeuploadfilesPostCode200Response castResponse = (FakeuploadfilesPostResponses.EndpointFakeuploadfilesPostCode200Response) response; +FakeuploadfilesPostCode200Response.ApplicationjsonResponseBody deserializedBody = (FakeuploadfilesPostCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeuploadfilesPostResponses.EndpointResponse](../../paths/fakeuploadfiles/post/FakeuploadfilesPostResponses.md#endpointresponse) | post([PostRequest](#postrequest) request) | + +## UploadFilesOperation +public interface UploadFilesOperation
+ +an interface that allows one to call the endpoint using a method named uploadFiles by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakeuploadfilesPostResponses.EndpointResponse](../../paths/fakeuploadfiles/post/FakeuploadfilesPostResponses.md#endpointresponse) | uploadFiles([PostRequest](#postrequest) request) | + +## PostRequest +public static class PostRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FakeuploadfilesPostRequestBody.@Nullable SealedRequestBody](../../paths/fakeuploadfiles/post/FakeuploadfilesPostRequestBody.md#sealedrequestbody) | requestBody
optional | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PostRequestBuilder +public static class PostRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PostRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | +| [PostRequestBuilder](#postrequestbuilder) | requestBody([FakeuploadfilesPostRequestBody.SealedRequestBody](../../paths/fakeuploadfiles/post/FakeuploadfilesPostRequestBody.md#sealedrequestbody) requestBody)
sets the optional property | +| [PostRequestBuilder](#postrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [PostRequestBuilder](#postrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakeuploadfiles/Post.md b/samples/client/petstore/java/docs/paths/fakeuploadfiles/Post.md deleted file mode 100644 index 570249e79f7..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeuploadfiles/Post.md +++ /dev/null @@ -1,134 +0,0 @@ -# Post - -public class Post - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Post1](#post1)
The class that has a post method to call the endpoint | -| static class | [PostRequest](#postrequest)
The request inputs class | -| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | - -## Post1 -public static class Post1 extends ApiClient.ApiClient1 implements PostOperation
- -a class that allows one to call the endpoint using a method named post - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.fakeuploadfiles.post.RequestBody; -import org.openapijsonschematools.client.paths.fakeuploadfiles.post.requestbody.content.multipartformdata.MultipartformdataSchema; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakeuploadfiles.post.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakeuploadfiles.Post; -import org.openapijsonschematools.client.paths.fakeuploadfiles.post.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Post.Post1 apiClient = new Post.Post1(apiConfiguration, schemaConfiguration); - - -var request = new PostRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.post(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -Code200Response.ApplicationjsonResponseBody deserializedBody = (Code200Response.ApplicationjsonResponseBody) castResponse.body; -// handle deserialized body here -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakeuploadfiles/post/Responses.md#endpointresponse) | post([PostRequest](#postrequest) request) | - -## PostRequest -public static class PostRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/fakeuploadfiles/post/RequestBody.md#sealedrequestbody) | requestBody
optional | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PostRequestBuilder -public static class PostRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PostRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | -| [PostRequestBuilder](#postrequestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/fakeuploadfiles/post/RequestBody.md#sealedrequestbody) requestBody)
sets the optional property | -| [PostRequestBuilder](#postrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [PostRequestBuilder](#postrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakeuploadfiles/post/FakeuploadfilesPostRequestBody.md b/samples/client/petstore/java/docs/paths/fakeuploadfiles/post/FakeuploadfilesPostRequestBody.md new file mode 100644 index 00000000000..9a0de54b7ef --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeuploadfiles/post/FakeuploadfilesPostRequestBody.md @@ -0,0 +1,90 @@ +# FakeuploadfilesPostRequestBody + +public class FakeuploadfilesPostRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakeuploadfilesPostRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakeuploadfilesPostRequestBody.MultipartformdataMediaType](#multipartformdatamediatype)
record storing schema + encoding for a specific contentType | +| static class | [FakeuploadfilesPostRequestBody.FakeuploadfilesPostRequestBody1](#fakeuploadfilespostrequestbody1)
class that serializes request bodies | +| sealed interface | [FakeuploadfilesPostRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [FakeuploadfilesPostRequestBody.MultipartformdataRequestBody](#multipartformdatarequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[MultipartformdataMediaType](#multipartformdatamediatype) + +sealed interface that stores schema and encoding info + + +## MultipartformdataMediaType +public record MultipartformdataMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[MultipartformdataSchema.MultipartformdataSchema1](../../../paths/fakeuploadfiles/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| MultipartformdataMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [MultipartformdataSchema.MultipartformdataSchema1](../../../paths/fakeuploadfiles/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## FakeuploadfilesPostRequestBody1 +public static class FakeuploadfilesPostRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeuploadfilesPostRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = false
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("multipart/form-data", new [MultipartformdataMediaType](#multipartformdatamediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[MultipartformdataRequestBody](#multipartformdatarequestbody) + +sealed interface that stores request contentType + validated schema data + +## MultipartformdataRequestBody +public record MultipartformdataRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="multipart/form-data" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| MultipartformdataRequestBody(MultipartformdataSchema.[MultipartformdataSchema1Boxed](../../../paths/fakeuploadfiles/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "multipart/form-data" | +| MultipartformdataSchema.[MultipartformdataSchema1Boxed](../../../paths/fakeuploadfiles/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakeuploadfiles/post/FakeuploadfilesPostResponses.md b/samples/client/petstore/java/docs/paths/fakeuploadfiles/post/FakeuploadfilesPostResponses.md new file mode 100644 index 00000000000..711c48ffd60 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeuploadfiles/post/FakeuploadfilesPostResponses.md @@ -0,0 +1,29 @@ +# FakeuploadfilesPostResponses + +public class FakeuploadfilesPostResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakeuploadfilesPostCode200Response](#endpointfakeuploadfilespostcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakeuploadfilesPostCode200Response](#endpointfakeuploadfilespostcode200response) + +a sealed interface that stores endpoint responses + +## EndpointFakeuploadfilesPostCode200Response +public record EndpointFakeuploadfilesPostCode200Response( + HttpResponse response, + [FakeuploadfilesPostCode200Response.SealedResponseBody](../../../paths/fakeuploadfiles/post/responses/FakeuploadfilesPostCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakeuploadfiles/post/RequestBody.md b/samples/client/petstore/java/docs/paths/fakeuploadfiles/post/RequestBody.md deleted file mode 100644 index 0b3ec075d2c..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeuploadfiles/post/RequestBody.md +++ /dev/null @@ -1,90 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.MultipartformdataMediaType](#multipartformdatamediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.MultipartformdataRequestBody](#multipartformdatarequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[MultipartformdataMediaType](#multipartformdatamediatype) - -sealed interface that stores schema and encoding info - - -## MultipartformdataMediaType -public record MultipartformdataMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[MultipartformdataSchema.MultipartformdataSchema1](../../../paths/fakeuploadfiles/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| MultipartformdataMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [MultipartformdataSchema.MultipartformdataSchema1](../../../paths/fakeuploadfiles/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = false
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("multipart/form-data", new [MultipartformdataMediaType](#multipartformdatamediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[MultipartformdataRequestBody](#multipartformdatarequestbody) - -sealed interface that stores request contentType + validated schema data - -## MultipartformdataRequestBody -public record MultipartformdataRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="multipart/form-data" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| MultipartformdataRequestBody(MultipartformdataSchema.[MultipartformdataSchema1Boxed](../../../paths/fakeuploadfiles/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "multipart/form-data" | -| MultipartformdataSchema.[MultipartformdataSchema1Boxed](../../../paths/fakeuploadfiles/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/fakeuploadfiles/post/Responses.md b/samples/client/petstore/java/docs/paths/fakeuploadfiles/post/Responses.md deleted file mode 100644 index 345c542d872..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeuploadfiles/post/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/fakeuploadfiles/post/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakeuploadfiles/post/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakeuploadfiles/post/responses/Code200Response.md deleted file mode 100644 index 3afe4597cb4..00000000000 --- a/samples/client/petstore/java/docs/paths/fakeuploadfiles/post/responses/Code200Response.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakeuploadfiles/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakeuploadfiles/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.[ApiResponseSchema1Boxed](../../../../components/schemas/ApiResponseSchema.md#apiresponseschema1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.[ApiResponseSchema1Boxed](../../../../components/schemas/ApiResponseSchema.md#apiresponseschema1boxed) | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakeuploadfiles/post/responses/FakeuploadfilesPostCode200Response.md b/samples/client/petstore/java/docs/paths/fakeuploadfiles/post/responses/FakeuploadfilesPostCode200Response.md new file mode 100644 index 00000000000..995bbba0333 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakeuploadfiles/post/responses/FakeuploadfilesPostCode200Response.md @@ -0,0 +1,87 @@ +# FakeuploadfilesPostCode200Response + +public class FakeuploadfilesPostCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakeuploadfilesPostCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakeuploadfilesPostCode200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakeuploadfilesPostCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakeuploadfilesPostCode200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [FakeuploadfilesPostCode200Response.FakeuploadfilesPostCode200Response1](#fakeuploadfilespostcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakeuploadfiles/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakeuploadfiles/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.[ApiResponseSchema1Boxed](../../../../components/schemas/ApiResponseSchema.md#apiresponseschema1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.[ApiResponseSchema1Boxed](../../../../components/schemas/ApiResponseSchema.md#apiresponseschema1boxed) | body()
returns the body passed in in the constructor | + +## FakeuploadfilesPostCode200Response1 +public static class FakeuploadfilesPostCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakeuploadfilesPostCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakewildcardresponses/FakewildcardresponsesGet.md b/samples/client/petstore/java/docs/paths/fakewildcardresponses/FakewildcardresponsesGet.md new file mode 100644 index 00000000000..3730d8d17a6 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakewildcardresponses/FakewildcardresponsesGet.md @@ -0,0 +1,160 @@ +# FakewildcardresponsesGet + +public class FakewildcardresponsesGet + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Get](#get)
The class that has a get method to call the endpoint | +| interface | [WildCardResponsesOperation](#wildcardresponsesoperation)
The interface that has a wildCardResponses method to call the endpoint | +| static class | [GetRequest](#getrequest)
The request inputs class | +| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | + +## Get +public static class Get extends ApiClient.ApiClient1 implements GetOperation
+ +a class that allows one to call the endpoint using a method named get + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.FakewildcardresponsesGetCode1XXResponse; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.FakewildcardresponsesGetCode200Response; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.FakewildcardresponsesGetCode2XXResponse; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.FakewildcardresponsesGetCode3XXResponse; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.FakewildcardresponsesGetCode4XXResponse; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.FakewildcardresponsesGetCode5XXResponse; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.fakewildcardresponses.FakewildcardresponsesGet; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.FakewildcardresponsesGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FakewildcardresponsesGet.Get apiClient = new FakewildcardresponsesGet.Get(apiConfiguration, schemaConfiguration); + + +var request = new FakewildcardresponsesGet.GetRequestBuilder().build(); + +FakewildcardresponsesGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (FakewildcardresponsesGetCode4XXResponse.ResponseApiException | FakewildcardresponsesGetCode5XXResponse.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +if (response instanceof FakewildcardresponsesGetResponses.EndpointFakewildcardresponsesGetCode1XXResponse castResponse) { +FakewildcardresponsesGetCode1XXResponse.ApplicationjsonResponseBody deserializedBody = (FakewildcardresponsesGetCode1XXResponse.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +} else if (response instanceof FakewildcardresponsesGetResponses.EndpointFakewildcardresponsesGetCode2XXResponse castResponse) { +FakewildcardresponsesGetCode2XXResponse.ApplicationjsonResponseBody deserializedBody = (FakewildcardresponsesGetCode2XXResponse.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +} else if (response instanceof FakewildcardresponsesGetResponses.EndpointFakewildcardresponsesGetCode200Response castResponse) { +FakewildcardresponsesGetCode200Response.ApplicationjsonResponseBody deserializedBody = (FakewildcardresponsesGetCode200Response.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +} else { + FakewildcardresponsesGetResponses.EndpointFakewildcardresponsesGetCode3XXResponse castResponse = (FakewildcardresponsesGetResponses.EndpointFakewildcardresponsesGetCode3XXResponse) response; +FakewildcardresponsesGetCode3XXResponse.ApplicationjsonResponseBody deserializedBody = (FakewildcardresponsesGetCode3XXResponse.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +} +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakewildcardresponsesGetResponses.EndpointResponse](../../paths/fakewildcardresponses/get/FakewildcardresponsesGetResponses.md#endpointresponse) | get([GetRequest](#getrequest) request) | + +## WildCardResponsesOperation +public interface WildCardResponsesOperation
+ +an interface that allows one to call the endpoint using a method named wildCardResponses by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FakewildcardresponsesGetResponses.EndpointResponse](../../paths/fakewildcardresponses/get/FakewildcardresponsesGetResponses.md#endpointresponse) | wildCardResponses([GetRequest](#getrequest) request) | + +## GetRequest +public static class GetRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## GetRequestBuilder +public static class GetRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| GetRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | +| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakewildcardresponses/Get.md b/samples/client/petstore/java/docs/paths/fakewildcardresponses/Get.md deleted file mode 100644 index 179e8247d35..00000000000 --- a/samples/client/petstore/java/docs/paths/fakewildcardresponses/Get.md +++ /dev/null @@ -1,149 +0,0 @@ -# Get - -public class Get - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Get1](#get1)
The class that has a get method to call the endpoint | -| static class | [GetRequest](#getrequest)
The request inputs class | -| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | - -## Get1 -public static class Get1 extends ApiClient.ApiClient1 implements GetOperation
- -a class that allows one to call the endpoint using a method named get - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.Code1XXResponse; -import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.Code200Response; -import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.Code2XXResponse; -import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.Code3XXResponse; -import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.Code4XXResponse; -import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.Code5XXResponse; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.fakewildcardresponses.Get; -import org.openapijsonschematools.client.paths.fakewildcardresponses.get.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Get.Get1 apiClient = new Get.Get1(apiConfiguration, schemaConfiguration); - - -var request = new GetRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.get(request); -} catch (Code4XXResponse.ResponseApiException | Code5XXResponse.ResponseApiException e) { - // server returned an error response defined in the openapi document - throw e; -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -if (response instanceof Responses.EndpointCode1XXResponse castResponse) { -Code1XXResponse.ApplicationjsonResponseBody deserializedBody = (Code1XXResponse.ApplicationjsonResponseBody) castResponse.body; -// handle deserialized body here -} else if (response instanceof Responses.EndpointCode2XXResponse castResponse) { -Code2XXResponse.ApplicationjsonResponseBody deserializedBody = (Code2XXResponse.ApplicationjsonResponseBody) castResponse.body; -// handle deserialized body here -} else if (response instanceof Responses.EndpointCode200Response castResponse) { -Code200Response.ApplicationjsonResponseBody deserializedBody = (Code200Response.ApplicationjsonResponseBody) castResponse.body; -// handle deserialized body here -} else { - Responses.EndpointCode3XXResponse castResponse = (Responses.EndpointCode3XXResponse) response; -Code3XXResponse.ApplicationjsonResponseBody deserializedBody = (Code3XXResponse.ApplicationjsonResponseBody) castResponse.body; -// handle deserialized body here -} -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/fakewildcardresponses/get/Responses.md#endpointresponse) | get([GetRequest](#getrequest) request) | - -## GetRequest -public static class GetRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## GetRequestBuilder -public static class GetRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| GetRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | -| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/FakewildcardresponsesGetResponses.md b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/FakewildcardresponsesGetResponses.md new file mode 100644 index 00000000000..9a356985f83 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/FakewildcardresponsesGetResponses.md @@ -0,0 +1,62 @@ +# FakewildcardresponsesGetResponses + +public class FakewildcardresponsesGetResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFakewildcardresponsesGetCode1XXResponse](#endpointfakewildcardresponsesgetcode1xxresponse)
the response for 1XX | +| record | [EndpointFakewildcardresponsesGetCode2XXResponse](#endpointfakewildcardresponsesgetcode2xxresponse)
the response for 2XX | +| record | [EndpointFakewildcardresponsesGetCode200Response](#endpointfakewildcardresponsesgetcode200response)
the response for 200 | +| record | [EndpointFakewildcardresponsesGetCode3XXResponse](#endpointfakewildcardresponsesgetcode3xxresponse)
the response for 3XX | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFakewildcardresponsesGetCode1XXResponse](#endpointfakewildcardresponsesgetcode1xxresponse), +[EndpointFakewildcardresponsesGetCode2XXResponse](#endpointfakewildcardresponsesgetcode2xxresponse), +[EndpointFakewildcardresponsesGetCode200Response](#endpointfakewildcardresponsesgetcode200response), +[EndpointFakewildcardresponsesGetCode3XXResponse](#endpointfakewildcardresponsesgetcode3xxresponse) + +a sealed interface that stores endpoint responses + +## EndpointFakewildcardresponsesGetCode1XXResponse +public record EndpointFakewildcardresponsesGetCode1XXResponse( + HttpResponse response, + [FakewildcardresponsesGetCode1XXResponse.SealedResponseBody](../../../paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode1XXResponse.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + +## EndpointFakewildcardresponsesGetCode2XXResponse +public record EndpointFakewildcardresponsesGetCode2XXResponse( + HttpResponse response, + [FakewildcardresponsesGetCode2XXResponse.SealedResponseBody](../../../paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode2XXResponse.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + +## EndpointFakewildcardresponsesGetCode200Response +public record EndpointFakewildcardresponsesGetCode200Response( + HttpResponse response, + [FakewildcardresponsesGetCode200Response.SealedResponseBody](../../../paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + +## EndpointFakewildcardresponsesGetCode3XXResponse +public record EndpointFakewildcardresponsesGetCode3XXResponse( + HttpResponse response, + [FakewildcardresponsesGetCode3XXResponse.SealedResponseBody](../../../paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode3XXResponse.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/Responses.md b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/Responses.md deleted file mode 100644 index 83369062bc8..00000000000 --- a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/Responses.md +++ /dev/null @@ -1,62 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode1XXResponse](#endpointcode1xxresponse)
the response for 1XX | -| record | [EndpointCode2XXResponse](#endpointcode2xxresponse)
the response for 2XX | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | -| record | [EndpointCode3XXResponse](#endpointcode3xxresponse)
the response for 3XX | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode1XXResponse](#endpointcode1xxresponse), -[EndpointCode2XXResponse](#endpointcode2xxresponse), -[EndpointCode200Response](#endpointcode200response), -[EndpointCode3XXResponse](#endpointcode3xxresponse) - -a sealed interface that stores endpoint responses - -## EndpointCode1XXResponse -public record EndpointCode1XXResponse( - HttpResponse response, - [Code1XXResponse.SealedResponseBody](../../../paths/fakewildcardresponses/get/responses/Code1XXResponse.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - -## EndpointCode2XXResponse -public record EndpointCode2XXResponse( - HttpResponse response, - [Code2XXResponse.SealedResponseBody](../../../paths/fakewildcardresponses/get/responses/Code2XXResponse.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/fakewildcardresponses/get/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - -## EndpointCode3XXResponse -public record EndpointCode3XXResponse( - HttpResponse response, - [Code3XXResponse.SealedResponseBody](../../../paths/fakewildcardresponses/get/responses/Code3XXResponse.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/Code1XXResponse.md b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/Code1XXResponse.md deleted file mode 100644 index b2d2e8f2a08..00000000000 --- a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/Code1XXResponse.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code1XXResponse - -public class Code1XXResponse - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code1XXResponse.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code1XXResponse.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code1XXResponse.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code1XXResponse.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code1XXResponse.Code1XXResponse1](#code1xxresponse1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakewildcardresponses/get/responses/code1xxresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakewildcardresponses/get/responses/code1xxresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | - -## Code1XXResponse1 -public static class Code1XXResponse1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code1XXResponse1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/Code200Response.md deleted file mode 100644 index 6263ecaf4ac..00000000000 --- a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/Code200Response.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakewildcardresponses/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakewildcardresponses/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/Code2XXResponse.md b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/Code2XXResponse.md deleted file mode 100644 index 53389585be9..00000000000 --- a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/Code2XXResponse.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code2XXResponse - -public class Code2XXResponse - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code2XXResponse.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code2XXResponse.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code2XXResponse.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code2XXResponse.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code2XXResponse.Code2XXResponse1](#code2xxresponse1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakewildcardresponses/get/responses/code2xxresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakewildcardresponses/get/responses/code2xxresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | - -## Code2XXResponse1 -public static class Code2XXResponse1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code2XXResponse1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/Code3XXResponse.md b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/Code3XXResponse.md deleted file mode 100644 index d939aac9315..00000000000 --- a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/Code3XXResponse.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code3XXResponse - -public class Code3XXResponse - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code3XXResponse.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code3XXResponse.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code3XXResponse.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code3XXResponse.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code3XXResponse.Code3XXResponse1](#code3xxresponse1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakewildcardresponses/get/responses/code3xxresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakewildcardresponses/get/responses/code3xxresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | - -## Code3XXResponse1 -public static class Code3XXResponse1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code3XXResponse1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/Code4XXResponse.md b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/Code4XXResponse.md deleted file mode 100644 index 2950af0a0fa..00000000000 --- a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/Code4XXResponse.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code4XXResponse - -public class Code4XXResponse - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code4XXResponse.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code4XXResponse.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code4XXResponse.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code4XXResponse.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code4XXResponse.Code4XXResponse1](#code4xxresponse1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakewildcardresponses/get/responses/code4xxresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakewildcardresponses/get/responses/code4xxresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | - -## Code4XXResponse1 -public static class Code4XXResponse1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code4XXResponse1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/Code5XXResponse.md b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/Code5XXResponse.md deleted file mode 100644 index 960ef4a79ad..00000000000 --- a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/Code5XXResponse.md +++ /dev/null @@ -1,87 +0,0 @@ -# Code5XXResponse - -public class Code5XXResponse - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code5XXResponse.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code5XXResponse.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code5XXResponse.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code5XXResponse.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code5XXResponse.Code5XXResponse1](#code5xxresponse1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakewildcardresponses/get/responses/code5xxresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakewildcardresponses/get/responses/code5xxresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | - -## Code5XXResponse1 -public static class Code5XXResponse1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code5XXResponse1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode1XXResponse.md b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode1XXResponse.md new file mode 100644 index 00000000000..23636633dee --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode1XXResponse.md @@ -0,0 +1,87 @@ +# FakewildcardresponsesGetCode1XXResponse + +public class FakewildcardresponsesGetCode1XXResponse + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakewildcardresponsesGetCode1XXResponse.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakewildcardresponsesGetCode1XXResponse.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakewildcardresponsesGetCode1XXResponse.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakewildcardresponsesGetCode1XXResponse.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [FakewildcardresponsesGetCode1XXResponse.FakewildcardresponsesGetCode1XXResponse1](#fakewildcardresponsesgetcode1xxresponse1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakewildcardresponses/get/responses/code1xxresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakewildcardresponses/get/responses/code1xxresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | + +## FakewildcardresponsesGetCode1XXResponse1 +public static class FakewildcardresponsesGetCode1XXResponse1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakewildcardresponsesGetCode1XXResponse1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode200Response.md b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode200Response.md new file mode 100644 index 00000000000..fa140c39b02 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode200Response.md @@ -0,0 +1,87 @@ +# FakewildcardresponsesGetCode200Response + +public class FakewildcardresponsesGetCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakewildcardresponsesGetCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakewildcardresponsesGetCode200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakewildcardresponsesGetCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakewildcardresponsesGetCode200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [FakewildcardresponsesGetCode200Response.FakewildcardresponsesGetCode200Response1](#fakewildcardresponsesgetcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakewildcardresponses/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakewildcardresponses/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | + +## FakewildcardresponsesGetCode200Response1 +public static class FakewildcardresponsesGetCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakewildcardresponsesGetCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode2XXResponse.md b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode2XXResponse.md new file mode 100644 index 00000000000..dc0e68874f8 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode2XXResponse.md @@ -0,0 +1,87 @@ +# FakewildcardresponsesGetCode2XXResponse + +public class FakewildcardresponsesGetCode2XXResponse + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakewildcardresponsesGetCode2XXResponse.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakewildcardresponsesGetCode2XXResponse.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakewildcardresponsesGetCode2XXResponse.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakewildcardresponsesGetCode2XXResponse.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [FakewildcardresponsesGetCode2XXResponse.FakewildcardresponsesGetCode2XXResponse1](#fakewildcardresponsesgetcode2xxresponse1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakewildcardresponses/get/responses/code2xxresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakewildcardresponses/get/responses/code2xxresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | + +## FakewildcardresponsesGetCode2XXResponse1 +public static class FakewildcardresponsesGetCode2XXResponse1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakewildcardresponsesGetCode2XXResponse1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode3XXResponse.md b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode3XXResponse.md new file mode 100644 index 00000000000..bb7f367daab --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode3XXResponse.md @@ -0,0 +1,87 @@ +# FakewildcardresponsesGetCode3XXResponse + +public class FakewildcardresponsesGetCode3XXResponse + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakewildcardresponsesGetCode3XXResponse.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakewildcardresponsesGetCode3XXResponse.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakewildcardresponsesGetCode3XXResponse.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakewildcardresponsesGetCode3XXResponse.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [FakewildcardresponsesGetCode3XXResponse.FakewildcardresponsesGetCode3XXResponse1](#fakewildcardresponsesgetcode3xxresponse1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakewildcardresponses/get/responses/code3xxresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakewildcardresponses/get/responses/code3xxresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | + +## FakewildcardresponsesGetCode3XXResponse1 +public static class FakewildcardresponsesGetCode3XXResponse1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakewildcardresponsesGetCode3XXResponse1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode4XXResponse.md b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode4XXResponse.md new file mode 100644 index 00000000000..a8fab3d2cf1 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode4XXResponse.md @@ -0,0 +1,87 @@ +# FakewildcardresponsesGetCode4XXResponse + +public class FakewildcardresponsesGetCode4XXResponse + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakewildcardresponsesGetCode4XXResponse.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakewildcardresponsesGetCode4XXResponse.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakewildcardresponsesGetCode4XXResponse.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakewildcardresponsesGetCode4XXResponse.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [FakewildcardresponsesGetCode4XXResponse.FakewildcardresponsesGetCode4XXResponse1](#fakewildcardresponsesgetcode4xxresponse1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakewildcardresponses/get/responses/code4xxresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakewildcardresponses/get/responses/code4xxresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | + +## FakewildcardresponsesGetCode4XXResponse1 +public static class FakewildcardresponsesGetCode4XXResponse1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakewildcardresponsesGetCode4XXResponse1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode5XXResponse.md b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode5XXResponse.md new file mode 100644 index 00000000000..4b06440cd06 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode5XXResponse.md @@ -0,0 +1,87 @@ +# FakewildcardresponsesGetCode5XXResponse + +public class FakewildcardresponsesGetCode5XXResponse + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FakewildcardresponsesGetCode5XXResponse.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FakewildcardresponsesGetCode5XXResponse.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FakewildcardresponsesGetCode5XXResponse.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FakewildcardresponsesGetCode5XXResponse.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [FakewildcardresponsesGetCode5XXResponse.FakewildcardresponsesGetCode5XXResponse1](#fakewildcardresponsesgetcode5xxresponse1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakewildcardresponses/get/responses/code5xxresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/fakewildcardresponses/get/responses/code5xxresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.AnyTypeJsonSchema1Boxed | body()
returns the body passed in in the constructor | + +## FakewildcardresponsesGetCode5XXResponse1 +public static class FakewildcardresponsesGetCode5XXResponse1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FakewildcardresponsesGetCode5XXResponse1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/foo/FooGet.md b/samples/client/petstore/java/docs/paths/foo/FooGet.md new file mode 100644 index 00000000000..c458490f4de --- /dev/null +++ b/samples/client/petstore/java/docs/paths/foo/FooGet.md @@ -0,0 +1,140 @@ +# FooGet + +public class FooGet + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Get](#get)
The class that has a get method to call the endpoint | +| interface | [FooGetOperation](#foogetoperation)
The interface that has a fooGet method to call the endpoint | +| static class | [GetRequest](#getrequest)
The request inputs class | +| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | + +## Get +public static class Get extends ApiClient.ApiClient1 implements GetOperation
+ +a class that allows one to call the endpoint using a method named get + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.foo.get.FooGetServerInfo; +import org.openapijsonschematools.client.paths.foo.get.servers.FooGetServer0; +import org.openapijsonschematools.client.paths.foo.get.servers.FooGetServer1; +import org.openapijsonschematools.client.paths.foo.get.responses.FooGetCodedefaultResponse; +import org.openapijsonschematools.client.paths.foo.get.FooGetServerInfo; +import org.openapijsonschematools.client.paths.foo.FooGet; +import org.openapijsonschematools.client.paths.foo.get.FooGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .fooGetServerInfo( + new FooGetServerInfo.FooGetServerInfoBuilder() + .fooGetServer0(new FooGetServer0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .fooGetServerInfoServerIndex(FooGetServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +FooGet.Get apiClient = new FooGet.Get(apiConfiguration, schemaConfiguration); + + +var request = new FooGet.GetRequestBuilder().build(); + +FooGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +FooGetResponses.EndpointFooGetCodedefaultResponse castResponse = (FooGetResponses.EndpointFooGetCodedefaultResponse) response; +FooGetCodedefaultResponse.ApplicationjsonResponseBody deserializedBody = (FooGetCodedefaultResponse.ApplicationjsonResponseBody) castResponse.body; +// handle deserialized body here +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FooGetResponses.EndpointResponse](../../paths/foo/get/FooGetResponses.md#endpointresponse) | get([GetRequest](#getrequest) request) | + +## FooGetOperation +public interface FooGetOperation
+ +an interface that allows one to call the endpoint using a method named fooGet by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [FooGetResponses.EndpointResponse](../../paths/foo/get/FooGetResponses.md#endpointresponse) | fooGet([GetRequest](#getrequest) request) | + +## GetRequest +public static class GetRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [FooGetServerInfo.@Nullable ServerIndex](../../paths/foo/get/FooGetServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## GetRequestBuilder +public static class GetRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| GetRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | +| [GetRequestBuilder](#getrequestbuilder) | serverIndex([FooGetServerInfo.ServerIndex](../../paths/foo/get/FooGetServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/foo/Get.md b/samples/client/petstore/java/docs/paths/foo/Get.md deleted file mode 100644 index 38db180aac1..00000000000 --- a/samples/client/petstore/java/docs/paths/foo/Get.md +++ /dev/null @@ -1,129 +0,0 @@ -# Get - -public class Get - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Get1](#get1)
The class that has a get method to call the endpoint | -| static class | [GetRequest](#getrequest)
The request inputs class | -| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | - -## Get1 -public static class Get1 extends ApiClient.ApiClient1 implements GetOperation
- -a class that allows one to call the endpoint using a method named get - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.foo.get.FooGetServerInfo; -import org.openapijsonschematools.client.paths.foo.get.servers.FooGetServer0; -import org.openapijsonschematools.client.paths.foo.get.servers.FooGetServer1; -import org.openapijsonschematools.client.paths.foo.get.responses.CodedefaultResponse; -import org.openapijsonschematools.client.paths.foo.get.FooGetServerInfo; -import org.openapijsonschematools.client.paths.foo.Get; -import org.openapijsonschematools.client.paths.foo.get.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .fooGetServerInfo( - new FooGetServerInfo.FooGetServerInfoBuilder() - .fooGetServer0(new FooGetServer0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .fooGetServerInfoServerIndex(FooGetServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Get.Get1 apiClient = new Get.Get1(apiConfiguration, schemaConfiguration); - - -var request = new GetRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.get(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCodedefaultResponse castResponse = (Responses.EndpointCodedefaultResponse) response; -CodedefaultResponse.ApplicationjsonResponseBody deserializedBody = (CodedefaultResponse.ApplicationjsonResponseBody) castResponse.body; -// handle deserialized body here -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/foo/get/Responses.md#endpointresponse) | get([GetRequest](#getrequest) request) | - -## GetRequest -public static class GetRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [FooGetServerInfo.@Nullable ServerIndex](../../paths/foo/get/FooGetServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## GetRequestBuilder -public static class GetRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| GetRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | -| [GetRequestBuilder](#getrequestbuilder) | serverIndex([FooGetServerInfo.ServerIndex](../../paths/foo/get/FooGetServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/foo/get/FooGetResponses.md b/samples/client/petstore/java/docs/paths/foo/get/FooGetResponses.md new file mode 100644 index 00000000000..5bf9bb7e45b --- /dev/null +++ b/samples/client/petstore/java/docs/paths/foo/get/FooGetResponses.md @@ -0,0 +1,29 @@ +# FooGetResponses + +public class FooGetResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointFooGetCodedefaultResponse](#endpointfoogetcodedefaultresponse)
the response for default | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointFooGetCodedefaultResponse](#endpointfoogetcodedefaultresponse) + +a sealed interface that stores endpoint responses + +## EndpointFooGetCodedefaultResponse +public record EndpointFooGetCodedefaultResponse( + HttpResponse response, + [FooGetCodedefaultResponse.SealedResponseBody](../../../paths/foo/get/responses/FooGetCodedefaultResponse.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/foo/get/Responses.md b/samples/client/petstore/java/docs/paths/foo/get/Responses.md deleted file mode 100644 index 6a7b519f22b..00000000000 --- a/samples/client/petstore/java/docs/paths/foo/get/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCodedefaultResponse](#endpointcodedefaultresponse)
the response for default | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCodedefaultResponse](#endpointcodedefaultresponse) - -a sealed interface that stores endpoint responses - -## EndpointCodedefaultResponse -public record EndpointCodedefaultResponse( - HttpResponse response, - [CodedefaultResponse.SealedResponseBody](../../../paths/foo/get/responses/CodedefaultResponse.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/foo/get/responses/CodedefaultResponse.md b/samples/client/petstore/java/docs/paths/foo/get/responses/CodedefaultResponse.md deleted file mode 100644 index 3b6ba5ec6ac..00000000000 --- a/samples/client/petstore/java/docs/paths/foo/get/responses/CodedefaultResponse.md +++ /dev/null @@ -1,87 +0,0 @@ -# CodedefaultResponse - -public class CodedefaultResponse - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [CodedefaultResponse.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [CodedefaultResponse.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [CodedefaultResponse.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [CodedefaultResponse.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [CodedefaultResponse.CodedefaultResponse1](#codedefaultresponse1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/foo/get/responses/codedefaultresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/foo/get/responses/codedefaultresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.[ApplicationjsonSchema1Boxed](../../../../paths/foo/get/responses/codedefaultresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.[ApplicationjsonSchema1Boxed](../../../../paths/foo/get/responses/codedefaultresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1boxed) | body()
returns the body passed in in the constructor | - -## CodedefaultResponse1 -public static class CodedefaultResponse1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| CodedefaultResponse1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/foo/get/responses/FooGetCodedefaultResponse.md b/samples/client/petstore/java/docs/paths/foo/get/responses/FooGetCodedefaultResponse.md new file mode 100644 index 00000000000..5a45e3ba6d9 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/foo/get/responses/FooGetCodedefaultResponse.md @@ -0,0 +1,87 @@ +# FooGetCodedefaultResponse + +public class FooGetCodedefaultResponse + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [FooGetCodedefaultResponse.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [FooGetCodedefaultResponse.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [FooGetCodedefaultResponse.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [FooGetCodedefaultResponse.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [FooGetCodedefaultResponse.FooGetCodedefaultResponse1](#foogetcodedefaultresponse1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/foo/get/responses/codedefaultresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/foo/get/responses/codedefaultresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.[ApplicationjsonSchema1Boxed](../../../../paths/foo/get/responses/codedefaultresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.[ApplicationjsonSchema1Boxed](../../../../paths/foo/get/responses/codedefaultresponse/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1boxed) | body()
returns the body passed in in the constructor | + +## FooGetCodedefaultResponse1 +public static class FooGetCodedefaultResponse1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| FooGetCodedefaultResponse1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/pet/PetPost.md b/samples/client/petstore/java/docs/paths/pet/PetPost.md new file mode 100644 index 00000000000..89a5b611dd6 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/pet/PetPost.md @@ -0,0 +1,235 @@ +# PetPost + +public class PetPost + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Post](#post)
The class that has a post method to call the endpoint | +| interface | [AddPetOperation](#addpetoperation)
The interface that has a addPet method to call the endpoint | +| static class | [PostRequest](#postrequest)
The final request inputs class | +| static class | [PostNullableRequest](#postnullablerequest)
The initial request inputs class | +| static class | [Post0RequestBuilder](#post0requestbuilder)
A builder for the request input class | +| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | + +## Post +public static class Post extends ApiClient.ApiClient1 implements PostOperation
+ +a class that allows one to call the endpoint using a method named post + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.pet.post.PetPostSecurityInfo; +import org.openapijsonschematools.client.paths.pet.post.PetPostRequestBody; +import org.openapijsonschematools.client.components.schemas.Pet; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.ApiKey; +import org.openapijsonschematools.client.components.securityschemes.HttpSignatureTest; +import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; +import org.openapijsonschematools.client.paths.pet.post.responses.PetPostCode200Response; +import org.openapijsonschematools.client.paths.pet.post.responses.PetPostCode405Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.pet.PetPost; +import org.openapijsonschematools.client.paths.pet.post.PetPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new ApiKey("someApiKey"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .petPostSecurityRequirementObject0SecurityIndex(PetPostSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +PetPost.Post apiClient = new PetPost.Post(apiConfiguration, schemaConfiguration); + + +Pet1BoxedMap requestBodyPayload = + Pet.Pet1.validateAndBox( + new Pet.PetMapBuilder() + .name("a") + + .photoUrls( + Arrays.asList( + "a" + ) + ) + .id(1L) + + .category( + MapUtils.makeMap( + new AbstractMap.SimpleEntry( + "name", + "a" + ), + new AbstractMap.SimpleEntry( + "id", + 1L + ) + ) + ) + .tags( + Arrays.asList( + MapUtils.makeMap( + new AbstractMap.SimpleEntry( + "name", + "a" + ) + ) + ) + ) + .status("available") + + .build(), + schemaConfiguration +); +PetPostRequestBody.SealedRequestBody requestBody = new PetPostRequestBody.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new PetPost.PostRequestBuilder() + .requestBody(requestBody) + .build(); + +PetPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (PetPostCode405Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +PetPostResponses.EndpointPetPostCode200Response castResponse = (PetPostResponses.EndpointPetPostCode200Response) response; +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetPostResponses.EndpointResponse](../../paths/pet/post/PetPostResponses.md#endpointresponse) | post([PostRequest](#postrequest) request) | + +## AddPetOperation +public interface AddPetOperation
+ +an interface that allows one to call the endpoint using a method named addPet by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetPostResponses.EndpointResponse](../../paths/pet/post/PetPostResponses.md#endpointresponse) | addPet([PostRequest](#postrequest) request) | + +## PostRequest +public static class PostRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [PetPostRequestBody.SealedRequestBody](../../paths/pet/post/PetPostRequestBody.md#sealedrequestbody) | requestBody | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| [PetPostSecurityInfo.@Nullable SecurityIndex](../../paths/pet/post/PetPostSecurityInfo.md#securityindex) | securityIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PostNullableRequest +public static class PostNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [PetPostRequestBody.@Nullable SealedRequestBody](../../paths/pet/post/PetPostRequestBody.md#sealedrequestbody) | requestBody | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| [PetPostSecurityInfo.@Nullable SecurityIndex](../../paths/pet/post/PetPostSecurityInfo.md#securityindex) | securityIndex | +| @Nullable Duration | timeout | + +## Post0RequestBuilder +public static class Post0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post0RequestBuilder(Post0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | +| [Post0RequestBuilder](#post0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Post0RequestBuilder](#post0requestbuilder) | securityIndex([PetPostSecurityInfo.SecurityIndex](../../paths/pet/post/PetPostSecurityInfo.md#securityindex) securityIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Post0RequestBuilder](#post0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## PostRequestBuilder +public static class PostRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PostRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Post0RequestBuilder](#post0requestbuilder) | requestBody([PetPostRequestBody.SealedRequestBody](../../paths/pet/post/PetPostRequestBody.md#sealedrequestbody) requestBody)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/pet/PetPut.md b/samples/client/petstore/java/docs/paths/pet/PetPut.md new file mode 100644 index 00000000000..5b7c67d21fd --- /dev/null +++ b/samples/client/petstore/java/docs/paths/pet/PetPut.md @@ -0,0 +1,231 @@ +# PetPut + +public class PetPut + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Put](#put)
The class that has a put method to call the endpoint | +| interface | [UpdatePetOperation](#updatepetoperation)
The interface that has a updatePet method to call the endpoint | +| static class | [PutRequest](#putrequest)
The final request inputs class | +| static class | [PutNullableRequest](#putnullablerequest)
The initial request inputs class | +| static class | [Put0RequestBuilder](#put0requestbuilder)
A builder for the request input class | +| static class | [PutRequestBuilder](#putrequestbuilder)
A builder for the request input class | + +## Put +public static class Put extends ApiClient.ApiClient1 implements PutOperation
+ +a class that allows one to call the endpoint using a method named put + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.pet.put.PetPutSecurityInfo; +import org.openapijsonschematools.client.paths.pet.put.PetPutRequestBody; +import org.openapijsonschematools.client.components.schemas.Pet; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.HttpSignatureTest; +import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; +import org.openapijsonschematools.client.paths.pet.put.responses.PetPutCode400Response; +import org.openapijsonschematools.client.paths.pet.put.responses.PetPutCode404Response; +import org.openapijsonschematools.client.paths.pet.put.responses.PetPutCode405Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.pet.PetPut; +import org.openapijsonschematools.client.paths.pet.put.PetPutResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .petPutSecurityRequirementObject0SecurityIndex(PetPutSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +PetPut.Put apiClient = new PetPut.Put(apiConfiguration, schemaConfiguration); + + +Pet1BoxedMap requestBodyPayload = + Pet.Pet1.validateAndBox( + new Pet.PetMapBuilder() + .name("a") + + .photoUrls( + Arrays.asList( + "a" + ) + ) + .id(1L) + + .category( + MapUtils.makeMap( + new AbstractMap.SimpleEntry( + "name", + "a" + ), + new AbstractMap.SimpleEntry( + "id", + 1L + ) + ) + ) + .tags( + Arrays.asList( + MapUtils.makeMap( + new AbstractMap.SimpleEntry( + "name", + "a" + ) + ) + ) + ) + .status("available") + + .build(), + schemaConfiguration +); +PetPutRequestBody.SealedRequestBody requestBody = new PetPutRequestBody.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new PetPut.PutRequestBuilder() + .requestBody(requestBody) + .build(); + +Void response; +try { + response = apiClient.put(request); +} catch (PetPutCode400Response.ResponseApiException | PetPutCode404Response.ResponseApiException | PetPutCode405Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Put(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | put([PutRequest](#putrequest) request) | + +## UpdatePetOperation +public interface UpdatePetOperation
+ +an interface that allows one to call the endpoint using a method named updatePet by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | updatePet([PutRequest](#putrequest) request) | + +## PutRequest +public static class PutRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [PetPutRequestBody.SealedRequestBody](../../paths/pet/put/PetPutRequestBody.md#sealedrequestbody) | requestBody | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| [PetPutSecurityInfo.@Nullable SecurityIndex](../../paths/pet/put/PetPutSecurityInfo.md#securityindex) | securityIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PutNullableRequest +public static class PutNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [PetPutRequestBody.@Nullable SealedRequestBody](../../paths/pet/put/PetPutRequestBody.md#sealedrequestbody) | requestBody | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| [PetPutSecurityInfo.@Nullable SecurityIndex](../../paths/pet/put/PetPutSecurityInfo.md#securityindex) | securityIndex | +| @Nullable Duration | timeout | + +## Put0RequestBuilder +public static class Put0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Put0RequestBuilder(Put0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PutRequest](#putrequest) | build()
Returns the request input used to call an endpoint method | +| [Put0RequestBuilder](#put0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Put0RequestBuilder](#put0requestbuilder) | securityIndex([PetPutSecurityInfo.SecurityIndex](../../paths/pet/put/PetPutSecurityInfo.md#securityindex) securityIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Put0RequestBuilder](#put0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## PutRequestBuilder +public static class PutRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PutRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Put0RequestBuilder](#put0requestbuilder) | requestBody([PetPutRequestBody.SealedRequestBody](../../paths/pet/put/PetPutRequestBody.md#sealedrequestbody) requestBody)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/pet/Post.md b/samples/client/petstore/java/docs/paths/pet/Post.md deleted file mode 100644 index 63af19b69b0..00000000000 --- a/samples/client/petstore/java/docs/paths/pet/Post.md +++ /dev/null @@ -1,224 +0,0 @@ -# Post - -public class Post - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Post1](#post1)
The class that has a post method to call the endpoint | -| static class | [PostRequest](#postrequest)
The final request inputs class | -| static class | [PostNullableRequest](#postnullablerequest)
The initial request inputs class | -| static class | [Post0RequestBuilder](#post0requestbuilder)
A builder for the request input class | -| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | - -## Post1 -public static class Post1 extends ApiClient.ApiClient1 implements PostOperation
- -a class that allows one to call the endpoint using a method named post - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.pet.post.PetPostSecurityInfo; -import org.openapijsonschematools.client.paths.pet.post.RequestBody; -import org.openapijsonschematools.client.components.schemas.Pet; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.securityschemes.SecurityScheme; -import org.openapijsonschematools.client.components.securityschemes.ApiKey; -import org.openapijsonschematools.client.components.securityschemes.HttpSignatureTest; -import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; -import org.openapijsonschematools.client.paths.pet.post.responses.Code200Response; -import org.openapijsonschematools.client.paths.pet.post.responses.Code405Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.pet.Post; -import org.openapijsonschematools.client.paths.pet.post.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -List securitySchemes = new ArrayList(); -securitySchemes.add( - new ApiKey("someApiKey"); -); -ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() - .petPostSecurityRequirementObject0SecurityIndex(PetPostSecurityRequirementObject0.SecurityIndex.SECURITY_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - securitySchemes, - securityIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Post.Post1 apiClient = new Post.Post1(apiConfiguration, schemaConfiguration); - - -Pet1BoxedMap requestBodyPayload = - Pet.Pet1.validateAndBox( - new Pet.PetMapBuilder() - .name("a") - - .photoUrls( - Arrays.asList( - "a" - ) - ) - .id(1L) - - .category( - MapUtils.makeMap( - new AbstractMap.SimpleEntry( - "name", - "a" - ), - new AbstractMap.SimpleEntry( - "id", - 1L - ) - ) - ) - .tags( - Arrays.asList( - MapUtils.makeMap( - new AbstractMap.SimpleEntry( - "name", - "a" - ) - ) - ) - ) - .status("available") - - .build(), - schemaConfiguration -); -RequestBody.SealedRequestBody requestBody = new RequestBody.ApplicationjsonRequestBody(requestBodyPayload); - -var request = new PostRequestBuilder() - .requestBody(requestBody) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.post(request); -} catch (Code405Response.ResponseApiException e) { - // server returned an error response defined in the openapi document - throw e; -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/pet/post/Responses.md#endpointresponse) | post([PostRequest](#postrequest) request) | - -## PostRequest -public static class PostRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.SealedRequestBody](../../paths/pet/post/RequestBody.md#sealedrequestbody) | requestBody | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| [PetPostSecurityInfo.@Nullable SecurityIndex](../../paths/pet/post/PetPostSecurityInfo.md#securityindex) | securityIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PostNullableRequest -public static class PostNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/pet/post/RequestBody.md#sealedrequestbody) | requestBody | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| [PetPostSecurityInfo.@Nullable SecurityIndex](../../paths/pet/post/PetPostSecurityInfo.md#securityindex) | securityIndex | -| @Nullable Duration | timeout | - -## Post0RequestBuilder -public static class Post0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post0RequestBuilder(Post0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | -| [Post0RequestBuilder](#post0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Post0RequestBuilder](#post0requestbuilder) | securityIndex([PetPostSecurityInfo.SecurityIndex](../../paths/pet/post/PetPostSecurityInfo.md#securityindex) securityIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Post0RequestBuilder](#post0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## PostRequestBuilder -public static class PostRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PostRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Post0RequestBuilder](#post0requestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/pet/post/RequestBody.md#sealedrequestbody) requestBody)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/pet/Put.md b/samples/client/petstore/java/docs/paths/pet/Put.md deleted file mode 100644 index 7591339e641..00000000000 --- a/samples/client/petstore/java/docs/paths/pet/Put.md +++ /dev/null @@ -1,220 +0,0 @@ -# Put - -public class Put - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Put1](#put1)
The class that has a put method to call the endpoint | -| static class | [PutRequest](#putrequest)
The final request inputs class | -| static class | [PutNullableRequest](#putnullablerequest)
The initial request inputs class | -| static class | [Put0RequestBuilder](#put0requestbuilder)
A builder for the request input class | -| static class | [PutRequestBuilder](#putrequestbuilder)
A builder for the request input class | - -## Put1 -public static class Put1 extends ApiClient.ApiClient1 implements PutOperation
- -a class that allows one to call the endpoint using a method named put - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.pet.put.PetPutSecurityInfo; -import org.openapijsonschematools.client.paths.pet.put.RequestBody; -import org.openapijsonschematools.client.components.schemas.Pet; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.securityschemes.SecurityScheme; -import org.openapijsonschematools.client.components.securityschemes.HttpSignatureTest; -import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; -import org.openapijsonschematools.client.paths.pet.put.responses.Code400Response; -import org.openapijsonschematools.client.paths.pet.put.responses.Code404Response; -import org.openapijsonschematools.client.paths.pet.put.responses.Code405Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.pet.Put; -import org.openapijsonschematools.client.paths.pet.put.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -List securitySchemes = new ArrayList(); -ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() - .petPutSecurityRequirementObject0SecurityIndex(PetPutSecurityRequirementObject0.SecurityIndex.SECURITY_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - securitySchemes, - securityIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Put.Put1 apiClient = new Put.Put1(apiConfiguration, schemaConfiguration); - - -Pet1BoxedMap requestBodyPayload = - Pet.Pet1.validateAndBox( - new Pet.PetMapBuilder() - .name("a") - - .photoUrls( - Arrays.asList( - "a" - ) - ) - .id(1L) - - .category( - MapUtils.makeMap( - new AbstractMap.SimpleEntry( - "name", - "a" - ), - new AbstractMap.SimpleEntry( - "id", - 1L - ) - ) - ) - .tags( - Arrays.asList( - MapUtils.makeMap( - new AbstractMap.SimpleEntry( - "name", - "a" - ) - ) - ) - ) - .status("available") - - .build(), - schemaConfiguration -); -RequestBody.SealedRequestBody requestBody = new RequestBody.ApplicationjsonRequestBody(requestBodyPayload); - -var request = new PutRequestBuilder() - .requestBody(requestBody) - .build(); - -Void response; -try { - response = apiClient.put(request); -} catch (Code400Response.ResponseApiException | Code404Response.ResponseApiException | Code405Response.ResponseApiException e) { - // server returned an error response defined in the openapi document - throw e; -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Put1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | put([PutRequest](#putrequest) request) | - -## PutRequest -public static class PutRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.SealedRequestBody](../../paths/pet/put/RequestBody.md#sealedrequestbody) | requestBody | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| [PetPutSecurityInfo.@Nullable SecurityIndex](../../paths/pet/put/PetPutSecurityInfo.md#securityindex) | securityIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PutNullableRequest -public static class PutNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/pet/put/RequestBody.md#sealedrequestbody) | requestBody | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| [PetPutSecurityInfo.@Nullable SecurityIndex](../../paths/pet/put/PetPutSecurityInfo.md#securityindex) | securityIndex | -| @Nullable Duration | timeout | - -## Put0RequestBuilder -public static class Put0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Put0RequestBuilder(Put0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PutRequest](#putrequest) | build()
Returns the request input used to call an endpoint method | -| [Put0RequestBuilder](#put0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Put0RequestBuilder](#put0requestbuilder) | securityIndex([PetPutSecurityInfo.SecurityIndex](../../paths/pet/put/PetPutSecurityInfo.md#securityindex) securityIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Put0RequestBuilder](#put0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## PutRequestBuilder -public static class PutRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PutRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Put0RequestBuilder](#put0requestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/pet/put/RequestBody.md#sealedrequestbody) requestBody)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/pet/post/PetPostRequestBody.md b/samples/client/petstore/java/docs/paths/pet/post/PetPostRequestBody.md new file mode 100644 index 00000000000..bd9f8d276f1 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/pet/post/PetPostRequestBody.md @@ -0,0 +1,17 @@ +# PetPostRequestBody + +public class PetPostRequestBody extends [Pet](../../../components/requestbodies/Pet.md) + +A class (extended from the $ref class) that contains necessary nested request body classes +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [PetPostRequestBody.PetPostRequestBody1](#petpostrequestbody1)
class that serializes request bodies | + +## PetPostRequestBody1 +public static class PetPostRequestBody1 extends [Pet1](../../../components/requestbodies/Pet.md#pet1)
+ +a class that serializes SealedRequestBody request bodies, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/pet/post/PetPostResponses.md b/samples/client/petstore/java/docs/paths/pet/post/PetPostResponses.md new file mode 100644 index 00000000000..d44b66c86e5 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/pet/post/PetPostResponses.md @@ -0,0 +1,29 @@ +# PetPostResponses + +public class PetPostResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointPetPostCode200Response](#endpointpetpostcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointPetPostCode200Response](#endpointpetpostcode200response) + +a sealed interface that stores endpoint responses + +## EndpointPetPostCode200Response +public record EndpointPetPostCode200Response( + HttpResponse response, + Void body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/pet/post/RequestBody.md b/samples/client/petstore/java/docs/paths/pet/post/RequestBody.md deleted file mode 100644 index ee81d9d563b..00000000000 --- a/samples/client/petstore/java/docs/paths/pet/post/RequestBody.md +++ /dev/null @@ -1,17 +0,0 @@ -# RequestBody - -public class RequestBody extends [Pet](../../../components/requestbodies/Pet.md) - -A class (extended from the $ref class) that contains necessary nested request body classes -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | - -## RequestBody1 -public static class RequestBody1 extends [Pet1](../../../components/requestbodies/Pet.md#pet1)
- -a class that serializes SealedRequestBody request bodies, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/pet/post/Responses.md b/samples/client/petstore/java/docs/paths/pet/post/Responses.md deleted file mode 100644 index d4bf4fdb8f5..00000000000 --- a/samples/client/petstore/java/docs/paths/pet/post/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/pet/post/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/pet/post/responses/Code200Response.md deleted file mode 100644 index e89c75b2e12..00000000000 --- a/samples/client/petstore/java/docs/paths/pet/post/responses/Code200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# Code200Response - -public class Code200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) - -A class (extended from the $ref class) that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## Code200Response1 -public static class Code200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
- -a class that deserializes responses, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/pet/post/responses/Code405Response.md b/samples/client/petstore/java/docs/paths/pet/post/responses/Code405Response.md deleted file mode 100644 index 0c371e4143d..00000000000 --- a/samples/client/petstore/java/docs/paths/pet/post/responses/Code405Response.md +++ /dev/null @@ -1,32 +0,0 @@ -# Code405Response - -public class Code405Response - -A class that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code405Response.Code405Response1](#code405response1)
class that deserializes responses | - -## Code405Response1 -public static class Code405Response1
-extends ResponseDeserializer - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code405Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = MapUtils.makeMap(
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/pet/post/responses/PetPostCode200Response.md b/samples/client/petstore/java/docs/paths/pet/post/responses/PetPostCode200Response.md new file mode 100644 index 00000000000..3c59da4cc88 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/pet/post/responses/PetPostCode200Response.md @@ -0,0 +1,17 @@ +# PetPostCode200Response + +public class PetPostCode200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) + +A class (extended from the $ref class) that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [PetPostCode200Response.PetPostCode200Response1](#petpostcode200response1)
class that deserializes responses | + +## PetPostCode200Response1 +public static class PetPostCode200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
+ +a class that deserializes responses, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/pet/post/responses/PetPostCode405Response.md b/samples/client/petstore/java/docs/paths/pet/post/responses/PetPostCode405Response.md new file mode 100644 index 00000000000..6125c5e2063 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/pet/post/responses/PetPostCode405Response.md @@ -0,0 +1,32 @@ +# PetPostCode405Response + +public class PetPostCode405Response + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [PetPostCode405Response.PetPostCode405Response1](#petpostcode405response1)
class that deserializes responses | + +## PetPostCode405Response1 +public static class PetPostCode405Response1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetPostCode405Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/pet/put/PetPutRequestBody.md b/samples/client/petstore/java/docs/paths/pet/put/PetPutRequestBody.md new file mode 100644 index 00000000000..e732123f8df --- /dev/null +++ b/samples/client/petstore/java/docs/paths/pet/put/PetPutRequestBody.md @@ -0,0 +1,17 @@ +# PetPutRequestBody + +public class PetPutRequestBody extends [Pet](../../../components/requestbodies/Pet.md) + +A class (extended from the $ref class) that contains necessary nested request body classes +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [PetPutRequestBody.PetPutRequestBody1](#petputrequestbody1)
class that serializes request bodies | + +## PetPutRequestBody1 +public static class PetPutRequestBody1 extends [Pet1](../../../components/requestbodies/Pet.md#pet1)
+ +a class that serializes SealedRequestBody request bodies, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/pet/put/PetPutResponses.md b/samples/client/petstore/java/docs/paths/pet/put/PetPutResponses.md new file mode 100644 index 00000000000..fb9a8a6388a --- /dev/null +++ b/samples/client/petstore/java/docs/paths/pet/put/PetPutResponses.md @@ -0,0 +1,10 @@ +# PetPutResponses + +public class PetPutResponses + +A class that contains necessary responses classes + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | + diff --git a/samples/client/petstore/java/docs/paths/pet/put/RequestBody.md b/samples/client/petstore/java/docs/paths/pet/put/RequestBody.md deleted file mode 100644 index ee81d9d563b..00000000000 --- a/samples/client/petstore/java/docs/paths/pet/put/RequestBody.md +++ /dev/null @@ -1,17 +0,0 @@ -# RequestBody - -public class RequestBody extends [Pet](../../../components/requestbodies/Pet.md) - -A class (extended from the $ref class) that contains necessary nested request body classes -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | - -## RequestBody1 -public static class RequestBody1 extends [Pet1](../../../components/requestbodies/Pet.md#pet1)
- -a class that serializes SealedRequestBody request bodies, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/pet/put/Responses.md b/samples/client/petstore/java/docs/paths/pet/put/Responses.md deleted file mode 100644 index 5841efd5c37..00000000000 --- a/samples/client/petstore/java/docs/paths/pet/put/Responses.md +++ /dev/null @@ -1,10 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | - diff --git a/samples/client/petstore/java/docs/paths/pet/put/responses/Code400Response.md b/samples/client/petstore/java/docs/paths/pet/put/responses/Code400Response.md deleted file mode 100644 index 6f3af2df6d2..00000000000 --- a/samples/client/petstore/java/docs/paths/pet/put/responses/Code400Response.md +++ /dev/null @@ -1,32 +0,0 @@ -# Code400Response - -public class Code400Response - -A class that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code400Response.Code400Response1](#code400response1)
class that deserializes responses | - -## Code400Response1 -public static class Code400Response1
-extends ResponseDeserializer - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code400Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = MapUtils.makeMap(
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/pet/put/responses/Code404Response.md b/samples/client/petstore/java/docs/paths/pet/put/responses/Code404Response.md deleted file mode 100644 index ee00cd369a7..00000000000 --- a/samples/client/petstore/java/docs/paths/pet/put/responses/Code404Response.md +++ /dev/null @@ -1,32 +0,0 @@ -# Code404Response - -public class Code404Response - -A class that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code404Response.Code404Response1](#code404response1)
class that deserializes responses | - -## Code404Response1 -public static class Code404Response1
-extends ResponseDeserializer - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code404Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = MapUtils.makeMap(
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/pet/put/responses/Code405Response.md b/samples/client/petstore/java/docs/paths/pet/put/responses/Code405Response.md deleted file mode 100644 index 0c371e4143d..00000000000 --- a/samples/client/petstore/java/docs/paths/pet/put/responses/Code405Response.md +++ /dev/null @@ -1,32 +0,0 @@ -# Code405Response - -public class Code405Response - -A class that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code405Response.Code405Response1](#code405response1)
class that deserializes responses | - -## Code405Response1 -public static class Code405Response1
-extends ResponseDeserializer - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code405Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = MapUtils.makeMap(
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/pet/put/responses/PetPutCode400Response.md b/samples/client/petstore/java/docs/paths/pet/put/responses/PetPutCode400Response.md new file mode 100644 index 00000000000..d44abff6808 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/pet/put/responses/PetPutCode400Response.md @@ -0,0 +1,32 @@ +# PetPutCode400Response + +public class PetPutCode400Response + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [PetPutCode400Response.PetPutCode400Response1](#petputcode400response1)
class that deserializes responses | + +## PetPutCode400Response1 +public static class PetPutCode400Response1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetPutCode400Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/pet/put/responses/PetPutCode404Response.md b/samples/client/petstore/java/docs/paths/pet/put/responses/PetPutCode404Response.md new file mode 100644 index 00000000000..9643229862a --- /dev/null +++ b/samples/client/petstore/java/docs/paths/pet/put/responses/PetPutCode404Response.md @@ -0,0 +1,32 @@ +# PetPutCode404Response + +public class PetPutCode404Response + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [PetPutCode404Response.PetPutCode404Response1](#petputcode404response1)
class that deserializes responses | + +## PetPutCode404Response1 +public static class PetPutCode404Response1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetPutCode404Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/pet/put/responses/PetPutCode405Response.md b/samples/client/petstore/java/docs/paths/pet/put/responses/PetPutCode405Response.md new file mode 100644 index 00000000000..51dbe825682 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/pet/put/responses/PetPutCode405Response.md @@ -0,0 +1,32 @@ +# PetPutCode405Response + +public class PetPutCode405Response + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [PetPutCode405Response.PetPutCode405Response1](#petputcode405response1)
class that deserializes responses | + +## PetPutCode405Response1 +public static class PetPutCode405Response1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetPutCode405Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/petfindbystatus/Get.md b/samples/client/petstore/java/docs/paths/petfindbystatus/Get.md deleted file mode 100644 index cc3571ee859..00000000000 --- a/samples/client/petstore/java/docs/paths/petfindbystatus/Get.md +++ /dev/null @@ -1,195 +0,0 @@ -# Get - -public class Get - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Get1](#get1)
The class that has a get method to call the endpoint | -| static class | [GetRequest](#getrequest)
The final request inputs class | -| static class | [GetNullableRequest](#getnullablerequest)
The initial request inputs class | -| static class | [Get0RequestBuilder](#get0requestbuilder)
A builder for the request input class | -| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | - -## Get1 -public static class Get1 extends ApiClient.ApiClient1 implements GetOperation
- -a class that allows one to call the endpoint using a method named get - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.petfindbystatus.PetfindbystatusServerInfo; -import org.openapijsonschematools.client.paths.petfindbystatus.get.PetfindbystatusGetSecurityInfo; -import org.openapijsonschematools.client.paths.petfindbystatus.get.QueryParameters; -import org.openapijsonschematools.client.paths.petfindbystatus.servers.PetfindbystatusServer0; -import org.openapijsonschematools.client.paths.petfindbystatus.servers.PetfindbystatusServer1; -import org.openapijsonschematools.client.securityschemes.SecurityScheme; -import org.openapijsonschematools.client.components.securityschemes.ApiKey; -import org.openapijsonschematools.client.components.securityschemes.HttpSignatureTest; -import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; -import org.openapijsonschematools.client.paths.petfindbystatus.get.responses.Code200Response; -import org.openapijsonschematools.client.paths.petfindbystatus.get.responses.Code400Response; -import org.openapijsonschematools.client.paths.petfindbystatus.PetfindbystatusServerInfo; -import org.openapijsonschematools.client.paths.petfindbystatus.Get; -import org.openapijsonschematools.client.paths.petfindbystatus.get.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .petfindbystatusServerInfo( - new PetfindbystatusServerInfo.PetfindbystatusServerInfoBuilder() - .petfindbystatusServer0(new PetfindbystatusServer0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .petfindbystatusServerInfoServerIndex(PetfindbystatusServerInfo.ServerIndex.SERVER_0) - .build(); -List securitySchemes = new ArrayList(); -securitySchemes.add( - new ApiKey("someApiKey"); -); -ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() - .petfindbystatusGetSecurityRequirementObject0SecurityIndex(PetfindbystatusGetSecurityRequirementObject0.SecurityIndex.SECURITY_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - securitySchemes, - securityIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Get.Get1 apiClient = new Get.Get1(apiConfiguration, schemaConfiguration); - - -// Map validation -QueryParameters.QueryParametersMap queryParameters = - QueryParameters.QueryParameters1.validate( - new QueryParameters.QueryParametersMapBuilder() - .status( - Arrays.asList( - "available" - ) - ) - .build(), - schemaConfiguration -); - -var request = new GetRequestBuilder() - .queryParameters(queryParameters) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.get(request); -} catch (Code400Response.ResponseApiException e) { - // server returned an error response defined in the openapi document - throw e; -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -} -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/petfindbystatus/get/Responses.md#endpointresponse) | get([GetRequest](#getrequest) request) | - -## GetRequest -public static class GetRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [QueryParameters.QueryParametersMap](../../paths/petfindbystatus/get/QueryParameters.md#queryparametersmap) | queryParameters | -| [PetfindbystatusServerInfo.@Nullable ServerIndex](../../paths/petfindbystatus/PetfindbystatusServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| [PetfindbystatusGetSecurityInfo.@Nullable SecurityIndex](../../paths/petfindbystatus/get/PetfindbystatusGetSecurityInfo.md#securityindex) | securityIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## GetNullableRequest -public static class GetNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [QueryParameters.@Nullable QueryParametersMap](../../paths/petfindbystatus/get/QueryParameters.md#queryparametersmap) | queryParameters | -| [PetfindbystatusServerInfo.@Nullable ServerIndex](../../paths/petfindbystatus/PetfindbystatusServerInfo.md#serverindex) | serverIndex | -| [PetfindbystatusGetSecurityInfo.@Nullable SecurityIndex](../../paths/petfindbystatus/get/PetfindbystatusGetSecurityInfo.md#securityindex) | securityIndex | -| @Nullable Duration | timeout | - -## Get0RequestBuilder -public static class Get0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get0RequestBuilder(Get0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | -| [Get0RequestBuilder](#get0requestbuilder) | serverIndex([PetfindbystatusServerInfo.ServerIndex](../../paths/petfindbystatus/PetfindbystatusServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Get0RequestBuilder](#get0requestbuilder) | securityIndex([PetfindbystatusGetSecurityInfo.SecurityIndex](../../paths/petfindbystatus/get/PetfindbystatusGetSecurityInfo.md#securityindex) securityIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Get0RequestBuilder](#get0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## GetRequestBuilder -public static class GetRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| GetRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Get0RequestBuilder](#get0requestbuilder) | queryParameters([QueryParametersQueryParametersMap](../../paths/petfindbystatus/get/QueryParameters.md#queryparametersmap) queryParameters)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/petfindbystatus/PetfindbystatusGet.md b/samples/client/petstore/java/docs/paths/petfindbystatus/PetfindbystatusGet.md new file mode 100644 index 00000000000..40c5bcc9fc0 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petfindbystatus/PetfindbystatusGet.md @@ -0,0 +1,206 @@ +# PetfindbystatusGet + +public class PetfindbystatusGet + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Get](#get)
The class that has a get method to call the endpoint | +| interface | [FindPetsByStatusOperation](#findpetsbystatusoperation)
The interface that has a findPetsByStatus method to call the endpoint | +| static class | [GetRequest](#getrequest)
The final request inputs class | +| static class | [GetNullableRequest](#getnullablerequest)
The initial request inputs class | +| static class | [Get0RequestBuilder](#get0requestbuilder)
A builder for the request input class | +| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | + +## Get +public static class Get extends ApiClient.ApiClient1 implements GetOperation
+ +a class that allows one to call the endpoint using a method named get + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.petfindbystatus.PetfindbystatusServerInfo; +import org.openapijsonschematools.client.paths.petfindbystatus.get.PetfindbystatusGetSecurityInfo; +import org.openapijsonschematools.client.paths.petfindbystatus.get.PetfindbystatusGetQueryParameters; +import org.openapijsonschematools.client.paths.petfindbystatus.servers.PetfindbystatusServer0; +import org.openapijsonschematools.client.paths.petfindbystatus.servers.PetfindbystatusServer1; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.ApiKey; +import org.openapijsonschematools.client.components.securityschemes.HttpSignatureTest; +import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; +import org.openapijsonschematools.client.paths.petfindbystatus.get.responses.PetfindbystatusGetCode200Response; +import org.openapijsonschematools.client.paths.petfindbystatus.get.responses.PetfindbystatusGetCode400Response; +import org.openapijsonschematools.client.paths.petfindbystatus.PetfindbystatusServerInfo; +import org.openapijsonschematools.client.paths.petfindbystatus.PetfindbystatusGet; +import org.openapijsonschematools.client.paths.petfindbystatus.get.PetfindbystatusGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .petfindbystatusServerInfo( + new PetfindbystatusServerInfo.PetfindbystatusServerInfoBuilder() + .petfindbystatusServer0(new PetfindbystatusServer0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .petfindbystatusServerInfoServerIndex(PetfindbystatusServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new ApiKey("someApiKey"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .petfindbystatusGetSecurityRequirementObject0SecurityIndex(PetfindbystatusGetSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +PetfindbystatusGet.Get apiClient = new PetfindbystatusGet.Get(apiConfiguration, schemaConfiguration); + + +// Map validation +PetfindbystatusGetQueryParameters.PetfindbystatusGetQueryParametersMap queryParameters = + PetfindbystatusGetQueryParameters.PetfindbystatusGetQueryParameters1.validate( + new PetfindbystatusGetQueryParameters.PetfindbystatusGetQueryParametersMapBuilder() + .status( + Arrays.asList( + "available" + ) + ) + .build(), + schemaConfiguration +); + +var request = new PetfindbystatusGet.GetRequestBuilder() + .queryParameters(queryParameters) + .build(); + +PetfindbystatusGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (PetfindbystatusGetCode400Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +PetfindbystatusGetResponses.EndpointPetfindbystatusGetCode200Response castResponse = (PetfindbystatusGetResponses.EndpointPetfindbystatusGetCode200Response) response; +} +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetfindbystatusGetResponses.EndpointResponse](../../paths/petfindbystatus/get/PetfindbystatusGetResponses.md#endpointresponse) | get([GetRequest](#getrequest) request) | + +## FindPetsByStatusOperation +public interface FindPetsByStatusOperation
+ +an interface that allows one to call the endpoint using a method named findPetsByStatus by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetfindbystatusGetResponses.EndpointResponse](../../paths/petfindbystatus/get/PetfindbystatusGetResponses.md#endpointresponse) | findPetsByStatus([GetRequest](#getrequest) request) | + +## GetRequest +public static class GetRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [PetfindbystatusGetQueryParameters.PetfindbystatusGetQueryParametersMap](../../paths/petfindbystatus/get/PetfindbystatusGetQueryParameters.md#petfindbystatusgetqueryparametersmap) | queryParameters | +| [PetfindbystatusServerInfo.@Nullable ServerIndex](../../paths/petfindbystatus/PetfindbystatusServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| [PetfindbystatusGetSecurityInfo.@Nullable SecurityIndex](../../paths/petfindbystatus/get/PetfindbystatusGetSecurityInfo.md#securityindex) | securityIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## GetNullableRequest +public static class GetNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [PetfindbystatusGetQueryParameters.@Nullable PetfindbystatusGetQueryParametersMap](../../paths/petfindbystatus/get/PetfindbystatusGetQueryParameters.md#petfindbystatusgetqueryparametersmap) | queryParameters | +| [PetfindbystatusServerInfo.@Nullable ServerIndex](../../paths/petfindbystatus/PetfindbystatusServerInfo.md#serverindex) | serverIndex | +| [PetfindbystatusGetSecurityInfo.@Nullable SecurityIndex](../../paths/petfindbystatus/get/PetfindbystatusGetSecurityInfo.md#securityindex) | securityIndex | +| @Nullable Duration | timeout | + +## Get0RequestBuilder +public static class Get0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get0RequestBuilder(Get0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | +| [Get0RequestBuilder](#get0requestbuilder) | serverIndex([PetfindbystatusServerInfo.ServerIndex](../../paths/petfindbystatus/PetfindbystatusServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Get0RequestBuilder](#get0requestbuilder) | securityIndex([PetfindbystatusGetSecurityInfo.SecurityIndex](../../paths/petfindbystatus/get/PetfindbystatusGetSecurityInfo.md#securityindex) securityIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Get0RequestBuilder](#get0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## GetRequestBuilder +public static class GetRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| GetRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Get0RequestBuilder](#get0requestbuilder) | queryParameters([PetfindbystatusGetQueryParametersPetfindbystatusGetQueryParametersMap](../../paths/petfindbystatus/get/PetfindbystatusGetQueryParameters.md#petfindbystatusgetqueryparametersmap) queryParameters)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/petfindbystatus/get/PetfindbystatusGetQueryParameters.md b/samples/client/petstore/java/docs/paths/petfindbystatus/get/PetfindbystatusGetQueryParameters.md new file mode 100644 index 00000000000..1162afec791 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petfindbystatus/get/PetfindbystatusGetQueryParameters.md @@ -0,0 +1,271 @@ +# PetfindbystatusGetQueryParameters +public class PetfindbystatusGetQueryParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [PetfindbystatusGetQueryParameters.PetfindbystatusGetQueryParameters1Boxed](#petfindbystatusgetqueryparameters1boxed)
sealed interface for validated payloads | +| record | [PetfindbystatusGetQueryParameters.PetfindbystatusGetQueryParameters1BoxedMap](#petfindbystatusgetqueryparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [PetfindbystatusGetQueryParameters.PetfindbystatusGetQueryParameters1](#petfindbystatusgetqueryparameters1)
schema class | +| static class | [PetfindbystatusGetQueryParameters.PetfindbystatusGetQueryParametersMapBuilder](#petfindbystatusgetqueryparametersmapbuilder)
builder for Map payloads | +| static class | [PetfindbystatusGetQueryParameters.PetfindbystatusGetQueryParametersMap](#petfindbystatusgetqueryparametersmap)
output class for Map payloads | +| sealed interface | [PetfindbystatusGetQueryParameters.PetfindbystatusGetadditionalPropertiesBoxed](#petfindbystatusgetadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [PetfindbystatusGetQueryParameters.PetfindbystatusGetadditionalPropertiesBoxedVoid](#petfindbystatusgetadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [PetfindbystatusGetQueryParameters.PetfindbystatusGetadditionalPropertiesBoxedBoolean](#petfindbystatusgetadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [PetfindbystatusGetQueryParameters.PetfindbystatusGetadditionalPropertiesBoxedNumber](#petfindbystatusgetadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [PetfindbystatusGetQueryParameters.PetfindbystatusGetadditionalPropertiesBoxedString](#petfindbystatusgetadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [PetfindbystatusGetQueryParameters.PetfindbystatusGetadditionalPropertiesBoxedList](#petfindbystatusgetadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [PetfindbystatusGetQueryParameters.PetfindbystatusGetadditionalPropertiesBoxedMap](#petfindbystatusgetadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [PetfindbystatusGetQueryParameters.PetfindbystatusGetadditionalProperties](#petfindbystatusgetadditionalproperties)
schema class | + +## PetfindbystatusGetQueryParameters1Boxed +public sealed interface PetfindbystatusGetQueryParameters1Boxed
+permits
+[PetfindbystatusGetQueryParameters1BoxedMap](#petfindbystatusgetqueryparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## PetfindbystatusGetQueryParameters1BoxedMap +public record PetfindbystatusGetQueryParameters1BoxedMap
+implements [PetfindbystatusGetQueryParameters1Boxed](#petfindbystatusgetqueryparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetfindbystatusGetQueryParameters1BoxedMap([PetfindbystatusGetQueryParametersMap](#petfindbystatusgetqueryparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetfindbystatusGetQueryParametersMap](#petfindbystatusgetqueryparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetfindbystatusGetQueryParameters1 +public static class PetfindbystatusGetQueryParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.petfindbystatus.get.PetfindbystatusGetQueryParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +PetfindbystatusGetQueryParameters.PetfindbystatusGetQueryParametersMap validatedPayload = + PetfindbystatusGetQueryParameters.PetfindbystatusGetQueryParameters1.validate( + new PetfindbystatusGetQueryParameters.PetfindbystatusGetQueryParametersMapBuilder() + .status( + Arrays.asList( + "available" + ) + ) + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("status", [Schema0.Schema01.class](../../../paths/petfindbystatus/get/parameters/parameter0/Schema0.md#schema01))
)
| +| Set | required = Set.of(
    "status"
)
| +| Class | additionalProperties = [PetfindbystatusGetadditionalProperties.class](#petfindbystatusgetadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetfindbystatusGetQueryParametersMap](#petfindbystatusgetqueryparametersmap) | validate([Map<?, ?>](#petfindbystatusgetqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [PetfindbystatusGetQueryParameters1BoxedMap](#petfindbystatusgetqueryparameters1boxedmap) | validateAndBox([Map<?, ?>](#petfindbystatusgetqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [PetfindbystatusGetQueryParameters1Boxed](#petfindbystatusgetqueryparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## PetfindbystatusGetQueryParametersMap0Builder +public class PetfindbystatusGetQueryParametersMap0Builder
+builder for `Map>` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetfindbystatusGetQueryParametersMap0Builder(Map> instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map> | build()
Returns map input that should be used with Schema.validate | + +## PetfindbystatusGetQueryParametersMapBuilder +public class PetfindbystatusGetQueryParametersMapBuilder
+builder for `Map>` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetfindbystatusGetQueryParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetfindbystatusGetQueryParametersMap0Builder](#petfindbystatusgetqueryparametersmap0builder) | status(List value) | + +## PetfindbystatusGetQueryParametersMap +public static class PetfindbystatusGetQueryParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [PetfindbystatusGetQueryParametersMap](#petfindbystatusgetqueryparametersmap) | of([Map>](#petfindbystatusgetqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [Schema0.SchemaList0](../../../paths/petfindbystatus/get/parameters/parameter0/Schema0.md#schemalist0) | status()
| + +## PetfindbystatusGetadditionalPropertiesBoxed +public sealed interface PetfindbystatusGetadditionalPropertiesBoxed
+permits
+[PetfindbystatusGetadditionalPropertiesBoxedVoid](#petfindbystatusgetadditionalpropertiesboxedvoid), +[PetfindbystatusGetadditionalPropertiesBoxedBoolean](#petfindbystatusgetadditionalpropertiesboxedboolean), +[PetfindbystatusGetadditionalPropertiesBoxedNumber](#petfindbystatusgetadditionalpropertiesboxednumber), +[PetfindbystatusGetadditionalPropertiesBoxedString](#petfindbystatusgetadditionalpropertiesboxedstring), +[PetfindbystatusGetadditionalPropertiesBoxedList](#petfindbystatusgetadditionalpropertiesboxedlist), +[PetfindbystatusGetadditionalPropertiesBoxedMap](#petfindbystatusgetadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## PetfindbystatusGetadditionalPropertiesBoxedVoid +public record PetfindbystatusGetadditionalPropertiesBoxedVoid
+implements [PetfindbystatusGetadditionalPropertiesBoxed](#petfindbystatusgetadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetfindbystatusGetadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetfindbystatusGetadditionalPropertiesBoxedBoolean +public record PetfindbystatusGetadditionalPropertiesBoxedBoolean
+implements [PetfindbystatusGetadditionalPropertiesBoxed](#petfindbystatusgetadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetfindbystatusGetadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetfindbystatusGetadditionalPropertiesBoxedNumber +public record PetfindbystatusGetadditionalPropertiesBoxedNumber
+implements [PetfindbystatusGetadditionalPropertiesBoxed](#petfindbystatusgetadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetfindbystatusGetadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetfindbystatusGetadditionalPropertiesBoxedString +public record PetfindbystatusGetadditionalPropertiesBoxedString
+implements [PetfindbystatusGetadditionalPropertiesBoxed](#petfindbystatusgetadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetfindbystatusGetadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetfindbystatusGetadditionalPropertiesBoxedList +public record PetfindbystatusGetadditionalPropertiesBoxedList
+implements [PetfindbystatusGetadditionalPropertiesBoxed](#petfindbystatusgetadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetfindbystatusGetadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetfindbystatusGetadditionalPropertiesBoxedMap +public record PetfindbystatusGetadditionalPropertiesBoxedMap
+implements [PetfindbystatusGetadditionalPropertiesBoxed](#petfindbystatusgetadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetfindbystatusGetadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetfindbystatusGetadditionalProperties +public static class PetfindbystatusGetadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/petfindbystatus/get/PetfindbystatusGetResponses.md b/samples/client/petstore/java/docs/paths/petfindbystatus/get/PetfindbystatusGetResponses.md new file mode 100644 index 00000000000..79ad32a583c --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petfindbystatus/get/PetfindbystatusGetResponses.md @@ -0,0 +1,29 @@ +# PetfindbystatusGetResponses + +public class PetfindbystatusGetResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointPetfindbystatusGetCode200Response](#endpointpetfindbystatusgetcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointPetfindbystatusGetCode200Response](#endpointpetfindbystatusgetcode200response) + +a sealed interface that stores endpoint responses + +## EndpointPetfindbystatusGetCode200Response +public record EndpointPetfindbystatusGetCode200Response( + HttpResponse response, + [PetfindbystatusGetCode200Response.SealedResponseBody](../../../paths/petfindbystatus/get/responses/PetfindbystatusGetCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/petfindbystatus/get/PetfindbystatusGetServerInfo.md b/samples/client/petstore/java/docs/paths/petfindbystatus/get/PetfindbystatusGetServerInfo.md deleted file mode 100644 index 7ca3f5adb40..00000000000 --- a/samples/client/petstore/java/docs/paths/petfindbystatus/get/PetfindbystatusGetServerInfo.md +++ /dev/null @@ -1,62 +0,0 @@ -# PetfindbystatusServerInfo -PetfindbystatusServerInfo.java - -public class PetfindbystatusServerInfo - -A class that provides a server, and any needed server info classes -- a class that is a ServerProvider -- a builder for the ServerProvider -- an enum class that stores server index values - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [PetfindbystatusServerInfo.PetfindbystatusServerInfo1](#petfindbystatusserverinfo1)
class that stores a server index | -| static class | [PetfindbystatusServerInfo.PetfindbystatusServerInfoBuilder](#petfindbystatusserverinfobuilder)
class that stores a server index | -| enum | [PetfindbystatusServerInfo.ServerIndex](#serverindex)
class that stores a server index | - -## PetfindbystatusServerInfo1 -implements ServerProvider<[ServerIndex](#serverindex)>
- -A class that stores servers and allows one to be returned with a ServerIndex instance - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PetfindbystatusServerInfo1(@Nullable [PetfindbystatusServer0](../../../paths/petfindbystatus/servers/PetfindbystatusServer0.md) server0,@Nullable [PetfindbystatusServer1](../../../paths/petfindbystatus/servers/PetfindbystatusServer1.md) server1)
Creates an instance using passed in servers | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [PetfindbystatusServer0](../../../paths/petfindbystatus/servers/PetfindbystatusServer0.md) | server0 | -| [PetfindbystatusServer1](../../../paths/petfindbystatus/servers/PetfindbystatusServer1.md) | server1 | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Server | getServer([ServerIndex](#serverindex) serverIndex) | - -## PetfindbystatusServerInfoBuilder - -a builder for [PetfindbystatusServerInfo1](#petfindbystatusserverinfo1) - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PetfindbystatusServerInfoBuilder()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PetfindbystatusServerInfoBuilder](#petfindbystatusserverinfobuilder) | petfindbystatusServer0([PetfindbystatusServer0](../../../paths/petfindbystatus/servers/PetfindbystatusServer0.md) server0)
sets the server | -| [PetfindbystatusServerInfoBuilder](#petfindbystatusserverinfobuilder) | petfindbystatusServer1([PetfindbystatusServer1](../../../paths/petfindbystatus/servers/PetfindbystatusServer1.md) server1)
sets the server | -| [PetfindbystatusServerInfo1](#petfindbystatusserverinfo1) | build() | - -## ServerIndex -enum ServerIndex
- -### Enum Constant Summary -| Enum Constant And Description | -| ----------------------------- | -| SERVER_0
server 0 | -| SERVER_1
server 1 | diff --git a/samples/client/petstore/java/docs/paths/petfindbystatus/get/QueryParameters.md b/samples/client/petstore/java/docs/paths/petfindbystatus/get/QueryParameters.md deleted file mode 100644 index 30fac1aadbc..00000000000 --- a/samples/client/petstore/java/docs/paths/petfindbystatus/get/QueryParameters.md +++ /dev/null @@ -1,271 +0,0 @@ -# QueryParameters -public class QueryParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [QueryParameters.QueryParameters1Boxed](#queryparameters1boxed)
sealed interface for validated payloads | -| record | [QueryParameters.QueryParameters1BoxedMap](#queryparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [QueryParameters.QueryParameters1](#queryparameters1)
schema class | -| static class | [QueryParameters.QueryParametersMapBuilder](#queryparametersmapbuilder)
builder for Map payloads | -| static class | [QueryParameters.QueryParametersMap](#queryparametersmap)
output class for Map payloads | -| sealed interface | [QueryParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [QueryParameters.AdditionalProperties](#additionalproperties)
schema class | - -## QueryParameters1Boxed -public sealed interface QueryParameters1Boxed
-permits
-[QueryParameters1BoxedMap](#queryparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## QueryParameters1BoxedMap -public record QueryParameters1BoxedMap
-implements [QueryParameters1Boxed](#queryparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParameters1BoxedMap([QueryParametersMap](#queryparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap](#queryparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## QueryParameters1 -public static class QueryParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.petfindbystatus.get.QueryParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -QueryParameters.QueryParametersMap validatedPayload = - QueryParameters.QueryParameters1.validate( - new QueryParameters.QueryParametersMapBuilder() - .status( - Arrays.asList( - "available" - ) - ) - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("status", [Schema0.Schema01.class](../../../paths/petfindbystatus/get/parameters/parameter0/Schema0.md#schema01))
)
| -| Set | required = Set.of(
    "status"
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap](#queryparametersmap) | validate([Map<?, ?>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [QueryParameters1BoxedMap](#queryparameters1boxedmap) | validateAndBox([Map<?, ?>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [QueryParameters1Boxed](#queryparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## QueryParametersMap0Builder -public class QueryParametersMap0Builder
-builder for `Map>` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap0Builder(Map> instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map> | build()
Returns map input that should be used with Schema.validate | - -## QueryParametersMapBuilder -public class QueryParametersMapBuilder
-builder for `Map>` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap0Builder](#queryparametersmap0builder) | status(List value) | - -## QueryParametersMap -public static class QueryParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [QueryParametersMap](#queryparametersmap) | of([Map>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [Schema0.SchemaList0](../../../paths/petfindbystatus/get/parameters/parameter0/Schema0.md#schemalist0) | status()
| - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/petfindbystatus/get/Responses.md b/samples/client/petstore/java/docs/paths/petfindbystatus/get/Responses.md deleted file mode 100644 index e66c80fe882..00000000000 --- a/samples/client/petstore/java/docs/paths/petfindbystatus/get/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/petfindbystatus/get/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/petfindbystatus/get/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/petfindbystatus/get/responses/Code200Response.md deleted file mode 100644 index 0e7affa0f68..00000000000 --- a/samples/client/petstore/java/docs/paths/petfindbystatus/get/responses/Code200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# Code200Response - -public class Code200Response extends [SuccessfulXmlAndJsonArrayOfPet](../../components/responses/SuccessfulXmlAndJsonArrayOfPet.md) - -A class (extended from the $ref class) that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## Code200Response1 -public static class Code200Response1 extends [SuccessfulXmlAndJsonArrayOfPet1](../../components/responses/SuccessfulXmlAndJsonArrayOfPet.md#successfulxmlandjsonarrayofpet1)
- -a class that deserializes responses, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/petfindbystatus/get/responses/Code400Response.md b/samples/client/petstore/java/docs/paths/petfindbystatus/get/responses/Code400Response.md deleted file mode 100644 index 6f3af2df6d2..00000000000 --- a/samples/client/petstore/java/docs/paths/petfindbystatus/get/responses/Code400Response.md +++ /dev/null @@ -1,32 +0,0 @@ -# Code400Response - -public class Code400Response - -A class that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code400Response.Code400Response1](#code400response1)
class that deserializes responses | - -## Code400Response1 -public static class Code400Response1
-extends ResponseDeserializer - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code400Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = MapUtils.makeMap(
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/petfindbystatus/get/responses/PetfindbystatusGetCode200Response.md b/samples/client/petstore/java/docs/paths/petfindbystatus/get/responses/PetfindbystatusGetCode200Response.md new file mode 100644 index 00000000000..a6a3459b37a --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petfindbystatus/get/responses/PetfindbystatusGetCode200Response.md @@ -0,0 +1,17 @@ +# PetfindbystatusGetCode200Response + +public class PetfindbystatusGetCode200Response extends [SuccessfulXmlAndJsonArrayOfPet](../../components/responses/SuccessfulXmlAndJsonArrayOfPet.md) + +A class (extended from the $ref class) that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [PetfindbystatusGetCode200Response.PetfindbystatusGetCode200Response1](#petfindbystatusgetcode200response1)
class that deserializes responses | + +## PetfindbystatusGetCode200Response1 +public static class PetfindbystatusGetCode200Response1 extends [SuccessfulXmlAndJsonArrayOfPet1](../../components/responses/SuccessfulXmlAndJsonArrayOfPet.md#successfulxmlandjsonarrayofpet1)
+ +a class that deserializes responses, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/petfindbystatus/get/responses/PetfindbystatusGetCode400Response.md b/samples/client/petstore/java/docs/paths/petfindbystatus/get/responses/PetfindbystatusGetCode400Response.md new file mode 100644 index 00000000000..19c777ba542 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petfindbystatus/get/responses/PetfindbystatusGetCode400Response.md @@ -0,0 +1,32 @@ +# PetfindbystatusGetCode400Response + +public class PetfindbystatusGetCode400Response + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [PetfindbystatusGetCode400Response.PetfindbystatusGetCode400Response1](#petfindbystatusgetcode400response1)
class that deserializes responses | + +## PetfindbystatusGetCode400Response1 +public static class PetfindbystatusGetCode400Response1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetfindbystatusGetCode400Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/petfindbystatus/get/servers/PetfindbystatusGetServer0.md b/samples/client/petstore/java/docs/paths/petfindbystatus/get/servers/PetfindbystatusGetServer0.md deleted file mode 100644 index 475550269b3..00000000000 --- a/samples/client/petstore/java/docs/paths/petfindbystatus/get/servers/PetfindbystatusGetServer0.md +++ /dev/null @@ -1,14 +0,0 @@ -# Server PetfindbystatusServer0 -public class PetfindbystatusServer0 - -A class that stores a server url - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PetfindbystatusServer0()
Creates a server | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| String | url = "https://path-server-test.petstore.local/v2" | diff --git a/samples/client/petstore/java/docs/paths/petfindbystatus/get/servers/PetfindbystatusGetServer1.md b/samples/client/petstore/java/docs/paths/petfindbystatus/get/servers/PetfindbystatusGetServer1.md deleted file mode 100644 index ab28355949d..00000000000 --- a/samples/client/petstore/java/docs/paths/petfindbystatus/get/servers/PetfindbystatusGetServer1.md +++ /dev/null @@ -1,16 +0,0 @@ -# Server PetfindbystatusServer1 -public class PetfindbystatusServer1 - -A class that stores a server url - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PetfindbystatusServer1()
Creates a server using default values for variables | -| PetfindbystatusServer1([Variables.VariablesMap](../../../../paths/petfindbystatus/servers/server1/Variables.md#variablesmap) variables)
Creates a server using input values for variables | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| String | url = "https://petstore.swagger.io/{version}" | -| [Variables.VariablesMap](../../../../paths/petfindbystatus/servers/server1/Variables.md#variablesmap) | variables | diff --git a/samples/client/petstore/java/docs/paths/petfindbystatus/get/servers/server1/Variables.md b/samples/client/petstore/java/docs/paths/petfindbystatus/get/servers/server1/Variables.md deleted file mode 100644 index 46cdc192bca..00000000000 --- a/samples/client/petstore/java/docs/paths/petfindbystatus/get/servers/server1/Variables.md +++ /dev/null @@ -1,355 +0,0 @@ -# Variables -public class Variables
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads -- enum classes - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [Variables.Variables1Boxed](#variables1boxed)
sealed interface for validated payloads | -| record | [Variables.Variables1BoxedMap](#variables1boxedmap)
boxed class to store validated Map payloads | -| static class | [Variables.Variables1](#variables1)
schema class | -| static class | [Variables.VariablesMapBuilder](#variablesmapbuilder)
builder for Map payloads | -| static class | [Variables.VariablesMap](#variablesmap)
output class for Map payloads | -| sealed interface | [Variables.VersionBoxed](#versionboxed)
sealed interface for validated payloads | -| record | [Variables.VersionBoxedString](#versionboxedstring)
boxed class to store validated String payloads | -| static class | [Variables.Version](#version)
schema class | -| enum | [Variables.StringVersionEnums](#stringversionenums)
String enum | -| sealed interface | [Variables.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [Variables.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [Variables.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [Variables.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [Variables.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [Variables.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [Variables.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [Variables.AdditionalProperties](#additionalproperties)
schema class | - -## Variables1Boxed -public sealed interface Variables1Boxed
-permits
-[Variables1BoxedMap](#variables1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## Variables1BoxedMap -public record Variables1BoxedMap
-implements [Variables1Boxed](#variables1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Variables1BoxedMap([VariablesMap](#variablesmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [VariablesMap](#variablesmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## Variables1 -public static class Variables1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.petfindbystatus.servers.server1.Variables; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); - -// Map validation -Variables.VariablesMap validatedPayload = - Variables.Variables1.validate( - new Variables.VariablesMapBuilder() - .version("v1") - - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("version", [Version.class](#version)))
)
| -| Set | required = Set.of(
    "version"
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [VariablesMap](#variablesmap) | validate([Map<?, ?>](#variablesmapbuilder) arg, SchemaConfiguration configuration) | -| [Variables1BoxedMap](#variables1boxedmap) | validateAndBox([Map<?, ?>](#variablesmapbuilder) arg, SchemaConfiguration configuration) | -| [Variables1Boxed](#variables1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## VariablesMap0Builder -public class VariablesMap0Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| VariablesMap0Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | - -## VariablesMapBuilder -public class VariablesMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| VariablesMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [VariablesMap0Builder](#variablesmap0builder) | version(String value) | -| [VariablesMap0Builder](#variablesmap0builder) | version([StringVersionEnums](#stringversionenums) value) | - -## VariablesMap -public static class VariablesMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [VariablesMap](#variablesmap) | of([Map](#variablesmapbuilder) arg, SchemaConfiguration configuration) | -| String | version()
must be one of ["v1", "v2"] if omitted the server will use the default value of v1 | - -## VersionBoxed -public sealed interface VersionBoxed
-permits
-[VersionBoxedString](#versionboxedstring) - -sealed interface that stores validated payloads using boxed classes - -## VersionBoxedString -public record VersionBoxedString
-implements [VersionBoxed](#versionboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| VersionBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## Version -public static class Version
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.petfindbystatus.servers.server1.Variables; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone()); - -// String validation -String validatedPayload = Variables.Version.validate( - "v1", - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(
    String.class
)
| -| Set | enumValues = SetMaker.makeSet(
    "v1",
    "v2"
)
| -| @Nullable Object | defaultValue = "v1" | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | validate(String arg, SchemaConfiguration configuration) | -| String | validate([StringVersionEnums](#stringversionenums) arg, SchemaConfiguration configuration) | -| [VersionBoxedString](#versionboxedstring) | validateAndBox(String arg, SchemaConfiguration configuration) | -| [VersionBoxed](#versionboxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## StringVersionEnums -public enum StringVersionEnums
-extends `Enum` - -A class that stores String enum values - -### Enum Constant Summary -| Enum Constant | Description | -| ------------- | ----------- | -| V1 | value = "v1" | -| V2 | value = "v2" | - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/petfindbytags/Get.md b/samples/client/petstore/java/docs/paths/petfindbytags/Get.md deleted file mode 100644 index 28775d29957..00000000000 --- a/samples/client/petstore/java/docs/paths/petfindbytags/Get.md +++ /dev/null @@ -1,192 +0,0 @@ -# Get - -public class Get - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Get1](#get1)
The class that has a get method to call the endpoint | -| static class | [GetRequest](#getrequest)
The final request inputs class | -| static class | [GetNullableRequest](#getnullablerequest)
The initial request inputs class | -| static class | [Get0RequestBuilder](#get0requestbuilder)
A builder for the request input class | -| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | - -## Get1 -public static class Get1 extends ApiClient.ApiClient1 implements GetOperation
- -a class that allows one to call the endpoint using a method named get - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.petfindbytags.get.PetfindbytagsGetSecurityInfo; -import org.openapijsonschematools.client.paths.petfindbytags.get.QueryParameters; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.securityschemes.SecurityScheme; -import org.openapijsonschematools.client.components.securityschemes.HttpSignatureTest; -import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; -import org.openapijsonschematools.client.paths.petfindbytags.get.responses.Code200Response; -import org.openapijsonschematools.client.paths.petfindbytags.get.responses.Code400Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.petfindbytags.Get; -import org.openapijsonschematools.client.paths.petfindbytags.get.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -List securitySchemes = new ArrayList(); -ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() - .petfindbytagsGetSecurityRequirementObject0SecurityIndex(PetfindbytagsGetSecurityRequirementObject0.SecurityIndex.SECURITY_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - securitySchemes, - securityIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Get.Get1 apiClient = new Get.Get1(apiConfiguration, schemaConfiguration); - - -// Map validation -QueryParameters.QueryParametersMap queryParameters = - QueryParameters.QueryParameters1.validate( - new QueryParameters.QueryParametersMapBuilder() - .tags( - Arrays.asList( - "a" - ) - ) - .build(), - schemaConfiguration -); - -var request = new GetRequestBuilder() - .queryParameters(queryParameters) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.get(request); -} catch (Code400Response.ResponseApiException e) { - // server returned an error response defined in the openapi document - throw e; -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -} -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/petfindbytags/get/Responses.md#endpointresponse) | get([GetRequest](#getrequest) request) | - -## GetRequest -public static class GetRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [QueryParameters.QueryParametersMap](../../paths/petfindbytags/get/QueryParameters.md#queryparametersmap) | queryParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| [PetfindbytagsGetSecurityInfo.@Nullable SecurityIndex](../../paths/petfindbytags/get/PetfindbytagsGetSecurityInfo.md#securityindex) | securityIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## GetNullableRequest -public static class GetNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [QueryParameters.@Nullable QueryParametersMap](../../paths/petfindbytags/get/QueryParameters.md#queryparametersmap) | queryParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| [PetfindbytagsGetSecurityInfo.@Nullable SecurityIndex](../../paths/petfindbytags/get/PetfindbytagsGetSecurityInfo.md#securityindex) | securityIndex | -| @Nullable Duration | timeout | - -## Get0RequestBuilder -public static class Get0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get0RequestBuilder(Get0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | -| [Get0RequestBuilder](#get0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Get0RequestBuilder](#get0requestbuilder) | securityIndex([PetfindbytagsGetSecurityInfo.SecurityIndex](../../paths/petfindbytags/get/PetfindbytagsGetSecurityInfo.md#securityindex) securityIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Get0RequestBuilder](#get0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## GetRequestBuilder -public static class GetRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| GetRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Get0RequestBuilder](#get0requestbuilder) | queryParameters([QueryParametersQueryParametersMap](../../paths/petfindbytags/get/QueryParameters.md#queryparametersmap) queryParameters)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/petfindbytags/PetfindbytagsGet.md b/samples/client/petstore/java/docs/paths/petfindbytags/PetfindbytagsGet.md new file mode 100644 index 00000000000..4112881319f --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petfindbytags/PetfindbytagsGet.md @@ -0,0 +1,203 @@ +# PetfindbytagsGet + +public class PetfindbytagsGet + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Get](#get)
The class that has a get method to call the endpoint | +| interface | [FindPetsByTagsOperation](#findpetsbytagsoperation)
The interface that has a findPetsByTags method to call the endpoint | +| static class | [GetRequest](#getrequest)
The final request inputs class | +| static class | [GetNullableRequest](#getnullablerequest)
The initial request inputs class | +| static class | [Get0RequestBuilder](#get0requestbuilder)
A builder for the request input class | +| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | + +## Get +public static class Get extends ApiClient.ApiClient1 implements GetOperation
+ +a class that allows one to call the endpoint using a method named get + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.petfindbytags.get.PetfindbytagsGetSecurityInfo; +import org.openapijsonschematools.client.paths.petfindbytags.get.PetfindbytagsGetQueryParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.HttpSignatureTest; +import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; +import org.openapijsonschematools.client.paths.petfindbytags.get.responses.PetfindbytagsGetCode200Response; +import org.openapijsonschematools.client.paths.petfindbytags.get.responses.PetfindbytagsGetCode400Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.petfindbytags.PetfindbytagsGet; +import org.openapijsonschematools.client.paths.petfindbytags.get.PetfindbytagsGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .petfindbytagsGetSecurityRequirementObject0SecurityIndex(PetfindbytagsGetSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +PetfindbytagsGet.Get apiClient = new PetfindbytagsGet.Get(apiConfiguration, schemaConfiguration); + + +// Map validation +PetfindbytagsGetQueryParameters.PetfindbytagsGetQueryParametersMap queryParameters = + PetfindbytagsGetQueryParameters.PetfindbytagsGetQueryParameters1.validate( + new PetfindbytagsGetQueryParameters.PetfindbytagsGetQueryParametersMapBuilder() + .tags( + Arrays.asList( + "a" + ) + ) + .build(), + schemaConfiguration +); + +var request = new PetfindbytagsGet.GetRequestBuilder() + .queryParameters(queryParameters) + .build(); + +PetfindbytagsGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (PetfindbytagsGetCode400Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +PetfindbytagsGetResponses.EndpointPetfindbytagsGetCode200Response castResponse = (PetfindbytagsGetResponses.EndpointPetfindbytagsGetCode200Response) response; +} +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetfindbytagsGetResponses.EndpointResponse](../../paths/petfindbytags/get/PetfindbytagsGetResponses.md#endpointresponse) | get([GetRequest](#getrequest) request) | + +## FindPetsByTagsOperation +public interface FindPetsByTagsOperation
+ +an interface that allows one to call the endpoint using a method named findPetsByTags by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetfindbytagsGetResponses.EndpointResponse](../../paths/petfindbytags/get/PetfindbytagsGetResponses.md#endpointresponse) | findPetsByTags([GetRequest](#getrequest) request) | + +## GetRequest +public static class GetRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [PetfindbytagsGetQueryParameters.PetfindbytagsGetQueryParametersMap](../../paths/petfindbytags/get/PetfindbytagsGetQueryParameters.md#petfindbytagsgetqueryparametersmap) | queryParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| [PetfindbytagsGetSecurityInfo.@Nullable SecurityIndex](../../paths/petfindbytags/get/PetfindbytagsGetSecurityInfo.md#securityindex) | securityIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## GetNullableRequest +public static class GetNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [PetfindbytagsGetQueryParameters.@Nullable PetfindbytagsGetQueryParametersMap](../../paths/petfindbytags/get/PetfindbytagsGetQueryParameters.md#petfindbytagsgetqueryparametersmap) | queryParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| [PetfindbytagsGetSecurityInfo.@Nullable SecurityIndex](../../paths/petfindbytags/get/PetfindbytagsGetSecurityInfo.md#securityindex) | securityIndex | +| @Nullable Duration | timeout | + +## Get0RequestBuilder +public static class Get0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get0RequestBuilder(Get0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | +| [Get0RequestBuilder](#get0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Get0RequestBuilder](#get0requestbuilder) | securityIndex([PetfindbytagsGetSecurityInfo.SecurityIndex](../../paths/petfindbytags/get/PetfindbytagsGetSecurityInfo.md#securityindex) securityIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Get0RequestBuilder](#get0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## GetRequestBuilder +public static class GetRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| GetRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Get0RequestBuilder](#get0requestbuilder) | queryParameters([PetfindbytagsGetQueryParametersPetfindbytagsGetQueryParametersMap](../../paths/petfindbytags/get/PetfindbytagsGetQueryParameters.md#petfindbytagsgetqueryparametersmap) queryParameters)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/petfindbytags/get/PetfindbytagsGetQueryParameters.md b/samples/client/petstore/java/docs/paths/petfindbytags/get/PetfindbytagsGetQueryParameters.md new file mode 100644 index 00000000000..efe1cd154c0 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petfindbytags/get/PetfindbytagsGetQueryParameters.md @@ -0,0 +1,271 @@ +# PetfindbytagsGetQueryParameters +public class PetfindbytagsGetQueryParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [PetfindbytagsGetQueryParameters.PetfindbytagsGetQueryParameters1Boxed](#petfindbytagsgetqueryparameters1boxed)
sealed interface for validated payloads | +| record | [PetfindbytagsGetQueryParameters.PetfindbytagsGetQueryParameters1BoxedMap](#petfindbytagsgetqueryparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [PetfindbytagsGetQueryParameters.PetfindbytagsGetQueryParameters1](#petfindbytagsgetqueryparameters1)
schema class | +| static class | [PetfindbytagsGetQueryParameters.PetfindbytagsGetQueryParametersMapBuilder](#petfindbytagsgetqueryparametersmapbuilder)
builder for Map payloads | +| static class | [PetfindbytagsGetQueryParameters.PetfindbytagsGetQueryParametersMap](#petfindbytagsgetqueryparametersmap)
output class for Map payloads | +| sealed interface | [PetfindbytagsGetQueryParameters.PetfindbytagsGetadditionalPropertiesBoxed](#petfindbytagsgetadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [PetfindbytagsGetQueryParameters.PetfindbytagsGetadditionalPropertiesBoxedVoid](#petfindbytagsgetadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [PetfindbytagsGetQueryParameters.PetfindbytagsGetadditionalPropertiesBoxedBoolean](#petfindbytagsgetadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [PetfindbytagsGetQueryParameters.PetfindbytagsGetadditionalPropertiesBoxedNumber](#petfindbytagsgetadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [PetfindbytagsGetQueryParameters.PetfindbytagsGetadditionalPropertiesBoxedString](#petfindbytagsgetadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [PetfindbytagsGetQueryParameters.PetfindbytagsGetadditionalPropertiesBoxedList](#petfindbytagsgetadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [PetfindbytagsGetQueryParameters.PetfindbytagsGetadditionalPropertiesBoxedMap](#petfindbytagsgetadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [PetfindbytagsGetQueryParameters.PetfindbytagsGetadditionalProperties](#petfindbytagsgetadditionalproperties)
schema class | + +## PetfindbytagsGetQueryParameters1Boxed +public sealed interface PetfindbytagsGetQueryParameters1Boxed
+permits
+[PetfindbytagsGetQueryParameters1BoxedMap](#petfindbytagsgetqueryparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## PetfindbytagsGetQueryParameters1BoxedMap +public record PetfindbytagsGetQueryParameters1BoxedMap
+implements [PetfindbytagsGetQueryParameters1Boxed](#petfindbytagsgetqueryparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetfindbytagsGetQueryParameters1BoxedMap([PetfindbytagsGetQueryParametersMap](#petfindbytagsgetqueryparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetfindbytagsGetQueryParametersMap](#petfindbytagsgetqueryparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetfindbytagsGetQueryParameters1 +public static class PetfindbytagsGetQueryParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.petfindbytags.get.PetfindbytagsGetQueryParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +PetfindbytagsGetQueryParameters.PetfindbytagsGetQueryParametersMap validatedPayload = + PetfindbytagsGetQueryParameters.PetfindbytagsGetQueryParameters1.validate( + new PetfindbytagsGetQueryParameters.PetfindbytagsGetQueryParametersMapBuilder() + .tags( + Arrays.asList( + "a" + ) + ) + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("tags", [Schema0.Schema01.class](../../../paths/petfindbytags/get/parameters/parameter0/Schema0.md#schema01))
)
| +| Set | required = Set.of(
    "tags"
)
| +| Class | additionalProperties = [PetfindbytagsGetadditionalProperties.class](#petfindbytagsgetadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetfindbytagsGetQueryParametersMap](#petfindbytagsgetqueryparametersmap) | validate([Map<?, ?>](#petfindbytagsgetqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [PetfindbytagsGetQueryParameters1BoxedMap](#petfindbytagsgetqueryparameters1boxedmap) | validateAndBox([Map<?, ?>](#petfindbytagsgetqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [PetfindbytagsGetQueryParameters1Boxed](#petfindbytagsgetqueryparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## PetfindbytagsGetQueryParametersMap0Builder +public class PetfindbytagsGetQueryParametersMap0Builder
+builder for `Map>` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetfindbytagsGetQueryParametersMap0Builder(Map> instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map> | build()
Returns map input that should be used with Schema.validate | + +## PetfindbytagsGetQueryParametersMapBuilder +public class PetfindbytagsGetQueryParametersMapBuilder
+builder for `Map>` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetfindbytagsGetQueryParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetfindbytagsGetQueryParametersMap0Builder](#petfindbytagsgetqueryparametersmap0builder) | tags(List value) | + +## PetfindbytagsGetQueryParametersMap +public static class PetfindbytagsGetQueryParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [PetfindbytagsGetQueryParametersMap](#petfindbytagsgetqueryparametersmap) | of([Map>](#petfindbytagsgetqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [Schema0.SchemaList0](../../../paths/petfindbytags/get/parameters/parameter0/Schema0.md#schemalist0) | tags()
| + +## PetfindbytagsGetadditionalPropertiesBoxed +public sealed interface PetfindbytagsGetadditionalPropertiesBoxed
+permits
+[PetfindbytagsGetadditionalPropertiesBoxedVoid](#petfindbytagsgetadditionalpropertiesboxedvoid), +[PetfindbytagsGetadditionalPropertiesBoxedBoolean](#petfindbytagsgetadditionalpropertiesboxedboolean), +[PetfindbytagsGetadditionalPropertiesBoxedNumber](#petfindbytagsgetadditionalpropertiesboxednumber), +[PetfindbytagsGetadditionalPropertiesBoxedString](#petfindbytagsgetadditionalpropertiesboxedstring), +[PetfindbytagsGetadditionalPropertiesBoxedList](#petfindbytagsgetadditionalpropertiesboxedlist), +[PetfindbytagsGetadditionalPropertiesBoxedMap](#petfindbytagsgetadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## PetfindbytagsGetadditionalPropertiesBoxedVoid +public record PetfindbytagsGetadditionalPropertiesBoxedVoid
+implements [PetfindbytagsGetadditionalPropertiesBoxed](#petfindbytagsgetadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetfindbytagsGetadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetfindbytagsGetadditionalPropertiesBoxedBoolean +public record PetfindbytagsGetadditionalPropertiesBoxedBoolean
+implements [PetfindbytagsGetadditionalPropertiesBoxed](#petfindbytagsgetadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetfindbytagsGetadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetfindbytagsGetadditionalPropertiesBoxedNumber +public record PetfindbytagsGetadditionalPropertiesBoxedNumber
+implements [PetfindbytagsGetadditionalPropertiesBoxed](#petfindbytagsgetadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetfindbytagsGetadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetfindbytagsGetadditionalPropertiesBoxedString +public record PetfindbytagsGetadditionalPropertiesBoxedString
+implements [PetfindbytagsGetadditionalPropertiesBoxed](#petfindbytagsgetadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetfindbytagsGetadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetfindbytagsGetadditionalPropertiesBoxedList +public record PetfindbytagsGetadditionalPropertiesBoxedList
+implements [PetfindbytagsGetadditionalPropertiesBoxed](#petfindbytagsgetadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetfindbytagsGetadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetfindbytagsGetadditionalPropertiesBoxedMap +public record PetfindbytagsGetadditionalPropertiesBoxedMap
+implements [PetfindbytagsGetadditionalPropertiesBoxed](#petfindbytagsgetadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetfindbytagsGetadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetfindbytagsGetadditionalProperties +public static class PetfindbytagsGetadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/petfindbytags/get/PetfindbytagsGetResponses.md b/samples/client/petstore/java/docs/paths/petfindbytags/get/PetfindbytagsGetResponses.md new file mode 100644 index 00000000000..fcdbec4dfbe --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petfindbytags/get/PetfindbytagsGetResponses.md @@ -0,0 +1,29 @@ +# PetfindbytagsGetResponses + +public class PetfindbytagsGetResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointPetfindbytagsGetCode200Response](#endpointpetfindbytagsgetcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointPetfindbytagsGetCode200Response](#endpointpetfindbytagsgetcode200response) + +a sealed interface that stores endpoint responses + +## EndpointPetfindbytagsGetCode200Response +public record EndpointPetfindbytagsGetCode200Response( + HttpResponse response, + [PetfindbytagsGetCode200Response.SealedResponseBody](../../../paths/petfindbytags/get/responses/PetfindbytagsGetCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/petfindbytags/get/QueryParameters.md b/samples/client/petstore/java/docs/paths/petfindbytags/get/QueryParameters.md deleted file mode 100644 index afd39beba64..00000000000 --- a/samples/client/petstore/java/docs/paths/petfindbytags/get/QueryParameters.md +++ /dev/null @@ -1,271 +0,0 @@ -# QueryParameters -public class QueryParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [QueryParameters.QueryParameters1Boxed](#queryparameters1boxed)
sealed interface for validated payloads | -| record | [QueryParameters.QueryParameters1BoxedMap](#queryparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [QueryParameters.QueryParameters1](#queryparameters1)
schema class | -| static class | [QueryParameters.QueryParametersMapBuilder](#queryparametersmapbuilder)
builder for Map payloads | -| static class | [QueryParameters.QueryParametersMap](#queryparametersmap)
output class for Map payloads | -| sealed interface | [QueryParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [QueryParameters.AdditionalProperties](#additionalproperties)
schema class | - -## QueryParameters1Boxed -public sealed interface QueryParameters1Boxed
-permits
-[QueryParameters1BoxedMap](#queryparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## QueryParameters1BoxedMap -public record QueryParameters1BoxedMap
-implements [QueryParameters1Boxed](#queryparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParameters1BoxedMap([QueryParametersMap](#queryparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap](#queryparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## QueryParameters1 -public static class QueryParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.petfindbytags.get.QueryParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -QueryParameters.QueryParametersMap validatedPayload = - QueryParameters.QueryParameters1.validate( - new QueryParameters.QueryParametersMapBuilder() - .tags( - Arrays.asList( - "a" - ) - ) - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("tags", [Schema0.Schema01.class](../../../paths/petfindbytags/get/parameters/parameter0/Schema0.md#schema01))
)
| -| Set | required = Set.of(
    "tags"
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap](#queryparametersmap) | validate([Map<?, ?>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [QueryParameters1BoxedMap](#queryparameters1boxedmap) | validateAndBox([Map<?, ?>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [QueryParameters1Boxed](#queryparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## QueryParametersMap0Builder -public class QueryParametersMap0Builder
-builder for `Map>` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap0Builder(Map> instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map> | build()
Returns map input that should be used with Schema.validate | - -## QueryParametersMapBuilder -public class QueryParametersMapBuilder
-builder for `Map>` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap0Builder](#queryparametersmap0builder) | tags(List value) | - -## QueryParametersMap -public static class QueryParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [QueryParametersMap](#queryparametersmap) | of([Map>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [Schema0.SchemaList0](../../../paths/petfindbytags/get/parameters/parameter0/Schema0.md#schemalist0) | tags()
| - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/petfindbytags/get/Responses.md b/samples/client/petstore/java/docs/paths/petfindbytags/get/Responses.md deleted file mode 100644 index 3ca626fc0c0..00000000000 --- a/samples/client/petstore/java/docs/paths/petfindbytags/get/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/petfindbytags/get/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/petfindbytags/get/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/petfindbytags/get/responses/Code200Response.md deleted file mode 100644 index c28458ec7e5..00000000000 --- a/samples/client/petstore/java/docs/paths/petfindbytags/get/responses/Code200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# Code200Response - -public class Code200Response extends [RefSuccessfulXmlAndJsonArrayOfPet](../../components/responses/RefSuccessfulXmlAndJsonArrayOfPet.md) - -A class (extended from the $ref class) that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## Code200Response1 -public static class Code200Response1 extends [RefSuccessfulXmlAndJsonArrayOfPet1](../../components/responses/RefSuccessfulXmlAndJsonArrayOfPet.md#refsuccessfulxmlandjsonarrayofpet1)
- -a class that deserializes responses, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/petfindbytags/get/responses/Code400Response.md b/samples/client/petstore/java/docs/paths/petfindbytags/get/responses/Code400Response.md deleted file mode 100644 index 6f3af2df6d2..00000000000 --- a/samples/client/petstore/java/docs/paths/petfindbytags/get/responses/Code400Response.md +++ /dev/null @@ -1,32 +0,0 @@ -# Code400Response - -public class Code400Response - -A class that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code400Response.Code400Response1](#code400response1)
class that deserializes responses | - -## Code400Response1 -public static class Code400Response1
-extends ResponseDeserializer - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code400Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = MapUtils.makeMap(
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/petfindbytags/get/responses/PetfindbytagsGetCode200Response.md b/samples/client/petstore/java/docs/paths/petfindbytags/get/responses/PetfindbytagsGetCode200Response.md new file mode 100644 index 00000000000..e2de5e1fab7 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petfindbytags/get/responses/PetfindbytagsGetCode200Response.md @@ -0,0 +1,17 @@ +# PetfindbytagsGetCode200Response + +public class PetfindbytagsGetCode200Response extends [RefSuccessfulXmlAndJsonArrayOfPet](../../components/responses/RefSuccessfulXmlAndJsonArrayOfPet.md) + +A class (extended from the $ref class) that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [PetfindbytagsGetCode200Response.PetfindbytagsGetCode200Response1](#petfindbytagsgetcode200response1)
class that deserializes responses | + +## PetfindbytagsGetCode200Response1 +public static class PetfindbytagsGetCode200Response1 extends [RefSuccessfulXmlAndJsonArrayOfPet1](../../components/responses/RefSuccessfulXmlAndJsonArrayOfPet.md#refsuccessfulxmlandjsonarrayofpet1)
+ +a class that deserializes responses, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/petfindbytags/get/responses/PetfindbytagsGetCode400Response.md b/samples/client/petstore/java/docs/paths/petfindbytags/get/responses/PetfindbytagsGetCode400Response.md new file mode 100644 index 00000000000..b542fd57299 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petfindbytags/get/responses/PetfindbytagsGetCode400Response.md @@ -0,0 +1,32 @@ +# PetfindbytagsGetCode400Response + +public class PetfindbytagsGetCode400Response + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [PetfindbytagsGetCode400Response.PetfindbytagsGetCode400Response1](#petfindbytagsgetcode400response1)
class that deserializes responses | + +## PetfindbytagsGetCode400Response1 +public static class PetfindbytagsGetCode400Response1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetfindbytagsGetCode400Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/petpetid/Delete.md b/samples/client/petstore/java/docs/paths/petpetid/Delete.md deleted file mode 100644 index 1ba8d30cd1c..00000000000 --- a/samples/client/petstore/java/docs/paths/petpetid/Delete.md +++ /dev/null @@ -1,193 +0,0 @@ -# Delete - -public class Delete - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Delete1](#delete1)
The class that has a delete method to call the endpoint | -| static class | [DeleteRequest](#deleterequest)
The final request inputs class | -| static class | [DeleteNullableRequest](#deletenullablerequest)
The initial request inputs class | -| static class | [Delete0RequestBuilder](#delete0requestbuilder)
A builder for the request input class | -| static class | [DeleteRequestBuilder](#deleterequestbuilder)
A builder for the request input class | - -## Delete1 -public static class Delete1 extends ApiClient.ApiClient1 implements DeleteOperation
- -a class that allows one to call the endpoint using a method named delete - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.petpetid.delete.HeaderParameters; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.petpetid.delete.PetpetidDeleteSecurityInfo; -import org.openapijsonschematools.client.paths.petpetid.delete.PathParameters; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.securityschemes.SecurityScheme; -import org.openapijsonschematools.client.components.securityschemes.ApiKey; -import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; -import org.openapijsonschematools.client.paths.petpetid.delete.responses.Code400Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.petpetid.Delete; -import org.openapijsonschematools.client.paths.petpetid.delete.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -List securitySchemes = new ArrayList(); -securitySchemes.add( - new ApiKey("someApiKey"); -); -ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() - .petpetidDeleteSecurityRequirementObject0SecurityIndex(PetpetidDeleteSecurityRequirementObject0.SecurityIndex.SECURITY_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - securitySchemes, - securityIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Delete.Delete1 apiClient = new Delete.Delete1(apiConfiguration, schemaConfiguration); - - -// Map validation -PathParameters.PathParametersMap pathParameters = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .petId(1L) - - .build(), - schemaConfiguration -); - -var request = new DeleteRequestBuilder() - .pathParameters(pathParameters) - .build(); - -Void response; -try { - response = apiClient.delete(request); -} catch (Code400Response.ResponseApiException e) { - // server returned an error response defined in the openapi document - throw e; -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Delete1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | delete([DeleteRequest](#deleterequest) request) | - -## DeleteRequest -public static class DeleteRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [PathParameters.PathParametersMap](../../paths/petpetid/delete/PathParameters.md#pathparametersmap) | pathParameters | -| [HeaderParameters.@Nullable HeaderParametersMap](../../paths/petpetid/delete/HeaderParameters.md#headerparametersmap) | headerParameters
optional | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| [PetpetidDeleteSecurityInfo.@Nullable SecurityIndex](../../paths/petpetid/delete/PetpetidDeleteSecurityInfo.md#securityindex) | securityIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## DeleteNullableRequest -public static class DeleteNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [PathParameters.@Nullable PathParametersMap](../../paths/petpetid/delete/PathParameters.md#pathparametersmap) | pathParameters | -| [HeaderParameters.@Nullable HeaderParametersMap](../../paths/petpetid/delete/HeaderParameters.md#headerparametersmap) | headerParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| [PetpetidDeleteSecurityInfo.@Nullable SecurityIndex](../../paths/petpetid/delete/PetpetidDeleteSecurityInfo.md#securityindex) | securityIndex | -| @Nullable Duration | timeout | - -## Delete0RequestBuilder -public static class Delete0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Delete0RequestBuilder(Delete0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [DeleteRequest](#deleterequest) | build()
Returns the request input used to call an endpoint method | -| [Delete0RequestBuilder](#delete0requestbuilder) | headerParameters([HeaderParametersHeaderParametersMap](../../paths/petpetid/delete/HeaderParameters.md#headerparametersmap) headerParameters)
sets the optional property | -| [Delete0RequestBuilder](#delete0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Delete0RequestBuilder](#delete0requestbuilder) | securityIndex([PetpetidDeleteSecurityInfo.SecurityIndex](../../paths/petpetid/delete/PetpetidDeleteSecurityInfo.md#securityindex) securityIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Delete0RequestBuilder](#delete0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## DeleteRequestBuilder -public static class DeleteRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| DeleteRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Delete0RequestBuilder](#delete0requestbuilder) | pathParameters([PathParametersPathParametersMap](../../paths/petpetid/delete/PathParameters.md#pathparametersmap) pathParameters)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/petpetid/Get.md b/samples/client/petstore/java/docs/paths/petpetid/Get.md deleted file mode 100644 index 6ca724ecbd4..00000000000 --- a/samples/client/petstore/java/docs/paths/petpetid/Get.md +++ /dev/null @@ -1,197 +0,0 @@ -# Get - -public class Get - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Get1](#get1)
The class that has a get method to call the endpoint | -| static class | [GetRequest](#getrequest)
The final request inputs class | -| static class | [GetNullableRequest](#getnullablerequest)
The initial request inputs class | -| static class | [Get0RequestBuilder](#get0requestbuilder)
A builder for the request input class | -| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | - -## Get1 -public static class Get1 extends ApiClient.ApiClient1 implements GetOperation
- -a class that allows one to call the endpoint using a method named get - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.petpetid.get.PetpetidGetSecurityInfo; -import org.openapijsonschematools.client.paths.petpetid.get.PathParameters; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.securityschemes.SecurityScheme; -import org.openapijsonschematools.client.components.securityschemes.ApiKey; -import org.openapijsonschematools.client.paths.petpetid.get.responses.Code200Response; -import org.openapijsonschematools.client.paths.petpetid.get.responses.Code400Response; -import org.openapijsonschematools.client.paths.petpetid.get.responses.Code404Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.petpetid.Get; -import org.openapijsonschematools.client.paths.petpetid.get.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -List securitySchemes = new ArrayList(); -securitySchemes.add( - new ApiKey("someApiKey"); -); -ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() - .petpetidGetSecurityRequirementObject0SecurityIndex(PetpetidGetSecurityRequirementObject0.SecurityIndex.SECURITY_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - securitySchemes, - securityIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Get.Get1 apiClient = new Get.Get1(apiConfiguration, schemaConfiguration); - - -// Map validation -PathParameters.PathParametersMap pathParameters = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .petId(1L) - - .build(), - schemaConfiguration -); - -var request = new GetRequestBuilder() - .pathParameters(pathParameters) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.get(request); -} catch (Code400Response.ResponseApiException | Code404Response.ResponseApiException e) { - // server returned an error response defined in the openapi document - throw e; -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -if (castResponse.body instanceof Code200Response.ApplicationxmlResponseBody deserializedBody) { - // handle deserialized body here -} else { - Code200Response.ApplicationjsonResponseBody deserializedBody = (Code200Response.ApplicationjsonResponseBody) castResponse.body; - // handle deserialized body here -} -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/petpetid/get/Responses.md#endpointresponse) | get([GetRequest](#getrequest) request) | - -## GetRequest -public static class GetRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [PathParameters.PathParametersMap](../../paths/petpetid/get/PathParameters.md#pathparametersmap) | pathParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| [PetpetidGetSecurityInfo.@Nullable SecurityIndex](../../paths/petpetid/get/PetpetidGetSecurityInfo.md#securityindex) | securityIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## GetNullableRequest -public static class GetNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [PathParameters.@Nullable PathParametersMap](../../paths/petpetid/get/PathParameters.md#pathparametersmap) | pathParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| [PetpetidGetSecurityInfo.@Nullable SecurityIndex](../../paths/petpetid/get/PetpetidGetSecurityInfo.md#securityindex) | securityIndex | -| @Nullable Duration | timeout | - -## Get0RequestBuilder -public static class Get0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get0RequestBuilder(Get0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | -| [Get0RequestBuilder](#get0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Get0RequestBuilder](#get0requestbuilder) | securityIndex([PetpetidGetSecurityInfo.SecurityIndex](../../paths/petpetid/get/PetpetidGetSecurityInfo.md#securityindex) securityIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Get0RequestBuilder](#get0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## GetRequestBuilder -public static class GetRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| GetRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Get0RequestBuilder](#get0requestbuilder) | pathParameters([PathParametersPathParametersMap](../../paths/petpetid/get/PathParameters.md#pathparametersmap) pathParameters)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/petpetid/PetpetidDelete.md b/samples/client/petstore/java/docs/paths/petpetid/PetpetidDelete.md new file mode 100644 index 00000000000..9d00adda840 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petpetid/PetpetidDelete.md @@ -0,0 +1,204 @@ +# PetpetidDelete + +public class PetpetidDelete + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Delete](#delete)
The class that has a delete method to call the endpoint | +| interface | [DeletePetOperation](#deletepetoperation)
The interface that has a deletePet method to call the endpoint | +| static class | [DeleteRequest](#deleterequest)
The final request inputs class | +| static class | [DeleteNullableRequest](#deletenullablerequest)
The initial request inputs class | +| static class | [Delete0RequestBuilder](#delete0requestbuilder)
A builder for the request input class | +| static class | [DeleteRequestBuilder](#deleterequestbuilder)
A builder for the request input class | + +## Delete +public static class Delete extends ApiClient.ApiClient1 implements DeleteOperation
+ +a class that allows one to call the endpoint using a method named delete + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.petpetid.delete.PetpetidDeleteHeaderParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.petpetid.delete.PetpetidDeleteSecurityInfo; +import org.openapijsonschematools.client.paths.petpetid.delete.PetpetidDeletePathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.ApiKey; +import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; +import org.openapijsonschematools.client.paths.petpetid.delete.responses.PetpetidDeleteCode400Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.petpetid.PetpetidDelete; +import org.openapijsonschematools.client.paths.petpetid.delete.PetpetidDeleteResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new ApiKey("someApiKey"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .petpetidDeleteSecurityRequirementObject0SecurityIndex(PetpetidDeleteSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +PetpetidDelete.Delete apiClient = new PetpetidDelete.Delete(apiConfiguration, schemaConfiguration); + + +// Map validation +PetpetidDeletePathParameters.PetpetidDeletePathParametersMap pathParameters = + PetpetidDeletePathParameters.PetpetidDeletePathParameters1.validate( + new PetpetidDeletePathParameters.PetpetidDeletePathParametersMapBuilder() + .petId(1L) + + .build(), + schemaConfiguration +); + +var request = new PetpetidDelete.DeleteRequestBuilder() + .pathParameters(pathParameters) + .build(); + +Void response; +try { + response = apiClient.delete(request); +} catch (PetpetidDeleteCode400Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Delete(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | delete([DeleteRequest](#deleterequest) request) | + +## DeletePetOperation +public interface DeletePetOperation
+ +an interface that allows one to call the endpoint using a method named deletePet by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | deletePet([DeleteRequest](#deleterequest) request) | + +## DeleteRequest +public static class DeleteRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [PetpetidDeletePathParameters.PetpetidDeletePathParametersMap](../../paths/petpetid/delete/PetpetidDeletePathParameters.md#petpetiddeletepathparametersmap) | pathParameters | +| [PetpetidDeleteHeaderParameters.@Nullable PetpetidDeleteHeaderParametersMap](../../paths/petpetid/delete/PetpetidDeleteHeaderParameters.md#petpetiddeleteheaderparametersmap) | headerParameters
optional | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| [PetpetidDeleteSecurityInfo.@Nullable SecurityIndex](../../paths/petpetid/delete/PetpetidDeleteSecurityInfo.md#securityindex) | securityIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## DeleteNullableRequest +public static class DeleteNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [PetpetidDeletePathParameters.@Nullable PetpetidDeletePathParametersMap](../../paths/petpetid/delete/PetpetidDeletePathParameters.md#petpetiddeletepathparametersmap) | pathParameters | +| [PetpetidDeleteHeaderParameters.@Nullable PetpetidDeleteHeaderParametersMap](../../paths/petpetid/delete/PetpetidDeleteHeaderParameters.md#petpetiddeleteheaderparametersmap) | headerParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| [PetpetidDeleteSecurityInfo.@Nullable SecurityIndex](../../paths/petpetid/delete/PetpetidDeleteSecurityInfo.md#securityindex) | securityIndex | +| @Nullable Duration | timeout | + +## Delete0RequestBuilder +public static class Delete0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Delete0RequestBuilder(Delete0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [DeleteRequest](#deleterequest) | build()
Returns the request input used to call an endpoint method | +| [Delete0RequestBuilder](#delete0requestbuilder) | headerParameters([PetpetidDeleteHeaderParametersPetpetidDeleteHeaderParametersMap](../../paths/petpetid/delete/PetpetidDeleteHeaderParameters.md#petpetiddeleteheaderparametersmap) headerParameters)
sets the optional property | +| [Delete0RequestBuilder](#delete0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Delete0RequestBuilder](#delete0requestbuilder) | securityIndex([PetpetidDeleteSecurityInfo.SecurityIndex](../../paths/petpetid/delete/PetpetidDeleteSecurityInfo.md#securityindex) securityIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Delete0RequestBuilder](#delete0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## DeleteRequestBuilder +public static class DeleteRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| DeleteRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Delete0RequestBuilder](#delete0requestbuilder) | pathParameters([PetpetidDeletePathParametersPetpetidDeletePathParametersMap](../../paths/petpetid/delete/PetpetidDeletePathParameters.md#petpetiddeletepathparametersmap) pathParameters)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/petpetid/PetpetidGet.md b/samples/client/petstore/java/docs/paths/petpetid/PetpetidGet.md new file mode 100644 index 00000000000..6796a4f368b --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petpetid/PetpetidGet.md @@ -0,0 +1,208 @@ +# PetpetidGet + +public class PetpetidGet + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Get](#get)
The class that has a get method to call the endpoint | +| interface | [GetPetByIdOperation](#getpetbyidoperation)
The interface that has a getPetById method to call the endpoint | +| static class | [GetRequest](#getrequest)
The final request inputs class | +| static class | [GetNullableRequest](#getnullablerequest)
The initial request inputs class | +| static class | [Get0RequestBuilder](#get0requestbuilder)
A builder for the request input class | +| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | + +## Get +public static class Get extends ApiClient.ApiClient1 implements GetOperation
+ +a class that allows one to call the endpoint using a method named get + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.petpetid.get.PetpetidGetSecurityInfo; +import org.openapijsonschematools.client.paths.petpetid.get.PetpetidGetPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.ApiKey; +import org.openapijsonschematools.client.paths.petpetid.get.responses.PetpetidGetCode200Response; +import org.openapijsonschematools.client.paths.petpetid.get.responses.PetpetidGetCode400Response; +import org.openapijsonschematools.client.paths.petpetid.get.responses.PetpetidGetCode404Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.petpetid.PetpetidGet; +import org.openapijsonschematools.client.paths.petpetid.get.PetpetidGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new ApiKey("someApiKey"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .petpetidGetSecurityRequirementObject0SecurityIndex(PetpetidGetSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +PetpetidGet.Get apiClient = new PetpetidGet.Get(apiConfiguration, schemaConfiguration); + + +// Map validation +PetpetidGetPathParameters.PetpetidGetPathParametersMap pathParameters = + PetpetidGetPathParameters.PetpetidGetPathParameters1.validate( + new PetpetidGetPathParameters.PetpetidGetPathParametersMapBuilder() + .petId(1L) + + .build(), + schemaConfiguration +); + +var request = new PetpetidGet.GetRequestBuilder() + .pathParameters(pathParameters) + .build(); + +PetpetidGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (PetpetidGetCode400Response.ResponseApiException | PetpetidGetCode404Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +PetpetidGetResponses.EndpointPetpetidGetCode200Response castResponse = (PetpetidGetResponses.EndpointPetpetidGetCode200Response) response; +if (castResponse.body instanceof PetpetidGetCode200Response.ApplicationxmlResponseBody deserializedBody) { + // handle deserialized body here +} else { + PetpetidGetCode200Response.ApplicationjsonResponseBody deserializedBody = (PetpetidGetCode200Response.ApplicationjsonResponseBody) castResponse.body; + // handle deserialized body here +} +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetpetidGetResponses.EndpointResponse](../../paths/petpetid/get/PetpetidGetResponses.md#endpointresponse) | get([GetRequest](#getrequest) request) | + +## GetPetByIdOperation +public interface GetPetByIdOperation
+ +an interface that allows one to call the endpoint using a method named getPetById by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetpetidGetResponses.EndpointResponse](../../paths/petpetid/get/PetpetidGetResponses.md#endpointresponse) | getPetById([GetRequest](#getrequest) request) | + +## GetRequest +public static class GetRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [PetpetidGetPathParameters.PetpetidGetPathParametersMap](../../paths/petpetid/get/PetpetidGetPathParameters.md#petpetidgetpathparametersmap) | pathParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| [PetpetidGetSecurityInfo.@Nullable SecurityIndex](../../paths/petpetid/get/PetpetidGetSecurityInfo.md#securityindex) | securityIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## GetNullableRequest +public static class GetNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [PetpetidGetPathParameters.@Nullable PetpetidGetPathParametersMap](../../paths/petpetid/get/PetpetidGetPathParameters.md#petpetidgetpathparametersmap) | pathParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| [PetpetidGetSecurityInfo.@Nullable SecurityIndex](../../paths/petpetid/get/PetpetidGetSecurityInfo.md#securityindex) | securityIndex | +| @Nullable Duration | timeout | + +## Get0RequestBuilder +public static class Get0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get0RequestBuilder(Get0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | +| [Get0RequestBuilder](#get0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Get0RequestBuilder](#get0requestbuilder) | securityIndex([PetpetidGetSecurityInfo.SecurityIndex](../../paths/petpetid/get/PetpetidGetSecurityInfo.md#securityindex) securityIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Get0RequestBuilder](#get0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## GetRequestBuilder +public static class GetRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| GetRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Get0RequestBuilder](#get0requestbuilder) | pathParameters([PetpetidGetPathParametersPetpetidGetPathParametersMap](../../paths/petpetid/get/PetpetidGetPathParameters.md#petpetidgetpathparametersmap) pathParameters)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/petpetid/PetpetidPost.md b/samples/client/petstore/java/docs/paths/petpetid/PetpetidPost.md new file mode 100644 index 00000000000..6e8e252f05a --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petpetid/PetpetidPost.md @@ -0,0 +1,204 @@ +# PetpetidPost + +public class PetpetidPost + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Post](#post)
The class that has a post method to call the endpoint | +| interface | [UpdatePetWithFormOperation](#updatepetwithformoperation)
The interface that has a updatePetWithForm method to call the endpoint | +| static class | [PostRequest](#postrequest)
The final request inputs class | +| static class | [PostNullableRequest](#postnullablerequest)
The initial request inputs class | +| static class | [Post0RequestBuilder](#post0requestbuilder)
A builder for the request input class | +| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | + +## Post +public static class Post extends ApiClient.ApiClient1 implements PostOperation
+ +a class that allows one to call the endpoint using a method named post + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.petpetid.post.PetpetidPostRequestBody; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.petpetid.post.PetpetidPostSecurityInfo; +import org.openapijsonschematools.client.paths.petpetid.post.PetpetidPostPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.ApiKey; +import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; +import org.openapijsonschematools.client.paths.petpetid.post.responses.PetpetidPostCode405Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.petpetid.PetpetidPost; +import org.openapijsonschematools.client.paths.petpetid.post.PetpetidPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new ApiKey("someApiKey"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .petpetidPostSecurityRequirementObject0SecurityIndex(PetpetidPostSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +PetpetidPost.Post apiClient = new PetpetidPost.Post(apiConfiguration, schemaConfiguration); + + +// Map validation +PetpetidPostPathParameters.PetpetidPostPathParametersMap pathParameters = + PetpetidPostPathParameters.PetpetidPostPathParameters1.validate( + new PetpetidPostPathParameters.PetpetidPostPathParametersMapBuilder() + .petId(1L) + + .build(), + schemaConfiguration +); + +var request = new PetpetidPost.PostRequestBuilder() + .pathParameters(pathParameters) + .build(); + +Void response; +try { + response = apiClient.post(request); +} catch (PetpetidPostCode405Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | post([PostRequest](#postrequest) request) | + +## UpdatePetWithFormOperation +public interface UpdatePetWithFormOperation
+ +an interface that allows one to call the endpoint using a method named updatePetWithForm by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | updatePetWithForm([PostRequest](#postrequest) request) | + +## PostRequest +public static class PostRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [PetpetidPostPathParameters.PetpetidPostPathParametersMap](../../paths/petpetid/post/PetpetidPostPathParameters.md#petpetidpostpathparametersmap) | pathParameters | +| [PetpetidPostRequestBody.@Nullable SealedRequestBody](../../paths/petpetid/post/PetpetidPostRequestBody.md#sealedrequestbody) | requestBody
optional | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| [PetpetidPostSecurityInfo.@Nullable SecurityIndex](../../paths/petpetid/post/PetpetidPostSecurityInfo.md#securityindex) | securityIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PostNullableRequest +public static class PostNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [PetpetidPostPathParameters.@Nullable PetpetidPostPathParametersMap](../../paths/petpetid/post/PetpetidPostPathParameters.md#petpetidpostpathparametersmap) | pathParameters | +| [PetpetidPostRequestBody.@Nullable SealedRequestBody](../../paths/petpetid/post/PetpetidPostRequestBody.md#sealedrequestbody) | requestBody | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| [PetpetidPostSecurityInfo.@Nullable SecurityIndex](../../paths/petpetid/post/PetpetidPostSecurityInfo.md#securityindex) | securityIndex | +| @Nullable Duration | timeout | + +## Post0RequestBuilder +public static class Post0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post0RequestBuilder(Post0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | +| [Post0RequestBuilder](#post0requestbuilder) | requestBody([PetpetidPostRequestBody.SealedRequestBody](../../paths/petpetid/post/PetpetidPostRequestBody.md#sealedrequestbody) requestBody)
sets the optional property | +| [Post0RequestBuilder](#post0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Post0RequestBuilder](#post0requestbuilder) | securityIndex([PetpetidPostSecurityInfo.SecurityIndex](../../paths/petpetid/post/PetpetidPostSecurityInfo.md#securityindex) securityIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Post0RequestBuilder](#post0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## PostRequestBuilder +public static class PostRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PostRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Post0RequestBuilder](#post0requestbuilder) | pathParameters([PetpetidPostPathParametersPetpetidPostPathParametersMap](../../paths/petpetid/post/PetpetidPostPathParameters.md#petpetidpostpathparametersmap) pathParameters)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/petpetid/Post.md b/samples/client/petstore/java/docs/paths/petpetid/Post.md deleted file mode 100644 index 15b4e3eff77..00000000000 --- a/samples/client/petstore/java/docs/paths/petpetid/Post.md +++ /dev/null @@ -1,193 +0,0 @@ -# Post - -public class Post - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Post1](#post1)
The class that has a post method to call the endpoint | -| static class | [PostRequest](#postrequest)
The final request inputs class | -| static class | [PostNullableRequest](#postnullablerequest)
The initial request inputs class | -| static class | [Post0RequestBuilder](#post0requestbuilder)
A builder for the request input class | -| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | - -## Post1 -public static class Post1 extends ApiClient.ApiClient1 implements PostOperation
- -a class that allows one to call the endpoint using a method named post - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.petpetid.post.RequestBody; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.petpetid.post.PetpetidPostSecurityInfo; -import org.openapijsonschematools.client.paths.petpetid.post.PathParameters; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.securityschemes.SecurityScheme; -import org.openapijsonschematools.client.components.securityschemes.ApiKey; -import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; -import org.openapijsonschematools.client.paths.petpetid.post.responses.Code405Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.petpetid.Post; -import org.openapijsonschematools.client.paths.petpetid.post.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -List securitySchemes = new ArrayList(); -securitySchemes.add( - new ApiKey("someApiKey"); -); -ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() - .petpetidPostSecurityRequirementObject0SecurityIndex(PetpetidPostSecurityRequirementObject0.SecurityIndex.SECURITY_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - securitySchemes, - securityIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Post.Post1 apiClient = new Post.Post1(apiConfiguration, schemaConfiguration); - - -// Map validation -PathParameters.PathParametersMap pathParameters = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .petId(1L) - - .build(), - schemaConfiguration -); - -var request = new PostRequestBuilder() - .pathParameters(pathParameters) - .build(); - -Void response; -try { - response = apiClient.post(request); -} catch (Code405Response.ResponseApiException e) { - // server returned an error response defined in the openapi document - throw e; -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | post([PostRequest](#postrequest) request) | - -## PostRequest -public static class PostRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [PathParameters.PathParametersMap](../../paths/petpetid/post/PathParameters.md#pathparametersmap) | pathParameters | -| [RequestBody.@Nullable SealedRequestBody](../../paths/petpetid/post/RequestBody.md#sealedrequestbody) | requestBody
optional | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| [PetpetidPostSecurityInfo.@Nullable SecurityIndex](../../paths/petpetid/post/PetpetidPostSecurityInfo.md#securityindex) | securityIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PostNullableRequest -public static class PostNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [PathParameters.@Nullable PathParametersMap](../../paths/petpetid/post/PathParameters.md#pathparametersmap) | pathParameters | -| [RequestBody.@Nullable SealedRequestBody](../../paths/petpetid/post/RequestBody.md#sealedrequestbody) | requestBody | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| [PetpetidPostSecurityInfo.@Nullable SecurityIndex](../../paths/petpetid/post/PetpetidPostSecurityInfo.md#securityindex) | securityIndex | -| @Nullable Duration | timeout | - -## Post0RequestBuilder -public static class Post0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post0RequestBuilder(Post0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | -| [Post0RequestBuilder](#post0requestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/petpetid/post/RequestBody.md#sealedrequestbody) requestBody)
sets the optional property | -| [Post0RequestBuilder](#post0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Post0RequestBuilder](#post0requestbuilder) | securityIndex([PetpetidPostSecurityInfo.SecurityIndex](../../paths/petpetid/post/PetpetidPostSecurityInfo.md#securityindex) securityIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Post0RequestBuilder](#post0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## PostRequestBuilder -public static class PostRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PostRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Post0RequestBuilder](#post0requestbuilder) | pathParameters([PathParametersPathParametersMap](../../paths/petpetid/post/PathParameters.md#pathparametersmap) pathParameters)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/petpetid/delete/HeaderParameters.md b/samples/client/petstore/java/docs/paths/petpetid/delete/HeaderParameters.md deleted file mode 100644 index cdeba72d7d8..00000000000 --- a/samples/client/petstore/java/docs/paths/petpetid/delete/HeaderParameters.md +++ /dev/null @@ -1,252 +0,0 @@ -# HeaderParameters -public class HeaderParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [HeaderParameters.HeaderParameters1Boxed](#headerparameters1boxed)
sealed interface for validated payloads | -| record | [HeaderParameters.HeaderParameters1BoxedMap](#headerparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [HeaderParameters.HeaderParameters1](#headerparameters1)
schema class | -| static class | [HeaderParameters.HeaderParametersMapBuilder](#headerparametersmapbuilder)
builder for Map payloads | -| static class | [HeaderParameters.HeaderParametersMap](#headerparametersmap)
output class for Map payloads | -| sealed interface | [HeaderParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [HeaderParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [HeaderParameters.AdditionalProperties](#additionalproperties)
schema class | - -## HeaderParameters1Boxed -public sealed interface HeaderParameters1Boxed
-permits
-[HeaderParameters1BoxedMap](#headerparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## HeaderParameters1BoxedMap -public record HeaderParameters1BoxedMap
-implements [HeaderParameters1Boxed](#headerparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| HeaderParameters1BoxedMap([HeaderParametersMap](#headerparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [HeaderParametersMap](#headerparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## HeaderParameters1 -public static class HeaderParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.petpetid.delete.HeaderParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -HeaderParameters.HeaderParametersMap validatedPayload = - HeaderParameters.HeaderParameters1.validate( - new HeaderParameters.HeaderParametersMapBuilder() - .api_key("a") - - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("api_key", [Schema0.Schema01.class](../../../paths/petpetid/delete/parameters/parameter0/Schema0.md#schema01))
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [HeaderParametersMap](#headerparametersmap) | validate([Map<?, ?>](#headerparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [HeaderParameters1BoxedMap](#headerparameters1boxedmap) | validateAndBox([Map<?, ?>](#headerparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [HeaderParameters1Boxed](#headerparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## HeaderParametersMapBuilder -public class HeaderParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| HeaderParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | -| [HeaderParametersMapBuilder](#headerparametersmapbuilder) | api_key(String value) | - -## HeaderParametersMap -public static class HeaderParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [HeaderParametersMap](#headerparametersmap) | of([Map](#headerparametersmapbuilder) arg, SchemaConfiguration configuration) | -| String | api_key()
[optional] | - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/petpetid/delete/PathParameters.md b/samples/client/petstore/java/docs/paths/petpetid/delete/PathParameters.md deleted file mode 100644 index 6b382baec6c..00000000000 --- a/samples/client/petstore/java/docs/paths/petpetid/delete/PathParameters.md +++ /dev/null @@ -1,271 +0,0 @@ -# PathParameters -public class PathParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [PathParameters.PathParameters1Boxed](#pathparameters1boxed)
sealed interface for validated payloads | -| record | [PathParameters.PathParameters1BoxedMap](#pathparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.PathParameters1](#pathparameters1)
schema class | -| static class | [PathParameters.PathParametersMapBuilder](#pathparametersmapbuilder)
builder for Map payloads | -| static class | [PathParameters.PathParametersMap](#pathparametersmap)
output class for Map payloads | -| sealed interface | [PathParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [PathParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [PathParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [PathParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [PathParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [PathParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [PathParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.AdditionalProperties](#additionalproperties)
schema class | - -## PathParameters1Boxed -public sealed interface PathParameters1Boxed
-permits
-[PathParameters1BoxedMap](#pathparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## PathParameters1BoxedMap -public record PathParameters1BoxedMap
-implements [PathParameters1Boxed](#pathparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParameters1BoxedMap([PathParametersMap](#pathparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## PathParameters1 -public static class PathParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.petpetid.delete.PathParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -PathParameters.PathParametersMap validatedPayload = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .petId(1L) - - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("petId", [Schema1.Schema11.class](../../../paths/petpetid/delete/parameters/parameter1/Schema1.md#schema11))
)
| -| Set | required = Set.of(
    "petId"
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | validate([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1BoxedMap](#pathparameters1boxedmap) | validateAndBox([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1Boxed](#pathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## PathParametersMap0Builder -public class PathParametersMap0Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | - -## PathParametersMapBuilder -public class PathParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap0Builder](#pathparametersmap0builder) | petId(int value) | -| [PathParametersMap0Builder](#pathparametersmap0builder) | petId(float value) | -| [PathParametersMap0Builder](#pathparametersmap0builder) | petId(long value) | -| [PathParametersMap0Builder](#pathparametersmap0builder) | petId(double value) | - -## PathParametersMap -public static class PathParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [PathParametersMap](#pathparametersmap) | of([Map](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| Number | petId()
| - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/petpetid/delete/PetpetidDeleteHeaderParameters.md b/samples/client/petstore/java/docs/paths/petpetid/delete/PetpetidDeleteHeaderParameters.md new file mode 100644 index 00000000000..c0851ac1cee --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petpetid/delete/PetpetidDeleteHeaderParameters.md @@ -0,0 +1,252 @@ +# PetpetidDeleteHeaderParameters +public class PetpetidDeleteHeaderParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [PetpetidDeleteHeaderParameters.PetpetidDeleteHeaderParameters1Boxed](#petpetiddeleteheaderparameters1boxed)
sealed interface for validated payloads | +| record | [PetpetidDeleteHeaderParameters.PetpetidDeleteHeaderParameters1BoxedMap](#petpetiddeleteheaderparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [PetpetidDeleteHeaderParameters.PetpetidDeleteHeaderParameters1](#petpetiddeleteheaderparameters1)
schema class | +| static class | [PetpetidDeleteHeaderParameters.PetpetidDeleteHeaderParametersMapBuilder](#petpetiddeleteheaderparametersmapbuilder)
builder for Map payloads | +| static class | [PetpetidDeleteHeaderParameters.PetpetidDeleteHeaderParametersMap](#petpetiddeleteheaderparametersmap)
output class for Map payloads | +| sealed interface | [PetpetidDeleteHeaderParameters.PetpetidDeleteadditionalPropertiesBoxed](#petpetiddeleteadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [PetpetidDeleteHeaderParameters.PetpetidDeleteadditionalPropertiesBoxedVoid](#petpetiddeleteadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [PetpetidDeleteHeaderParameters.PetpetidDeleteadditionalPropertiesBoxedBoolean](#petpetiddeleteadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [PetpetidDeleteHeaderParameters.PetpetidDeleteadditionalPropertiesBoxedNumber](#petpetiddeleteadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [PetpetidDeleteHeaderParameters.PetpetidDeleteadditionalPropertiesBoxedString](#petpetiddeleteadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [PetpetidDeleteHeaderParameters.PetpetidDeleteadditionalPropertiesBoxedList](#petpetiddeleteadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [PetpetidDeleteHeaderParameters.PetpetidDeleteadditionalPropertiesBoxedMap](#petpetiddeleteadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [PetpetidDeleteHeaderParameters.PetpetidDeleteadditionalProperties](#petpetiddeleteadditionalproperties)
schema class | + +## PetpetidDeleteHeaderParameters1Boxed +public sealed interface PetpetidDeleteHeaderParameters1Boxed
+permits
+[PetpetidDeleteHeaderParameters1BoxedMap](#petpetiddeleteheaderparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## PetpetidDeleteHeaderParameters1BoxedMap +public record PetpetidDeleteHeaderParameters1BoxedMap
+implements [PetpetidDeleteHeaderParameters1Boxed](#petpetiddeleteheaderparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidDeleteHeaderParameters1BoxedMap([PetpetidDeleteHeaderParametersMap](#petpetiddeleteheaderparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetpetidDeleteHeaderParametersMap](#petpetiddeleteheaderparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetidDeleteHeaderParameters1 +public static class PetpetidDeleteHeaderParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.petpetid.delete.PetpetidDeleteHeaderParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +PetpetidDeleteHeaderParameters.PetpetidDeleteHeaderParametersMap validatedPayload = + PetpetidDeleteHeaderParameters.PetpetidDeleteHeaderParameters1.validate( + new PetpetidDeleteHeaderParameters.PetpetidDeleteHeaderParametersMapBuilder() + .api_key("a") + + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("api_key", [Schema0.Schema01.class](../../../paths/petpetid/delete/parameters/parameter0/Schema0.md#schema01))
)
| +| Class | additionalProperties = [PetpetidDeleteadditionalProperties.class](#petpetiddeleteadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetpetidDeleteHeaderParametersMap](#petpetiddeleteheaderparametersmap) | validate([Map<?, ?>](#petpetiddeleteheaderparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [PetpetidDeleteHeaderParameters1BoxedMap](#petpetiddeleteheaderparameters1boxedmap) | validateAndBox([Map<?, ?>](#petpetiddeleteheaderparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [PetpetidDeleteHeaderParameters1Boxed](#petpetiddeleteheaderparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## PetpetidDeleteHeaderParametersMapBuilder +public class PetpetidDeleteHeaderParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidDeleteHeaderParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | +| [PetpetidDeleteHeaderParametersMapBuilder](#petpetiddeleteheaderparametersmapbuilder) | api_key(String value) | + +## PetpetidDeleteHeaderParametersMap +public static class PetpetidDeleteHeaderParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [PetpetidDeleteHeaderParametersMap](#petpetiddeleteheaderparametersmap) | of([Map](#petpetiddeleteheaderparametersmapbuilder) arg, SchemaConfiguration configuration) | +| String | api_key()
[optional] | + +## PetpetidDeleteadditionalPropertiesBoxed +public sealed interface PetpetidDeleteadditionalPropertiesBoxed
+permits
+[PetpetidDeleteadditionalPropertiesBoxedVoid](#petpetiddeleteadditionalpropertiesboxedvoid), +[PetpetidDeleteadditionalPropertiesBoxedBoolean](#petpetiddeleteadditionalpropertiesboxedboolean), +[PetpetidDeleteadditionalPropertiesBoxedNumber](#petpetiddeleteadditionalpropertiesboxednumber), +[PetpetidDeleteadditionalPropertiesBoxedString](#petpetiddeleteadditionalpropertiesboxedstring), +[PetpetidDeleteadditionalPropertiesBoxedList](#petpetiddeleteadditionalpropertiesboxedlist), +[PetpetidDeleteadditionalPropertiesBoxedMap](#petpetiddeleteadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## PetpetidDeleteadditionalPropertiesBoxedVoid +public record PetpetidDeleteadditionalPropertiesBoxedVoid
+implements [PetpetidDeleteadditionalPropertiesBoxed](#petpetiddeleteadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidDeleteadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetidDeleteadditionalPropertiesBoxedBoolean +public record PetpetidDeleteadditionalPropertiesBoxedBoolean
+implements [PetpetidDeleteadditionalPropertiesBoxed](#petpetiddeleteadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidDeleteadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetidDeleteadditionalPropertiesBoxedNumber +public record PetpetidDeleteadditionalPropertiesBoxedNumber
+implements [PetpetidDeleteadditionalPropertiesBoxed](#petpetiddeleteadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidDeleteadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetidDeleteadditionalPropertiesBoxedString +public record PetpetidDeleteadditionalPropertiesBoxedString
+implements [PetpetidDeleteadditionalPropertiesBoxed](#petpetiddeleteadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidDeleteadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetidDeleteadditionalPropertiesBoxedList +public record PetpetidDeleteadditionalPropertiesBoxedList
+implements [PetpetidDeleteadditionalPropertiesBoxed](#petpetiddeleteadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidDeleteadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetidDeleteadditionalPropertiesBoxedMap +public record PetpetidDeleteadditionalPropertiesBoxedMap
+implements [PetpetidDeleteadditionalPropertiesBoxed](#petpetiddeleteadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidDeleteadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetidDeleteadditionalProperties +public static class PetpetidDeleteadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/petpetid/delete/PetpetidDeletePathParameters.md b/samples/client/petstore/java/docs/paths/petpetid/delete/PetpetidDeletePathParameters.md new file mode 100644 index 00000000000..27a84ab6be8 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petpetid/delete/PetpetidDeletePathParameters.md @@ -0,0 +1,271 @@ +# PetpetidDeletePathParameters +public class PetpetidDeletePathParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [PetpetidDeletePathParameters.PetpetidDeletePathParameters1Boxed](#petpetiddeletepathparameters1boxed)
sealed interface for validated payloads | +| record | [PetpetidDeletePathParameters.PetpetidDeletePathParameters1BoxedMap](#petpetiddeletepathparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [PetpetidDeletePathParameters.PetpetidDeletePathParameters1](#petpetiddeletepathparameters1)
schema class | +| static class | [PetpetidDeletePathParameters.PetpetidDeletePathParametersMapBuilder](#petpetiddeletepathparametersmapbuilder)
builder for Map payloads | +| static class | [PetpetidDeletePathParameters.PetpetidDeletePathParametersMap](#petpetiddeletepathparametersmap)
output class for Map payloads | +| sealed interface | [PetpetidDeletePathParameters.PetpetidDeleteadditionalPropertiesBoxed](#petpetiddeleteadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [PetpetidDeletePathParameters.PetpetidDeleteadditionalPropertiesBoxedVoid](#petpetiddeleteadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [PetpetidDeletePathParameters.PetpetidDeleteadditionalPropertiesBoxedBoolean](#petpetiddeleteadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [PetpetidDeletePathParameters.PetpetidDeleteadditionalPropertiesBoxedNumber](#petpetiddeleteadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [PetpetidDeletePathParameters.PetpetidDeleteadditionalPropertiesBoxedString](#petpetiddeleteadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [PetpetidDeletePathParameters.PetpetidDeleteadditionalPropertiesBoxedList](#petpetiddeleteadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [PetpetidDeletePathParameters.PetpetidDeleteadditionalPropertiesBoxedMap](#petpetiddeleteadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [PetpetidDeletePathParameters.PetpetidDeleteadditionalProperties](#petpetiddeleteadditionalproperties)
schema class | + +## PetpetidDeletePathParameters1Boxed +public sealed interface PetpetidDeletePathParameters1Boxed
+permits
+[PetpetidDeletePathParameters1BoxedMap](#petpetiddeletepathparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## PetpetidDeletePathParameters1BoxedMap +public record PetpetidDeletePathParameters1BoxedMap
+implements [PetpetidDeletePathParameters1Boxed](#petpetiddeletepathparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidDeletePathParameters1BoxedMap([PetpetidDeletePathParametersMap](#petpetiddeletepathparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetpetidDeletePathParametersMap](#petpetiddeletepathparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetidDeletePathParameters1 +public static class PetpetidDeletePathParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.petpetid.delete.PetpetidDeletePathParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +PetpetidDeletePathParameters.PetpetidDeletePathParametersMap validatedPayload = + PetpetidDeletePathParameters.PetpetidDeletePathParameters1.validate( + new PetpetidDeletePathParameters.PetpetidDeletePathParametersMapBuilder() + .petId(1L) + + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("petId", [Schema1.Schema11.class](../../../paths/petpetid/delete/parameters/parameter1/Schema1.md#schema11))
)
| +| Set | required = Set.of(
    "petId"
)
| +| Class | additionalProperties = [PetpetidDeleteadditionalProperties.class](#petpetiddeleteadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetpetidDeletePathParametersMap](#petpetiddeletepathparametersmap) | validate([Map<?, ?>](#petpetiddeletepathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [PetpetidDeletePathParameters1BoxedMap](#petpetiddeletepathparameters1boxedmap) | validateAndBox([Map<?, ?>](#petpetiddeletepathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [PetpetidDeletePathParameters1Boxed](#petpetiddeletepathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## PetpetidDeletePathParametersMap0Builder +public class PetpetidDeletePathParametersMap0Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidDeletePathParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | + +## PetpetidDeletePathParametersMapBuilder +public class PetpetidDeletePathParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidDeletePathParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetpetidDeletePathParametersMap0Builder](#petpetiddeletepathparametersmap0builder) | petId(int value) | +| [PetpetidDeletePathParametersMap0Builder](#petpetiddeletepathparametersmap0builder) | petId(float value) | +| [PetpetidDeletePathParametersMap0Builder](#petpetiddeletepathparametersmap0builder) | petId(long value) | +| [PetpetidDeletePathParametersMap0Builder](#petpetiddeletepathparametersmap0builder) | petId(double value) | + +## PetpetidDeletePathParametersMap +public static class PetpetidDeletePathParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [PetpetidDeletePathParametersMap](#petpetiddeletepathparametersmap) | of([Map](#petpetiddeletepathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| Number | petId()
| + +## PetpetidDeleteadditionalPropertiesBoxed +public sealed interface PetpetidDeleteadditionalPropertiesBoxed
+permits
+[PetpetidDeleteadditionalPropertiesBoxedVoid](#petpetiddeleteadditionalpropertiesboxedvoid), +[PetpetidDeleteadditionalPropertiesBoxedBoolean](#petpetiddeleteadditionalpropertiesboxedboolean), +[PetpetidDeleteadditionalPropertiesBoxedNumber](#petpetiddeleteadditionalpropertiesboxednumber), +[PetpetidDeleteadditionalPropertiesBoxedString](#petpetiddeleteadditionalpropertiesboxedstring), +[PetpetidDeleteadditionalPropertiesBoxedList](#petpetiddeleteadditionalpropertiesboxedlist), +[PetpetidDeleteadditionalPropertiesBoxedMap](#petpetiddeleteadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## PetpetidDeleteadditionalPropertiesBoxedVoid +public record PetpetidDeleteadditionalPropertiesBoxedVoid
+implements [PetpetidDeleteadditionalPropertiesBoxed](#petpetiddeleteadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidDeleteadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetidDeleteadditionalPropertiesBoxedBoolean +public record PetpetidDeleteadditionalPropertiesBoxedBoolean
+implements [PetpetidDeleteadditionalPropertiesBoxed](#petpetiddeleteadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidDeleteadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetidDeleteadditionalPropertiesBoxedNumber +public record PetpetidDeleteadditionalPropertiesBoxedNumber
+implements [PetpetidDeleteadditionalPropertiesBoxed](#petpetiddeleteadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidDeleteadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetidDeleteadditionalPropertiesBoxedString +public record PetpetidDeleteadditionalPropertiesBoxedString
+implements [PetpetidDeleteadditionalPropertiesBoxed](#petpetiddeleteadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidDeleteadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetidDeleteadditionalPropertiesBoxedList +public record PetpetidDeleteadditionalPropertiesBoxedList
+implements [PetpetidDeleteadditionalPropertiesBoxed](#petpetiddeleteadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidDeleteadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetidDeleteadditionalPropertiesBoxedMap +public record PetpetidDeleteadditionalPropertiesBoxedMap
+implements [PetpetidDeleteadditionalPropertiesBoxed](#petpetiddeleteadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidDeleteadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetidDeleteadditionalProperties +public static class PetpetidDeleteadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/petpetid/delete/PetpetidDeleteResponses.md b/samples/client/petstore/java/docs/paths/petpetid/delete/PetpetidDeleteResponses.md new file mode 100644 index 00000000000..393d3ca7126 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petpetid/delete/PetpetidDeleteResponses.md @@ -0,0 +1,10 @@ +# PetpetidDeleteResponses + +public class PetpetidDeleteResponses + +A class that contains necessary responses classes + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | + diff --git a/samples/client/petstore/java/docs/paths/petpetid/delete/Responses.md b/samples/client/petstore/java/docs/paths/petpetid/delete/Responses.md deleted file mode 100644 index 5841efd5c37..00000000000 --- a/samples/client/petstore/java/docs/paths/petpetid/delete/Responses.md +++ /dev/null @@ -1,10 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | - diff --git a/samples/client/petstore/java/docs/paths/petpetid/delete/responses/Code400Response.md b/samples/client/petstore/java/docs/paths/petpetid/delete/responses/Code400Response.md deleted file mode 100644 index 6f3af2df6d2..00000000000 --- a/samples/client/petstore/java/docs/paths/petpetid/delete/responses/Code400Response.md +++ /dev/null @@ -1,32 +0,0 @@ -# Code400Response - -public class Code400Response - -A class that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code400Response.Code400Response1](#code400response1)
class that deserializes responses | - -## Code400Response1 -public static class Code400Response1
-extends ResponseDeserializer - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code400Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = MapUtils.makeMap(
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/petpetid/delete/responses/PetpetidDeleteCode400Response.md b/samples/client/petstore/java/docs/paths/petpetid/delete/responses/PetpetidDeleteCode400Response.md new file mode 100644 index 00000000000..0f2dd979eaa --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petpetid/delete/responses/PetpetidDeleteCode400Response.md @@ -0,0 +1,32 @@ +# PetpetidDeleteCode400Response + +public class PetpetidDeleteCode400Response + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [PetpetidDeleteCode400Response.PetpetidDeleteCode400Response1](#petpetiddeletecode400response1)
class that deserializes responses | + +## PetpetidDeleteCode400Response1 +public static class PetpetidDeleteCode400Response1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidDeleteCode400Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/petpetid/get/PathParameters.md b/samples/client/petstore/java/docs/paths/petpetid/get/PathParameters.md deleted file mode 100644 index 6a08b235aa2..00000000000 --- a/samples/client/petstore/java/docs/paths/petpetid/get/PathParameters.md +++ /dev/null @@ -1,271 +0,0 @@ -# PathParameters -public class PathParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [PathParameters.PathParameters1Boxed](#pathparameters1boxed)
sealed interface for validated payloads | -| record | [PathParameters.PathParameters1BoxedMap](#pathparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.PathParameters1](#pathparameters1)
schema class | -| static class | [PathParameters.PathParametersMapBuilder](#pathparametersmapbuilder)
builder for Map payloads | -| static class | [PathParameters.PathParametersMap](#pathparametersmap)
output class for Map payloads | -| sealed interface | [PathParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [PathParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [PathParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [PathParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [PathParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [PathParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [PathParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.AdditionalProperties](#additionalproperties)
schema class | - -## PathParameters1Boxed -public sealed interface PathParameters1Boxed
-permits
-[PathParameters1BoxedMap](#pathparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## PathParameters1BoxedMap -public record PathParameters1BoxedMap
-implements [PathParameters1Boxed](#pathparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParameters1BoxedMap([PathParametersMap](#pathparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## PathParameters1 -public static class PathParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.petpetid.get.PathParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -PathParameters.PathParametersMap validatedPayload = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .petId(1L) - - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("petId", [Schema0.Schema01.class](../../../paths/petpetid/get/parameters/parameter0/Schema0.md#schema01))
)
| -| Set | required = Set.of(
    "petId"
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | validate([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1BoxedMap](#pathparameters1boxedmap) | validateAndBox([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1Boxed](#pathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## PathParametersMap0Builder -public class PathParametersMap0Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | - -## PathParametersMapBuilder -public class PathParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap0Builder](#pathparametersmap0builder) | petId(int value) | -| [PathParametersMap0Builder](#pathparametersmap0builder) | petId(float value) | -| [PathParametersMap0Builder](#pathparametersmap0builder) | petId(long value) | -| [PathParametersMap0Builder](#pathparametersmap0builder) | petId(double value) | - -## PathParametersMap -public static class PathParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [PathParametersMap](#pathparametersmap) | of([Map](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| Number | petId()
| - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/petpetid/get/PetpetidGetPathParameters.md b/samples/client/petstore/java/docs/paths/petpetid/get/PetpetidGetPathParameters.md new file mode 100644 index 00000000000..2ebb0a90120 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petpetid/get/PetpetidGetPathParameters.md @@ -0,0 +1,271 @@ +# PetpetidGetPathParameters +public class PetpetidGetPathParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [PetpetidGetPathParameters.PetpetidGetPathParameters1Boxed](#petpetidgetpathparameters1boxed)
sealed interface for validated payloads | +| record | [PetpetidGetPathParameters.PetpetidGetPathParameters1BoxedMap](#petpetidgetpathparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [PetpetidGetPathParameters.PetpetidGetPathParameters1](#petpetidgetpathparameters1)
schema class | +| static class | [PetpetidGetPathParameters.PetpetidGetPathParametersMapBuilder](#petpetidgetpathparametersmapbuilder)
builder for Map payloads | +| static class | [PetpetidGetPathParameters.PetpetidGetPathParametersMap](#petpetidgetpathparametersmap)
output class for Map payloads | +| sealed interface | [PetpetidGetPathParameters.PetpetidGetadditionalPropertiesBoxed](#petpetidgetadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [PetpetidGetPathParameters.PetpetidGetadditionalPropertiesBoxedVoid](#petpetidgetadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [PetpetidGetPathParameters.PetpetidGetadditionalPropertiesBoxedBoolean](#petpetidgetadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [PetpetidGetPathParameters.PetpetidGetadditionalPropertiesBoxedNumber](#petpetidgetadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [PetpetidGetPathParameters.PetpetidGetadditionalPropertiesBoxedString](#petpetidgetadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [PetpetidGetPathParameters.PetpetidGetadditionalPropertiesBoxedList](#petpetidgetadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [PetpetidGetPathParameters.PetpetidGetadditionalPropertiesBoxedMap](#petpetidgetadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [PetpetidGetPathParameters.PetpetidGetadditionalProperties](#petpetidgetadditionalproperties)
schema class | + +## PetpetidGetPathParameters1Boxed +public sealed interface PetpetidGetPathParameters1Boxed
+permits
+[PetpetidGetPathParameters1BoxedMap](#petpetidgetpathparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## PetpetidGetPathParameters1BoxedMap +public record PetpetidGetPathParameters1BoxedMap
+implements [PetpetidGetPathParameters1Boxed](#petpetidgetpathparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidGetPathParameters1BoxedMap([PetpetidGetPathParametersMap](#petpetidgetpathparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetpetidGetPathParametersMap](#petpetidgetpathparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetidGetPathParameters1 +public static class PetpetidGetPathParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.petpetid.get.PetpetidGetPathParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +PetpetidGetPathParameters.PetpetidGetPathParametersMap validatedPayload = + PetpetidGetPathParameters.PetpetidGetPathParameters1.validate( + new PetpetidGetPathParameters.PetpetidGetPathParametersMapBuilder() + .petId(1L) + + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("petId", [Schema0.Schema01.class](../../../paths/petpetid/get/parameters/parameter0/Schema0.md#schema01))
)
| +| Set | required = Set.of(
    "petId"
)
| +| Class | additionalProperties = [PetpetidGetadditionalProperties.class](#petpetidgetadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetpetidGetPathParametersMap](#petpetidgetpathparametersmap) | validate([Map<?, ?>](#petpetidgetpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [PetpetidGetPathParameters1BoxedMap](#petpetidgetpathparameters1boxedmap) | validateAndBox([Map<?, ?>](#petpetidgetpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [PetpetidGetPathParameters1Boxed](#petpetidgetpathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## PetpetidGetPathParametersMap0Builder +public class PetpetidGetPathParametersMap0Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidGetPathParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | + +## PetpetidGetPathParametersMapBuilder +public class PetpetidGetPathParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidGetPathParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetpetidGetPathParametersMap0Builder](#petpetidgetpathparametersmap0builder) | petId(int value) | +| [PetpetidGetPathParametersMap0Builder](#petpetidgetpathparametersmap0builder) | petId(float value) | +| [PetpetidGetPathParametersMap0Builder](#petpetidgetpathparametersmap0builder) | petId(long value) | +| [PetpetidGetPathParametersMap0Builder](#petpetidgetpathparametersmap0builder) | petId(double value) | + +## PetpetidGetPathParametersMap +public static class PetpetidGetPathParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [PetpetidGetPathParametersMap](#petpetidgetpathparametersmap) | of([Map](#petpetidgetpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| Number | petId()
| + +## PetpetidGetadditionalPropertiesBoxed +public sealed interface PetpetidGetadditionalPropertiesBoxed
+permits
+[PetpetidGetadditionalPropertiesBoxedVoid](#petpetidgetadditionalpropertiesboxedvoid), +[PetpetidGetadditionalPropertiesBoxedBoolean](#petpetidgetadditionalpropertiesboxedboolean), +[PetpetidGetadditionalPropertiesBoxedNumber](#petpetidgetadditionalpropertiesboxednumber), +[PetpetidGetadditionalPropertiesBoxedString](#petpetidgetadditionalpropertiesboxedstring), +[PetpetidGetadditionalPropertiesBoxedList](#petpetidgetadditionalpropertiesboxedlist), +[PetpetidGetadditionalPropertiesBoxedMap](#petpetidgetadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## PetpetidGetadditionalPropertiesBoxedVoid +public record PetpetidGetadditionalPropertiesBoxedVoid
+implements [PetpetidGetadditionalPropertiesBoxed](#petpetidgetadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidGetadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetidGetadditionalPropertiesBoxedBoolean +public record PetpetidGetadditionalPropertiesBoxedBoolean
+implements [PetpetidGetadditionalPropertiesBoxed](#petpetidgetadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidGetadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetidGetadditionalPropertiesBoxedNumber +public record PetpetidGetadditionalPropertiesBoxedNumber
+implements [PetpetidGetadditionalPropertiesBoxed](#petpetidgetadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidGetadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetidGetadditionalPropertiesBoxedString +public record PetpetidGetadditionalPropertiesBoxedString
+implements [PetpetidGetadditionalPropertiesBoxed](#petpetidgetadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidGetadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetidGetadditionalPropertiesBoxedList +public record PetpetidGetadditionalPropertiesBoxedList
+implements [PetpetidGetadditionalPropertiesBoxed](#petpetidgetadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidGetadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetidGetadditionalPropertiesBoxedMap +public record PetpetidGetadditionalPropertiesBoxedMap
+implements [PetpetidGetadditionalPropertiesBoxed](#petpetidgetadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidGetadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetidGetadditionalProperties +public static class PetpetidGetadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/petpetid/get/PetpetidGetResponses.md b/samples/client/petstore/java/docs/paths/petpetid/get/PetpetidGetResponses.md new file mode 100644 index 00000000000..12cc6f49fef --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petpetid/get/PetpetidGetResponses.md @@ -0,0 +1,29 @@ +# PetpetidGetResponses + +public class PetpetidGetResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointPetpetidGetCode200Response](#endpointpetpetidgetcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointPetpetidGetCode200Response](#endpointpetpetidgetcode200response) + +a sealed interface that stores endpoint responses + +## EndpointPetpetidGetCode200Response +public record EndpointPetpetidGetCode200Response( + HttpResponse response, + [PetpetidGetCode200Response.SealedResponseBody](../../../paths/petpetid/get/responses/PetpetidGetCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/petpetid/get/Responses.md b/samples/client/petstore/java/docs/paths/petpetid/get/Responses.md deleted file mode 100644 index 2ddc5a84085..00000000000 --- a/samples/client/petstore/java/docs/paths/petpetid/get/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/petpetid/get/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/petpetid/get/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/petpetid/get/responses/Code200Response.md deleted file mode 100644 index 933410bb71e..00000000000 --- a/samples/client/petstore/java/docs/paths/petpetid/get/responses/Code200Response.md +++ /dev/null @@ -1,123 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationxmlMediaType](#applicationxmlmediatype)
record storing schema + encoding for a specific contentType | -| record | [Code200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationxmlResponseBody](#applicationxmlresponsebody)
implements sealed interface to store response body | -| record | [Code200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationxmlMediaType](#applicationxmlmediatype), -[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationxmlMediaType -public record ApplicationxmlMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationxmlSchema.ApplicationxmlSchema1](../../../../paths/petpetid/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md#applicationxmlschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationxmlMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationxmlSchema.ApplicationxmlSchema1](../../../../paths/petpetid/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md#applicationxmlschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/petpetid/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/petpetid/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationxmlResponseBody](#applicationxmlresponsebody), -[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationxmlResponseBody -public record ApplicationxmlResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/xml" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationxmlResponseBody(ApplicationxmlSchema.[Pet1Boxed](../../../../components/schemas/Pet.md#pet1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationxmlSchema.[Pet1Boxed](../../../../components/schemas/Pet.md#pet1boxed) | body()
returns the body passed in in the constructor | -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.[Pet1Boxed](../../../../components/schemas/Pet.md#pet1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.[Pet1Boxed](../../../../components/schemas/Pet.md#pet1boxed) | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/xml", new [ApplicationxmlMediaType](#applicationxmlmediatype)()),
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/petpetid/get/responses/Code400Response.md b/samples/client/petstore/java/docs/paths/petpetid/get/responses/Code400Response.md deleted file mode 100644 index 6f3af2df6d2..00000000000 --- a/samples/client/petstore/java/docs/paths/petpetid/get/responses/Code400Response.md +++ /dev/null @@ -1,32 +0,0 @@ -# Code400Response - -public class Code400Response - -A class that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code400Response.Code400Response1](#code400response1)
class that deserializes responses | - -## Code400Response1 -public static class Code400Response1
-extends ResponseDeserializer - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code400Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = MapUtils.makeMap(
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/petpetid/get/responses/Code404Response.md b/samples/client/petstore/java/docs/paths/petpetid/get/responses/Code404Response.md deleted file mode 100644 index ee00cd369a7..00000000000 --- a/samples/client/petstore/java/docs/paths/petpetid/get/responses/Code404Response.md +++ /dev/null @@ -1,32 +0,0 @@ -# Code404Response - -public class Code404Response - -A class that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code404Response.Code404Response1](#code404response1)
class that deserializes responses | - -## Code404Response1 -public static class Code404Response1
-extends ResponseDeserializer - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code404Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = MapUtils.makeMap(
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/petpetid/get/responses/PetpetidGetCode200Response.md b/samples/client/petstore/java/docs/paths/petpetid/get/responses/PetpetidGetCode200Response.md new file mode 100644 index 00000000000..45e02b46ba7 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petpetid/get/responses/PetpetidGetCode200Response.md @@ -0,0 +1,123 @@ +# PetpetidGetCode200Response + +public class PetpetidGetCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [PetpetidGetCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [PetpetidGetCode200Response.ApplicationxmlMediaType](#applicationxmlmediatype)
record storing schema + encoding for a specific contentType | +| record | [PetpetidGetCode200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [PetpetidGetCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [PetpetidGetCode200Response.ApplicationxmlResponseBody](#applicationxmlresponsebody)
implements sealed interface to store response body | +| record | [PetpetidGetCode200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [PetpetidGetCode200Response.PetpetidGetCode200Response1](#petpetidgetcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationxmlMediaType](#applicationxmlmediatype), +[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationxmlMediaType +public record ApplicationxmlMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationxmlSchema.ApplicationxmlSchema1](../../../../paths/petpetid/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md#applicationxmlschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationxmlMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationxmlSchema.ApplicationxmlSchema1](../../../../paths/petpetid/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md#applicationxmlschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/petpetid/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/petpetid/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationxmlResponseBody](#applicationxmlresponsebody), +[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationxmlResponseBody +public record ApplicationxmlResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/xml" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationxmlResponseBody(ApplicationxmlSchema.[Pet1Boxed](../../../../components/schemas/Pet.md#pet1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationxmlSchema.[Pet1Boxed](../../../../components/schemas/Pet.md#pet1boxed) | body()
returns the body passed in in the constructor | +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.[Pet1Boxed](../../../../components/schemas/Pet.md#pet1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.[Pet1Boxed](../../../../components/schemas/Pet.md#pet1boxed) | body()
returns the body passed in in the constructor | + +## PetpetidGetCode200Response1 +public static class PetpetidGetCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidGetCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/xml", new [ApplicationxmlMediaType](#applicationxmlmediatype)()),
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/petpetid/get/responses/PetpetidGetCode400Response.md b/samples/client/petstore/java/docs/paths/petpetid/get/responses/PetpetidGetCode400Response.md new file mode 100644 index 00000000000..34f0d6ab74e --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petpetid/get/responses/PetpetidGetCode400Response.md @@ -0,0 +1,32 @@ +# PetpetidGetCode400Response + +public class PetpetidGetCode400Response + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [PetpetidGetCode400Response.PetpetidGetCode400Response1](#petpetidgetcode400response1)
class that deserializes responses | + +## PetpetidGetCode400Response1 +public static class PetpetidGetCode400Response1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidGetCode400Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/petpetid/get/responses/PetpetidGetCode404Response.md b/samples/client/petstore/java/docs/paths/petpetid/get/responses/PetpetidGetCode404Response.md new file mode 100644 index 00000000000..c1e0bfd8b7e --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petpetid/get/responses/PetpetidGetCode404Response.md @@ -0,0 +1,32 @@ +# PetpetidGetCode404Response + +public class PetpetidGetCode404Response + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [PetpetidGetCode404Response.PetpetidGetCode404Response1](#petpetidgetcode404response1)
class that deserializes responses | + +## PetpetidGetCode404Response1 +public static class PetpetidGetCode404Response1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidGetCode404Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/petpetid/post/PathParameters.md b/samples/client/petstore/java/docs/paths/petpetid/post/PathParameters.md deleted file mode 100644 index 5566ecf62a9..00000000000 --- a/samples/client/petstore/java/docs/paths/petpetid/post/PathParameters.md +++ /dev/null @@ -1,271 +0,0 @@ -# PathParameters -public class PathParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [PathParameters.PathParameters1Boxed](#pathparameters1boxed)
sealed interface for validated payloads | -| record | [PathParameters.PathParameters1BoxedMap](#pathparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.PathParameters1](#pathparameters1)
schema class | -| static class | [PathParameters.PathParametersMapBuilder](#pathparametersmapbuilder)
builder for Map payloads | -| static class | [PathParameters.PathParametersMap](#pathparametersmap)
output class for Map payloads | -| sealed interface | [PathParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [PathParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [PathParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [PathParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [PathParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [PathParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [PathParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.AdditionalProperties](#additionalproperties)
schema class | - -## PathParameters1Boxed -public sealed interface PathParameters1Boxed
-permits
-[PathParameters1BoxedMap](#pathparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## PathParameters1BoxedMap -public record PathParameters1BoxedMap
-implements [PathParameters1Boxed](#pathparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParameters1BoxedMap([PathParametersMap](#pathparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## PathParameters1 -public static class PathParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.petpetid.post.PathParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -PathParameters.PathParametersMap validatedPayload = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .petId(1L) - - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("petId", [Schema0.Schema01.class](../../../paths/petpetid/post/parameters/parameter0/Schema0.md#schema01))
)
| -| Set | required = Set.of(
    "petId"
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | validate([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1BoxedMap](#pathparameters1boxedmap) | validateAndBox([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1Boxed](#pathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## PathParametersMap0Builder -public class PathParametersMap0Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | - -## PathParametersMapBuilder -public class PathParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap0Builder](#pathparametersmap0builder) | petId(int value) | -| [PathParametersMap0Builder](#pathparametersmap0builder) | petId(float value) | -| [PathParametersMap0Builder](#pathparametersmap0builder) | petId(long value) | -| [PathParametersMap0Builder](#pathparametersmap0builder) | petId(double value) | - -## PathParametersMap -public static class PathParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [PathParametersMap](#pathparametersmap) | of([Map](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| Number | petId()
| - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/petpetid/post/PetpetidPostPathParameters.md b/samples/client/petstore/java/docs/paths/petpetid/post/PetpetidPostPathParameters.md new file mode 100644 index 00000000000..91e891fb65d --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petpetid/post/PetpetidPostPathParameters.md @@ -0,0 +1,271 @@ +# PetpetidPostPathParameters +public class PetpetidPostPathParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [PetpetidPostPathParameters.PetpetidPostPathParameters1Boxed](#petpetidpostpathparameters1boxed)
sealed interface for validated payloads | +| record | [PetpetidPostPathParameters.PetpetidPostPathParameters1BoxedMap](#petpetidpostpathparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [PetpetidPostPathParameters.PetpetidPostPathParameters1](#petpetidpostpathparameters1)
schema class | +| static class | [PetpetidPostPathParameters.PetpetidPostPathParametersMapBuilder](#petpetidpostpathparametersmapbuilder)
builder for Map payloads | +| static class | [PetpetidPostPathParameters.PetpetidPostPathParametersMap](#petpetidpostpathparametersmap)
output class for Map payloads | +| sealed interface | [PetpetidPostPathParameters.PetpetidPostadditionalPropertiesBoxed](#petpetidpostadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [PetpetidPostPathParameters.PetpetidPostadditionalPropertiesBoxedVoid](#petpetidpostadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [PetpetidPostPathParameters.PetpetidPostadditionalPropertiesBoxedBoolean](#petpetidpostadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [PetpetidPostPathParameters.PetpetidPostadditionalPropertiesBoxedNumber](#petpetidpostadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [PetpetidPostPathParameters.PetpetidPostadditionalPropertiesBoxedString](#petpetidpostadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [PetpetidPostPathParameters.PetpetidPostadditionalPropertiesBoxedList](#petpetidpostadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [PetpetidPostPathParameters.PetpetidPostadditionalPropertiesBoxedMap](#petpetidpostadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [PetpetidPostPathParameters.PetpetidPostadditionalProperties](#petpetidpostadditionalproperties)
schema class | + +## PetpetidPostPathParameters1Boxed +public sealed interface PetpetidPostPathParameters1Boxed
+permits
+[PetpetidPostPathParameters1BoxedMap](#petpetidpostpathparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## PetpetidPostPathParameters1BoxedMap +public record PetpetidPostPathParameters1BoxedMap
+implements [PetpetidPostPathParameters1Boxed](#petpetidpostpathparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidPostPathParameters1BoxedMap([PetpetidPostPathParametersMap](#petpetidpostpathparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetpetidPostPathParametersMap](#petpetidpostpathparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetidPostPathParameters1 +public static class PetpetidPostPathParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.petpetid.post.PetpetidPostPathParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +PetpetidPostPathParameters.PetpetidPostPathParametersMap validatedPayload = + PetpetidPostPathParameters.PetpetidPostPathParameters1.validate( + new PetpetidPostPathParameters.PetpetidPostPathParametersMapBuilder() + .petId(1L) + + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("petId", [Schema0.Schema01.class](../../../paths/petpetid/post/parameters/parameter0/Schema0.md#schema01))
)
| +| Set | required = Set.of(
    "petId"
)
| +| Class | additionalProperties = [PetpetidPostadditionalProperties.class](#petpetidpostadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetpetidPostPathParametersMap](#petpetidpostpathparametersmap) | validate([Map<?, ?>](#petpetidpostpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [PetpetidPostPathParameters1BoxedMap](#petpetidpostpathparameters1boxedmap) | validateAndBox([Map<?, ?>](#petpetidpostpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [PetpetidPostPathParameters1Boxed](#petpetidpostpathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## PetpetidPostPathParametersMap0Builder +public class PetpetidPostPathParametersMap0Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidPostPathParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | + +## PetpetidPostPathParametersMapBuilder +public class PetpetidPostPathParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidPostPathParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetpetidPostPathParametersMap0Builder](#petpetidpostpathparametersmap0builder) | petId(int value) | +| [PetpetidPostPathParametersMap0Builder](#petpetidpostpathparametersmap0builder) | petId(float value) | +| [PetpetidPostPathParametersMap0Builder](#petpetidpostpathparametersmap0builder) | petId(long value) | +| [PetpetidPostPathParametersMap0Builder](#petpetidpostpathparametersmap0builder) | petId(double value) | + +## PetpetidPostPathParametersMap +public static class PetpetidPostPathParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [PetpetidPostPathParametersMap](#petpetidpostpathparametersmap) | of([Map](#petpetidpostpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| Number | petId()
| + +## PetpetidPostadditionalPropertiesBoxed +public sealed interface PetpetidPostadditionalPropertiesBoxed
+permits
+[PetpetidPostadditionalPropertiesBoxedVoid](#petpetidpostadditionalpropertiesboxedvoid), +[PetpetidPostadditionalPropertiesBoxedBoolean](#petpetidpostadditionalpropertiesboxedboolean), +[PetpetidPostadditionalPropertiesBoxedNumber](#petpetidpostadditionalpropertiesboxednumber), +[PetpetidPostadditionalPropertiesBoxedString](#petpetidpostadditionalpropertiesboxedstring), +[PetpetidPostadditionalPropertiesBoxedList](#petpetidpostadditionalpropertiesboxedlist), +[PetpetidPostadditionalPropertiesBoxedMap](#petpetidpostadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## PetpetidPostadditionalPropertiesBoxedVoid +public record PetpetidPostadditionalPropertiesBoxedVoid
+implements [PetpetidPostadditionalPropertiesBoxed](#petpetidpostadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidPostadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetidPostadditionalPropertiesBoxedBoolean +public record PetpetidPostadditionalPropertiesBoxedBoolean
+implements [PetpetidPostadditionalPropertiesBoxed](#petpetidpostadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidPostadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetidPostadditionalPropertiesBoxedNumber +public record PetpetidPostadditionalPropertiesBoxedNumber
+implements [PetpetidPostadditionalPropertiesBoxed](#petpetidpostadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidPostadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetidPostadditionalPropertiesBoxedString +public record PetpetidPostadditionalPropertiesBoxedString
+implements [PetpetidPostadditionalPropertiesBoxed](#petpetidpostadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidPostadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetidPostadditionalPropertiesBoxedList +public record PetpetidPostadditionalPropertiesBoxedList
+implements [PetpetidPostadditionalPropertiesBoxed](#petpetidpostadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidPostadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetidPostadditionalPropertiesBoxedMap +public record PetpetidPostadditionalPropertiesBoxedMap
+implements [PetpetidPostadditionalPropertiesBoxed](#petpetidpostadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidPostadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetidPostadditionalProperties +public static class PetpetidPostadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/petpetid/post/PetpetidPostRequestBody.md b/samples/client/petstore/java/docs/paths/petpetid/post/PetpetidPostRequestBody.md new file mode 100644 index 00000000000..c69e673f340 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petpetid/post/PetpetidPostRequestBody.md @@ -0,0 +1,90 @@ +# PetpetidPostRequestBody + +public class PetpetidPostRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [PetpetidPostRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [PetpetidPostRequestBody.ApplicationxwwwformurlencodedMediaType](#applicationxwwwformurlencodedmediatype)
record storing schema + encoding for a specific contentType | +| static class | [PetpetidPostRequestBody.PetpetidPostRequestBody1](#petpetidpostrequestbody1)
class that serializes request bodies | +| sealed interface | [PetpetidPostRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [PetpetidPostRequestBody.ApplicationxwwwformurlencodedRequestBody](#applicationxwwwformurlencodedrequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationxwwwformurlencodedMediaType](#applicationxwwwformurlencodedmediatype) + +sealed interface that stores schema and encoding info + + +## ApplicationxwwwformurlencodedMediaType +public record ApplicationxwwwformurlencodedMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1](../../../paths/petpetid/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationxwwwformurlencodedMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1](../../../paths/petpetid/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## PetpetidPostRequestBody1 +public static class PetpetidPostRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidPostRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = false
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/x-www-form-urlencoded", new [ApplicationxwwwformurlencodedMediaType](#applicationxwwwformurlencodedmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[ApplicationxwwwformurlencodedRequestBody](#applicationxwwwformurlencodedrequestbody) + +sealed interface that stores request contentType + validated schema data + +## ApplicationxwwwformurlencodedRequestBody +public record ApplicationxwwwformurlencodedRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="application/x-www-form-urlencoded" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationxwwwformurlencodedRequestBody(ApplicationxwwwformurlencodedSchema.[ApplicationxwwwformurlencodedSchema1Boxed](../../../paths/petpetid/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "application/x-www-form-urlencoded" | +| ApplicationxwwwformurlencodedSchema.[ApplicationxwwwformurlencodedSchema1Boxed](../../../paths/petpetid/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/petpetid/post/PetpetidPostResponses.md b/samples/client/petstore/java/docs/paths/petpetid/post/PetpetidPostResponses.md new file mode 100644 index 00000000000..1372e9116b3 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petpetid/post/PetpetidPostResponses.md @@ -0,0 +1,10 @@ +# PetpetidPostResponses + +public class PetpetidPostResponses + +A class that contains necessary responses classes + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | + diff --git a/samples/client/petstore/java/docs/paths/petpetid/post/RequestBody.md b/samples/client/petstore/java/docs/paths/petpetid/post/RequestBody.md deleted file mode 100644 index 672ae8e9af1..00000000000 --- a/samples/client/petstore/java/docs/paths/petpetid/post/RequestBody.md +++ /dev/null @@ -1,90 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.ApplicationxwwwformurlencodedMediaType](#applicationxwwwformurlencodedmediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.ApplicationxwwwformurlencodedRequestBody](#applicationxwwwformurlencodedrequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationxwwwformurlencodedMediaType](#applicationxwwwformurlencodedmediatype) - -sealed interface that stores schema and encoding info - - -## ApplicationxwwwformurlencodedMediaType -public record ApplicationxwwwformurlencodedMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1](../../../paths/petpetid/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationxwwwformurlencodedMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1](../../../paths/petpetid/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = false
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/x-www-form-urlencoded", new [ApplicationxwwwformurlencodedMediaType](#applicationxwwwformurlencodedmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[ApplicationxwwwformurlencodedRequestBody](#applicationxwwwformurlencodedrequestbody) - -sealed interface that stores request contentType + validated schema data - -## ApplicationxwwwformurlencodedRequestBody -public record ApplicationxwwwformurlencodedRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="application/x-www-form-urlencoded" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationxwwwformurlencodedRequestBody(ApplicationxwwwformurlencodedSchema.[ApplicationxwwwformurlencodedSchema1Boxed](../../../paths/petpetid/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "application/x-www-form-urlencoded" | -| ApplicationxwwwformurlencodedSchema.[ApplicationxwwwformurlencodedSchema1Boxed](../../../paths/petpetid/post/requestbody/content/applicationxwwwformurlencoded/ApplicationxwwwformurlencodedSchema.md#applicationxwwwformurlencodedschema1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/petpetid/post/Responses.md b/samples/client/petstore/java/docs/paths/petpetid/post/Responses.md deleted file mode 100644 index 5841efd5c37..00000000000 --- a/samples/client/petstore/java/docs/paths/petpetid/post/Responses.md +++ /dev/null @@ -1,10 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | - diff --git a/samples/client/petstore/java/docs/paths/petpetid/post/responses/Code405Response.md b/samples/client/petstore/java/docs/paths/petpetid/post/responses/Code405Response.md deleted file mode 100644 index 0c371e4143d..00000000000 --- a/samples/client/petstore/java/docs/paths/petpetid/post/responses/Code405Response.md +++ /dev/null @@ -1,32 +0,0 @@ -# Code405Response - -public class Code405Response - -A class that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code405Response.Code405Response1](#code405response1)
class that deserializes responses | - -## Code405Response1 -public static class Code405Response1
-extends ResponseDeserializer - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code405Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = MapUtils.makeMap(
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/petpetid/post/responses/PetpetidPostCode405Response.md b/samples/client/petstore/java/docs/paths/petpetid/post/responses/PetpetidPostCode405Response.md new file mode 100644 index 00000000000..12fc2c4aa04 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petpetid/post/responses/PetpetidPostCode405Response.md @@ -0,0 +1,32 @@ +# PetpetidPostCode405Response + +public class PetpetidPostCode405Response + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [PetpetidPostCode405Response.PetpetidPostCode405Response1](#petpetidpostcode405response1)
class that deserializes responses | + +## PetpetidPostCode405Response1 +public static class PetpetidPostCode405Response1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetidPostCode405Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/petpetiduploadimage/PetpetiduploadimagePost.md b/samples/client/petstore/java/docs/paths/petpetiduploadimage/PetpetiduploadimagePost.md new file mode 100644 index 00000000000..4e44739c84b --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petpetiduploadimage/PetpetiduploadimagePost.md @@ -0,0 +1,200 @@ +# PetpetiduploadimagePost + +public class PetpetiduploadimagePost + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Post](#post)
The class that has a post method to call the endpoint | +| interface | [UploadImageOperation](#uploadimageoperation)
The interface that has a uploadImage method to call the endpoint | +| static class | [PostRequest](#postrequest)
The final request inputs class | +| static class | [PostNullableRequest](#postnullablerequest)
The initial request inputs class | +| static class | [Post0RequestBuilder](#post0requestbuilder)
A builder for the request input class | +| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | + +## Post +public static class Post extends ApiClient.ApiClient1 implements PostOperation
+ +a class that allows one to call the endpoint using a method named post + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.petpetiduploadimage.post.PetpetiduploadimagePostRequestBody; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.petpetiduploadimage.post.PetpetiduploadimagePostSecurityInfo; +import org.openapijsonschematools.client.paths.petpetiduploadimage.post.PetpetiduploadimagePostPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; +import org.openapijsonschematools.client.paths.petpetiduploadimage.post.responses.PetpetiduploadimagePostCode200Response; +import org.openapijsonschematools.client.components.responses.successwithjsonapiresponse.SuccessWithJsonApiResponseHeadersSchema; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.petpetiduploadimage.PetpetiduploadimagePost; +import org.openapijsonschematools.client.paths.petpetiduploadimage.post.PetpetiduploadimagePostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .petpetiduploadimagePostSecurityRequirementObject0SecurityIndex(PetpetiduploadimagePostSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +PetpetiduploadimagePost.Post apiClient = new PetpetiduploadimagePost.Post(apiConfiguration, schemaConfiguration); + + +// Map validation +PetpetiduploadimagePostPathParameters.PetpetiduploadimagePostPathParametersMap pathParameters = + PetpetiduploadimagePostPathParameters.PetpetiduploadimagePostPathParameters1.validate( + new PetpetiduploadimagePostPathParameters.PetpetiduploadimagePostPathParametersMapBuilder() + .petId(1L) + + .build(), + schemaConfiguration +); + +var request = new PetpetiduploadimagePost.PostRequestBuilder() + .pathParameters(pathParameters) + .build(); + +PetpetiduploadimagePostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +PetpetiduploadimagePostResponses.EndpointPetpetiduploadimagePostCode200Response castResponse = (PetpetiduploadimagePostResponses.EndpointPetpetiduploadimagePostCode200Response) response; +} +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetpetiduploadimagePostResponses.EndpointResponse](../../paths/petpetiduploadimage/post/PetpetiduploadimagePostResponses.md#endpointresponse) | post([PostRequest](#postrequest) request) | + +## UploadImageOperation +public interface UploadImageOperation
+ +an interface that allows one to call the endpoint using a method named uploadImage by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetpetiduploadimagePostResponses.EndpointResponse](../../paths/petpetiduploadimage/post/PetpetiduploadimagePostResponses.md#endpointresponse) | uploadImage([PostRequest](#postrequest) request) | + +## PostRequest +public static class PostRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [PetpetiduploadimagePostPathParameters.PetpetiduploadimagePostPathParametersMap](../../paths/petpetiduploadimage/post/PetpetiduploadimagePostPathParameters.md#petpetiduploadimagepostpathparametersmap) | pathParameters | +| [PetpetiduploadimagePostRequestBody.@Nullable SealedRequestBody](../../paths/petpetiduploadimage/post/PetpetiduploadimagePostRequestBody.md#sealedrequestbody) | requestBody
optional | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| [PetpetiduploadimagePostSecurityInfo.@Nullable SecurityIndex](../../paths/petpetiduploadimage/post/PetpetiduploadimagePostSecurityInfo.md#securityindex) | securityIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PostNullableRequest +public static class PostNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [PetpetiduploadimagePostPathParameters.@Nullable PetpetiduploadimagePostPathParametersMap](../../paths/petpetiduploadimage/post/PetpetiduploadimagePostPathParameters.md#petpetiduploadimagepostpathparametersmap) | pathParameters | +| [PetpetiduploadimagePostRequestBody.@Nullable SealedRequestBody](../../paths/petpetiduploadimage/post/PetpetiduploadimagePostRequestBody.md#sealedrequestbody) | requestBody | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| [PetpetiduploadimagePostSecurityInfo.@Nullable SecurityIndex](../../paths/petpetiduploadimage/post/PetpetiduploadimagePostSecurityInfo.md#securityindex) | securityIndex | +| @Nullable Duration | timeout | + +## Post0RequestBuilder +public static class Post0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post0RequestBuilder(Post0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | +| [Post0RequestBuilder](#post0requestbuilder) | requestBody([PetpetiduploadimagePostRequestBody.SealedRequestBody](../../paths/petpetiduploadimage/post/PetpetiduploadimagePostRequestBody.md#sealedrequestbody) requestBody)
sets the optional property | +| [Post0RequestBuilder](#post0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Post0RequestBuilder](#post0requestbuilder) | securityIndex([PetpetiduploadimagePostSecurityInfo.SecurityIndex](../../paths/petpetiduploadimage/post/PetpetiduploadimagePostSecurityInfo.md#securityindex) securityIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Post0RequestBuilder](#post0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## PostRequestBuilder +public static class PostRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PostRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Post0RequestBuilder](#post0requestbuilder) | pathParameters([PetpetiduploadimagePostPathParametersPetpetiduploadimagePostPathParametersMap](../../paths/petpetiduploadimage/post/PetpetiduploadimagePostPathParameters.md#petpetiduploadimagepostpathparametersmap) pathParameters)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/petpetiduploadimage/Post.md b/samples/client/petstore/java/docs/paths/petpetiduploadimage/Post.md deleted file mode 100644 index 45edecffc72..00000000000 --- a/samples/client/petstore/java/docs/paths/petpetiduploadimage/Post.md +++ /dev/null @@ -1,189 +0,0 @@ -# Post - -public class Post - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Post1](#post1)
The class that has a post method to call the endpoint | -| static class | [PostRequest](#postrequest)
The final request inputs class | -| static class | [PostNullableRequest](#postnullablerequest)
The initial request inputs class | -| static class | [Post0RequestBuilder](#post0requestbuilder)
A builder for the request input class | -| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | - -## Post1 -public static class Post1 extends ApiClient.ApiClient1 implements PostOperation
- -a class that allows one to call the endpoint using a method named post - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.petpetiduploadimage.post.RequestBody; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.petpetiduploadimage.post.PetpetiduploadimagePostSecurityInfo; -import org.openapijsonschematools.client.paths.petpetiduploadimage.post.PathParameters; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.securityschemes.SecurityScheme; -import org.openapijsonschematools.client.components.securityschemes.PetstoreAuth; -import org.openapijsonschematools.client.paths.petpetiduploadimage.post.responses.Code200Response; -import org.openapijsonschematools.client.components.responses.successwithjsonapiresponse.SuccessWithJsonApiResponseHeadersSchema; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.petpetiduploadimage.Post; -import org.openapijsonschematools.client.paths.petpetiduploadimage.post.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -List securitySchemes = new ArrayList(); -ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() - .petpetiduploadimagePostSecurityRequirementObject0SecurityIndex(PetpetiduploadimagePostSecurityRequirementObject0.SecurityIndex.SECURITY_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - securitySchemes, - securityIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Post.Post1 apiClient = new Post.Post1(apiConfiguration, schemaConfiguration); - - -// Map validation -PathParameters.PathParametersMap pathParameters = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .petId(1L) - - .build(), - schemaConfiguration -); - -var request = new PostRequestBuilder() - .pathParameters(pathParameters) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.post(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -} -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/petpetiduploadimage/post/Responses.md#endpointresponse) | post([PostRequest](#postrequest) request) | - -## PostRequest -public static class PostRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [PathParameters.PathParametersMap](../../paths/petpetiduploadimage/post/PathParameters.md#pathparametersmap) | pathParameters | -| [RequestBody.@Nullable SealedRequestBody](../../paths/petpetiduploadimage/post/RequestBody.md#sealedrequestbody) | requestBody
optional | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| [PetpetiduploadimagePostSecurityInfo.@Nullable SecurityIndex](../../paths/petpetiduploadimage/post/PetpetiduploadimagePostSecurityInfo.md#securityindex) | securityIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PostNullableRequest -public static class PostNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [PathParameters.@Nullable PathParametersMap](../../paths/petpetiduploadimage/post/PathParameters.md#pathparametersmap) | pathParameters | -| [RequestBody.@Nullable SealedRequestBody](../../paths/petpetiduploadimage/post/RequestBody.md#sealedrequestbody) | requestBody | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| [PetpetiduploadimagePostSecurityInfo.@Nullable SecurityIndex](../../paths/petpetiduploadimage/post/PetpetiduploadimagePostSecurityInfo.md#securityindex) | securityIndex | -| @Nullable Duration | timeout | - -## Post0RequestBuilder -public static class Post0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post0RequestBuilder(Post0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | -| [Post0RequestBuilder](#post0requestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/petpetiduploadimage/post/RequestBody.md#sealedrequestbody) requestBody)
sets the optional property | -| [Post0RequestBuilder](#post0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Post0RequestBuilder](#post0requestbuilder) | securityIndex([PetpetiduploadimagePostSecurityInfo.SecurityIndex](../../paths/petpetiduploadimage/post/PetpetiduploadimagePostSecurityInfo.md#securityindex) securityIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Post0RequestBuilder](#post0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## PostRequestBuilder -public static class PostRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PostRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Post0RequestBuilder](#post0requestbuilder) | pathParameters([PathParametersPathParametersMap](../../paths/petpetiduploadimage/post/PathParameters.md#pathparametersmap) pathParameters)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/PathParameters.md b/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/PathParameters.md deleted file mode 100644 index cf8f85caf67..00000000000 --- a/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/PathParameters.md +++ /dev/null @@ -1,271 +0,0 @@ -# PathParameters -public class PathParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [PathParameters.PathParameters1Boxed](#pathparameters1boxed)
sealed interface for validated payloads | -| record | [PathParameters.PathParameters1BoxedMap](#pathparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.PathParameters1](#pathparameters1)
schema class | -| static class | [PathParameters.PathParametersMapBuilder](#pathparametersmapbuilder)
builder for Map payloads | -| static class | [PathParameters.PathParametersMap](#pathparametersmap)
output class for Map payloads | -| sealed interface | [PathParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [PathParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [PathParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [PathParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [PathParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [PathParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [PathParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.AdditionalProperties](#additionalproperties)
schema class | - -## PathParameters1Boxed -public sealed interface PathParameters1Boxed
-permits
-[PathParameters1BoxedMap](#pathparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## PathParameters1BoxedMap -public record PathParameters1BoxedMap
-implements [PathParameters1Boxed](#pathparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParameters1BoxedMap([PathParametersMap](#pathparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## PathParameters1 -public static class PathParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.petpetiduploadimage.post.PathParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -PathParameters.PathParametersMap validatedPayload = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .petId(1L) - - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("petId", [Schema0.Schema01.class](../../../paths/petpetiduploadimage/post/parameters/parameter0/Schema0.md#schema01))
)
| -| Set | required = Set.of(
    "petId"
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | validate([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1BoxedMap](#pathparameters1boxedmap) | validateAndBox([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1Boxed](#pathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## PathParametersMap0Builder -public class PathParametersMap0Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | - -## PathParametersMapBuilder -public class PathParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap0Builder](#pathparametersmap0builder) | petId(int value) | -| [PathParametersMap0Builder](#pathparametersmap0builder) | petId(float value) | -| [PathParametersMap0Builder](#pathparametersmap0builder) | petId(long value) | -| [PathParametersMap0Builder](#pathparametersmap0builder) | petId(double value) | - -## PathParametersMap -public static class PathParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [PathParametersMap](#pathparametersmap) | of([Map](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| Number | petId()
| - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/PetpetiduploadimagePostPathParameters.md b/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/PetpetiduploadimagePostPathParameters.md new file mode 100644 index 00000000000..6c11cddf887 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/PetpetiduploadimagePostPathParameters.md @@ -0,0 +1,271 @@ +# PetpetiduploadimagePostPathParameters +public class PetpetiduploadimagePostPathParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [PetpetiduploadimagePostPathParameters.PetpetiduploadimagePostPathParameters1Boxed](#petpetiduploadimagepostpathparameters1boxed)
sealed interface for validated payloads | +| record | [PetpetiduploadimagePostPathParameters.PetpetiduploadimagePostPathParameters1BoxedMap](#petpetiduploadimagepostpathparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [PetpetiduploadimagePostPathParameters.PetpetiduploadimagePostPathParameters1](#petpetiduploadimagepostpathparameters1)
schema class | +| static class | [PetpetiduploadimagePostPathParameters.PetpetiduploadimagePostPathParametersMapBuilder](#petpetiduploadimagepostpathparametersmapbuilder)
builder for Map payloads | +| static class | [PetpetiduploadimagePostPathParameters.PetpetiduploadimagePostPathParametersMap](#petpetiduploadimagepostpathparametersmap)
output class for Map payloads | +| sealed interface | [PetpetiduploadimagePostPathParameters.PetpetiduploadimagePostadditionalPropertiesBoxed](#petpetiduploadimagepostadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [PetpetiduploadimagePostPathParameters.PetpetiduploadimagePostadditionalPropertiesBoxedVoid](#petpetiduploadimagepostadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [PetpetiduploadimagePostPathParameters.PetpetiduploadimagePostadditionalPropertiesBoxedBoolean](#petpetiduploadimagepostadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [PetpetiduploadimagePostPathParameters.PetpetiduploadimagePostadditionalPropertiesBoxedNumber](#petpetiduploadimagepostadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [PetpetiduploadimagePostPathParameters.PetpetiduploadimagePostadditionalPropertiesBoxedString](#petpetiduploadimagepostadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [PetpetiduploadimagePostPathParameters.PetpetiduploadimagePostadditionalPropertiesBoxedList](#petpetiduploadimagepostadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [PetpetiduploadimagePostPathParameters.PetpetiduploadimagePostadditionalPropertiesBoxedMap](#petpetiduploadimagepostadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [PetpetiduploadimagePostPathParameters.PetpetiduploadimagePostadditionalProperties](#petpetiduploadimagepostadditionalproperties)
schema class | + +## PetpetiduploadimagePostPathParameters1Boxed +public sealed interface PetpetiduploadimagePostPathParameters1Boxed
+permits
+[PetpetiduploadimagePostPathParameters1BoxedMap](#petpetiduploadimagepostpathparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## PetpetiduploadimagePostPathParameters1BoxedMap +public record PetpetiduploadimagePostPathParameters1BoxedMap
+implements [PetpetiduploadimagePostPathParameters1Boxed](#petpetiduploadimagepostpathparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetiduploadimagePostPathParameters1BoxedMap([PetpetiduploadimagePostPathParametersMap](#petpetiduploadimagepostpathparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetpetiduploadimagePostPathParametersMap](#petpetiduploadimagepostpathparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetiduploadimagePostPathParameters1 +public static class PetpetiduploadimagePostPathParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.petpetiduploadimage.post.PetpetiduploadimagePostPathParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +PetpetiduploadimagePostPathParameters.PetpetiduploadimagePostPathParametersMap validatedPayload = + PetpetiduploadimagePostPathParameters.PetpetiduploadimagePostPathParameters1.validate( + new PetpetiduploadimagePostPathParameters.PetpetiduploadimagePostPathParametersMapBuilder() + .petId(1L) + + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("petId", [Schema0.Schema01.class](../../../paths/petpetiduploadimage/post/parameters/parameter0/Schema0.md#schema01))
)
| +| Set | required = Set.of(
    "petId"
)
| +| Class | additionalProperties = [PetpetiduploadimagePostadditionalProperties.class](#petpetiduploadimagepostadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetpetiduploadimagePostPathParametersMap](#petpetiduploadimagepostpathparametersmap) | validate([Map<?, ?>](#petpetiduploadimagepostpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [PetpetiduploadimagePostPathParameters1BoxedMap](#petpetiduploadimagepostpathparameters1boxedmap) | validateAndBox([Map<?, ?>](#petpetiduploadimagepostpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [PetpetiduploadimagePostPathParameters1Boxed](#petpetiduploadimagepostpathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## PetpetiduploadimagePostPathParametersMap0Builder +public class PetpetiduploadimagePostPathParametersMap0Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetiduploadimagePostPathParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | + +## PetpetiduploadimagePostPathParametersMapBuilder +public class PetpetiduploadimagePostPathParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetiduploadimagePostPathParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PetpetiduploadimagePostPathParametersMap0Builder](#petpetiduploadimagepostpathparametersmap0builder) | petId(int value) | +| [PetpetiduploadimagePostPathParametersMap0Builder](#petpetiduploadimagepostpathparametersmap0builder) | petId(float value) | +| [PetpetiduploadimagePostPathParametersMap0Builder](#petpetiduploadimagepostpathparametersmap0builder) | petId(long value) | +| [PetpetiduploadimagePostPathParametersMap0Builder](#petpetiduploadimagepostpathparametersmap0builder) | petId(double value) | + +## PetpetiduploadimagePostPathParametersMap +public static class PetpetiduploadimagePostPathParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [PetpetiduploadimagePostPathParametersMap](#petpetiduploadimagepostpathparametersmap) | of([Map](#petpetiduploadimagepostpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| Number | petId()
| + +## PetpetiduploadimagePostadditionalPropertiesBoxed +public sealed interface PetpetiduploadimagePostadditionalPropertiesBoxed
+permits
+[PetpetiduploadimagePostadditionalPropertiesBoxedVoid](#petpetiduploadimagepostadditionalpropertiesboxedvoid), +[PetpetiduploadimagePostadditionalPropertiesBoxedBoolean](#petpetiduploadimagepostadditionalpropertiesboxedboolean), +[PetpetiduploadimagePostadditionalPropertiesBoxedNumber](#petpetiduploadimagepostadditionalpropertiesboxednumber), +[PetpetiduploadimagePostadditionalPropertiesBoxedString](#petpetiduploadimagepostadditionalpropertiesboxedstring), +[PetpetiduploadimagePostadditionalPropertiesBoxedList](#petpetiduploadimagepostadditionalpropertiesboxedlist), +[PetpetiduploadimagePostadditionalPropertiesBoxedMap](#petpetiduploadimagepostadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## PetpetiduploadimagePostadditionalPropertiesBoxedVoid +public record PetpetiduploadimagePostadditionalPropertiesBoxedVoid
+implements [PetpetiduploadimagePostadditionalPropertiesBoxed](#petpetiduploadimagepostadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetiduploadimagePostadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetiduploadimagePostadditionalPropertiesBoxedBoolean +public record PetpetiduploadimagePostadditionalPropertiesBoxedBoolean
+implements [PetpetiduploadimagePostadditionalPropertiesBoxed](#petpetiduploadimagepostadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetiduploadimagePostadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetiduploadimagePostadditionalPropertiesBoxedNumber +public record PetpetiduploadimagePostadditionalPropertiesBoxedNumber
+implements [PetpetiduploadimagePostadditionalPropertiesBoxed](#petpetiduploadimagepostadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetiduploadimagePostadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetiduploadimagePostadditionalPropertiesBoxedString +public record PetpetiduploadimagePostadditionalPropertiesBoxedString
+implements [PetpetiduploadimagePostadditionalPropertiesBoxed](#petpetiduploadimagepostadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetiduploadimagePostadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetiduploadimagePostadditionalPropertiesBoxedList +public record PetpetiduploadimagePostadditionalPropertiesBoxedList
+implements [PetpetiduploadimagePostadditionalPropertiesBoxed](#petpetiduploadimagepostadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetiduploadimagePostadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetiduploadimagePostadditionalPropertiesBoxedMap +public record PetpetiduploadimagePostadditionalPropertiesBoxedMap
+implements [PetpetiduploadimagePostadditionalPropertiesBoxed](#petpetiduploadimagepostadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetiduploadimagePostadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## PetpetiduploadimagePostadditionalProperties +public static class PetpetiduploadimagePostadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/PetpetiduploadimagePostRequestBody.md b/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/PetpetiduploadimagePostRequestBody.md new file mode 100644 index 00000000000..d85fbbb4f85 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/PetpetiduploadimagePostRequestBody.md @@ -0,0 +1,90 @@ +# PetpetiduploadimagePostRequestBody + +public class PetpetiduploadimagePostRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [PetpetiduploadimagePostRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [PetpetiduploadimagePostRequestBody.MultipartformdataMediaType](#multipartformdatamediatype)
record storing schema + encoding for a specific contentType | +| static class | [PetpetiduploadimagePostRequestBody.PetpetiduploadimagePostRequestBody1](#petpetiduploadimagepostrequestbody1)
class that serializes request bodies | +| sealed interface | [PetpetiduploadimagePostRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [PetpetiduploadimagePostRequestBody.MultipartformdataRequestBody](#multipartformdatarequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[MultipartformdataMediaType](#multipartformdatamediatype) + +sealed interface that stores schema and encoding info + + +## MultipartformdataMediaType +public record MultipartformdataMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[MultipartformdataSchema.MultipartformdataSchema1](../../../paths/petpetiduploadimage/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| MultipartformdataMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [MultipartformdataSchema.MultipartformdataSchema1](../../../paths/petpetiduploadimage/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## PetpetiduploadimagePostRequestBody1 +public static class PetpetiduploadimagePostRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PetpetiduploadimagePostRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = false
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("multipart/form-data", new [MultipartformdataMediaType](#multipartformdatamediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[MultipartformdataRequestBody](#multipartformdatarequestbody) + +sealed interface that stores request contentType + validated schema data + +## MultipartformdataRequestBody +public record MultipartformdataRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="multipart/form-data" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| MultipartformdataRequestBody(MultipartformdataSchema.[MultipartformdataSchema1Boxed](../../../paths/petpetiduploadimage/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "multipart/form-data" | +| MultipartformdataSchema.[MultipartformdataSchema1Boxed](../../../paths/petpetiduploadimage/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/PetpetiduploadimagePostResponses.md b/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/PetpetiduploadimagePostResponses.md new file mode 100644 index 00000000000..b961dc0e86b --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/PetpetiduploadimagePostResponses.md @@ -0,0 +1,29 @@ +# PetpetiduploadimagePostResponses + +public class PetpetiduploadimagePostResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointPetpetiduploadimagePostCode200Response](#endpointpetpetiduploadimagepostcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointPetpetiduploadimagePostCode200Response](#endpointpetpetiduploadimagepostcode200response) + +a sealed interface that stores endpoint responses + +## EndpointPetpetiduploadimagePostCode200Response +public record EndpointPetpetiduploadimagePostCode200Response( + HttpResponse response, + [PetpetiduploadimagePostCode200Response.SealedResponseBody](../../../paths/petpetiduploadimage/post/responses/PetpetiduploadimagePostCode200Response.md#sealedresponsebody) body, + [SuccessWithJsonApiResponseHeadersSchema.SuccessWithJsonApiResponseHeadersSchemaMap](../../../components/responses/successwithjsonapiresponse/SuccessWithJsonApiResponseHeadersSchema.md#successwithjsonapiresponseheadersschemamap) headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/RequestBody.md b/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/RequestBody.md deleted file mode 100644 index d65d0664340..00000000000 --- a/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/RequestBody.md +++ /dev/null @@ -1,90 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.MultipartformdataMediaType](#multipartformdatamediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.MultipartformdataRequestBody](#multipartformdatarequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[MultipartformdataMediaType](#multipartformdatamediatype) - -sealed interface that stores schema and encoding info - - -## MultipartformdataMediaType -public record MultipartformdataMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[MultipartformdataSchema.MultipartformdataSchema1](../../../paths/petpetiduploadimage/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| MultipartformdataMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [MultipartformdataSchema.MultipartformdataSchema1](../../../paths/petpetiduploadimage/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = false
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("multipart/form-data", new [MultipartformdataMediaType](#multipartformdatamediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[MultipartformdataRequestBody](#multipartformdatarequestbody) - -sealed interface that stores request contentType + validated schema data - -## MultipartformdataRequestBody -public record MultipartformdataRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="multipart/form-data" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| MultipartformdataRequestBody(MultipartformdataSchema.[MultipartformdataSchema1Boxed](../../../paths/petpetiduploadimage/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "multipart/form-data" | -| MultipartformdataSchema.[MultipartformdataSchema1Boxed](../../../paths/petpetiduploadimage/post/requestbody/content/multipartformdata/MultipartformdataSchema.md#multipartformdataschema1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/Responses.md b/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/Responses.md deleted file mode 100644 index 9f9a052293c..00000000000 --- a/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/petpetiduploadimage/post/responses/Code200Response.md#sealedresponsebody) body, - [SuccessWithJsonApiResponseHeadersSchema.SuccessWithJsonApiResponseHeadersSchemaMap](../../../components/responses/successwithjsonapiresponse/SuccessWithJsonApiResponseHeadersSchema.md#successwithjsonapiresponseheadersschemamap) headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/responses/Code200Response.md deleted file mode 100644 index 024be23487f..00000000000 --- a/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/responses/Code200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# Code200Response - -public class Code200Response extends [SuccessWithJsonApiResponse](../../components/responses/SuccessWithJsonApiResponse.md) - -A class (extended from the $ref class) that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## Code200Response1 -public static class Code200Response1 extends [SuccessWithJsonApiResponse1](../../components/responses/SuccessWithJsonApiResponse.md#successwithjsonapiresponse1)
- -a class that deserializes responses, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/responses/PetpetiduploadimagePostCode200Response.md b/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/responses/PetpetiduploadimagePostCode200Response.md new file mode 100644 index 00000000000..0be7cd47d32 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/petpetiduploadimage/post/responses/PetpetiduploadimagePostCode200Response.md @@ -0,0 +1,17 @@ +# PetpetiduploadimagePostCode200Response + +public class PetpetiduploadimagePostCode200Response extends [SuccessWithJsonApiResponse](../../components/responses/SuccessWithJsonApiResponse.md) + +A class (extended from the $ref class) that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [PetpetiduploadimagePostCode200Response.PetpetiduploadimagePostCode200Response1](#petpetiduploadimagepostcode200response1)
class that deserializes responses | + +## PetpetiduploadimagePostCode200Response1 +public static class PetpetiduploadimagePostCode200Response1 extends [SuccessWithJsonApiResponse1](../../components/responses/SuccessWithJsonApiResponse.md#successwithjsonapiresponse1)
+ +a class that deserializes responses, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/solidus/Get.md b/samples/client/petstore/java/docs/paths/solidus/Get.md deleted file mode 100644 index 6068cd9b6f2..00000000000 --- a/samples/client/petstore/java/docs/paths/solidus/Get.md +++ /dev/null @@ -1,128 +0,0 @@ -# Get - -public class Get - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Get1](#get1)
The class that has a get method to call the endpoint | -| static class | [GetRequest](#getrequest)
The request inputs class | -| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | - -## Get1 -public static class Get1 extends ApiClient.ApiClient1 implements GetOperation
- -a class that allows one to call the endpoint using a method named get - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.solidus.get.responses.Code200Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.solidus.Get; -import org.openapijsonschematools.client.paths.solidus.get.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Get.Get1 apiClient = new Get.Get1(apiConfiguration, schemaConfiguration); - - -var request = new GetRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.get(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/solidus/get/Responses.md#endpointresponse) | get([GetRequest](#getrequest) request) | - -## GetRequest -public static class GetRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## GetRequestBuilder -public static class GetRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| GetRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | -| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/solidus/SolidusGet.md b/samples/client/petstore/java/docs/paths/solidus/SolidusGet.md new file mode 100644 index 00000000000..8794bb3d51a --- /dev/null +++ b/samples/client/petstore/java/docs/paths/solidus/SolidusGet.md @@ -0,0 +1,139 @@ +# SolidusGet + +public class SolidusGet + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Get](#get)
The class that has a get method to call the endpoint | +| interface | [SlashRouteOperation](#slashrouteoperation)
The interface that has a slashRoute method to call the endpoint | +| static class | [GetRequest](#getrequest)
The request inputs class | +| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | + +## Get +public static class Get extends ApiClient.ApiClient1 implements GetOperation
+ +a class that allows one to call the endpoint using a method named get + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.solidus.get.responses.SolidusGetCode200Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.solidus.SolidusGet; +import org.openapijsonschematools.client.paths.solidus.get.SolidusGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +SolidusGet.Get apiClient = new SolidusGet.Get(apiConfiguration, schemaConfiguration); + + +var request = new SolidusGet.GetRequestBuilder().build(); + +SolidusGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +SolidusGetResponses.EndpointSolidusGetCode200Response castResponse = (SolidusGetResponses.EndpointSolidusGetCode200Response) response; +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [SolidusGetResponses.EndpointResponse](../../paths/solidus/get/SolidusGetResponses.md#endpointresponse) | get([GetRequest](#getrequest) request) | + +## SlashRouteOperation +public interface SlashRouteOperation
+ +an interface that allows one to call the endpoint using a method named slashRoute by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [SolidusGetResponses.EndpointResponse](../../paths/solidus/get/SolidusGetResponses.md#endpointresponse) | slashRoute([GetRequest](#getrequest) request) | + +## GetRequest +public static class GetRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## GetRequestBuilder +public static class GetRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| GetRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | +| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/solidus/get/Responses.md b/samples/client/petstore/java/docs/paths/solidus/get/Responses.md deleted file mode 100644 index d4bf4fdb8f5..00000000000 --- a/samples/client/petstore/java/docs/paths/solidus/get/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/solidus/get/SolidusGetResponses.md b/samples/client/petstore/java/docs/paths/solidus/get/SolidusGetResponses.md new file mode 100644 index 00000000000..70dc55d02a0 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/solidus/get/SolidusGetResponses.md @@ -0,0 +1,29 @@ +# SolidusGetResponses + +public class SolidusGetResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointSolidusGetCode200Response](#endpointsolidusgetcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointSolidusGetCode200Response](#endpointsolidusgetcode200response) + +a sealed interface that stores endpoint responses + +## EndpointSolidusGetCode200Response +public record EndpointSolidusGetCode200Response( + HttpResponse response, + Void body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/solidus/get/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/solidus/get/responses/Code200Response.md deleted file mode 100644 index e89c75b2e12..00000000000 --- a/samples/client/petstore/java/docs/paths/solidus/get/responses/Code200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# Code200Response - -public class Code200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) - -A class (extended from the $ref class) that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## Code200Response1 -public static class Code200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
- -a class that deserializes responses, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/solidus/get/responses/SolidusGetCode200Response.md b/samples/client/petstore/java/docs/paths/solidus/get/responses/SolidusGetCode200Response.md new file mode 100644 index 00000000000..e00fe1ece0e --- /dev/null +++ b/samples/client/petstore/java/docs/paths/solidus/get/responses/SolidusGetCode200Response.md @@ -0,0 +1,17 @@ +# SolidusGetCode200Response + +public class SolidusGetCode200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) + +A class (extended from the $ref class) that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [SolidusGetCode200Response.SolidusGetCode200Response1](#solidusgetcode200response1)
class that deserializes responses | + +## SolidusGetCode200Response1 +public static class SolidusGetCode200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
+ +a class that deserializes responses, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/storeinventory/Get.md b/samples/client/petstore/java/docs/paths/storeinventory/Get.md deleted file mode 100644 index f4469bfa327..00000000000 --- a/samples/client/petstore/java/docs/paths/storeinventory/Get.md +++ /dev/null @@ -1,144 +0,0 @@ -# Get - -public class Get - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Get1](#get1)
The class that has a get method to call the endpoint | -| static class | [GetRequest](#getrequest)
The request inputs class | -| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | - -## Get1 -public static class Get1 extends ApiClient.ApiClient1 implements GetOperation
- -a class that allows one to call the endpoint using a method named get - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.storeinventory.get.StoreinventoryGetSecurityInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.securityschemes.SecurityScheme; -import org.openapijsonschematools.client.components.securityschemes.ApiKey; -import org.openapijsonschematools.client.paths.storeinventory.get.responses.Code200Response; -import org.openapijsonschematools.client.components.responses.successinlinecontentandheader.SuccessInlineContentAndHeaderHeadersSchema; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.storeinventory.Get; -import org.openapijsonschematools.client.paths.storeinventory.get.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -List securitySchemes = new ArrayList(); -securitySchemes.add( - new ApiKey("someApiKey"); -); -ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() - .storeinventoryGetSecurityRequirementObject0SecurityIndex(StoreinventoryGetSecurityRequirementObject0.SecurityIndex.SECURITY_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - securitySchemes, - securityIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Get.Get1 apiClient = new Get.Get1(apiConfiguration, schemaConfiguration); - - -var request = new GetRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.get(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -} -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/storeinventory/get/Responses.md#endpointresponse) | get([GetRequest](#getrequest) request) | - -## GetRequest -public static class GetRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| [StoreinventoryGetSecurityInfo.@Nullable SecurityIndex](../../paths/storeinventory/get/StoreinventoryGetSecurityInfo.md#securityindex) | securityIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## GetRequestBuilder -public static class GetRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| GetRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | -| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [GetRequestBuilder](#getrequestbuilder) | securityIndex([StoreinventoryGetSecurityInfo.SecurityIndex](../../paths/storeinventory/get/StoreinventoryGetSecurityInfo.md#securityindex) securityIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/storeinventory/StoreinventoryGet.md b/samples/client/petstore/java/docs/paths/storeinventory/StoreinventoryGet.md new file mode 100644 index 00000000000..efacddff2cd --- /dev/null +++ b/samples/client/petstore/java/docs/paths/storeinventory/StoreinventoryGet.md @@ -0,0 +1,155 @@ +# StoreinventoryGet + +public class StoreinventoryGet + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Get](#get)
The class that has a get method to call the endpoint | +| interface | [GetInventoryOperation](#getinventoryoperation)
The interface that has a getInventory method to call the endpoint | +| static class | [GetRequest](#getrequest)
The request inputs class | +| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | + +## Get +public static class Get extends ApiClient.ApiClient1 implements GetOperation
+ +a class that allows one to call the endpoint using a method named get + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.storeinventory.get.StoreinventoryGetSecurityInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.securityschemes.SecurityScheme; +import org.openapijsonschematools.client.components.securityschemes.ApiKey; +import org.openapijsonschematools.client.paths.storeinventory.get.responses.StoreinventoryGetCode200Response; +import org.openapijsonschematools.client.components.responses.successinlinecontentandheader.SuccessInlineContentAndHeaderHeadersSchema; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.storeinventory.StoreinventoryGet; +import org.openapijsonschematools.client.paths.storeinventory.get.StoreinventoryGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +List securitySchemes = new ArrayList(); +securitySchemes.add( + new ApiKey("someApiKey"); +); +ApiConfiguration.SecurityIndexInfo securityIndexInfo = new ApiConfiguration.SecurityIndexInfoBuilder() + .storeinventoryGetSecurityRequirementObject0SecurityIndex(StoreinventoryGetSecurityRequirementObject0.SecurityIndex.SECURITY_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + securitySchemes, + securityIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +StoreinventoryGet.Get apiClient = new StoreinventoryGet.Get(apiConfiguration, schemaConfiguration); + + +var request = new StoreinventoryGet.GetRequestBuilder().build(); + +StoreinventoryGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +StoreinventoryGetResponses.EndpointStoreinventoryGetCode200Response castResponse = (StoreinventoryGetResponses.EndpointStoreinventoryGetCode200Response) response; +} +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [StoreinventoryGetResponses.EndpointResponse](../../paths/storeinventory/get/StoreinventoryGetResponses.md#endpointresponse) | get([GetRequest](#getrequest) request) | + +## GetInventoryOperation +public interface GetInventoryOperation
+ +an interface that allows one to call the endpoint using a method named getInventory by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [StoreinventoryGetResponses.EndpointResponse](../../paths/storeinventory/get/StoreinventoryGetResponses.md#endpointresponse) | getInventory([GetRequest](#getrequest) request) | + +## GetRequest +public static class GetRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| [StoreinventoryGetSecurityInfo.@Nullable SecurityIndex](../../paths/storeinventory/get/StoreinventoryGetSecurityInfo.md#securityindex) | securityIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## GetRequestBuilder +public static class GetRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| GetRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | +| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [GetRequestBuilder](#getrequestbuilder) | securityIndex([StoreinventoryGetSecurityInfo.SecurityIndex](../../paths/storeinventory/get/StoreinventoryGetSecurityInfo.md#securityindex) securityIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/storeinventory/get/Responses.md b/samples/client/petstore/java/docs/paths/storeinventory/get/Responses.md deleted file mode 100644 index cc1f6f34df9..00000000000 --- a/samples/client/petstore/java/docs/paths/storeinventory/get/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/storeinventory/get/responses/Code200Response.md#sealedresponsebody) body, - [SuccessInlineContentAndHeaderHeadersSchema.SuccessInlineContentAndHeaderHeadersSchemaMap](../../../components/responses/successinlinecontentandheader/SuccessInlineContentAndHeaderHeadersSchema.md#successinlinecontentandheaderheadersschemamap) headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/storeinventory/get/StoreinventoryGetResponses.md b/samples/client/petstore/java/docs/paths/storeinventory/get/StoreinventoryGetResponses.md new file mode 100644 index 00000000000..9f064be5958 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/storeinventory/get/StoreinventoryGetResponses.md @@ -0,0 +1,29 @@ +# StoreinventoryGetResponses + +public class StoreinventoryGetResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointStoreinventoryGetCode200Response](#endpointstoreinventorygetcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointStoreinventoryGetCode200Response](#endpointstoreinventorygetcode200response) + +a sealed interface that stores endpoint responses + +## EndpointStoreinventoryGetCode200Response +public record EndpointStoreinventoryGetCode200Response( + HttpResponse response, + [StoreinventoryGetCode200Response.SealedResponseBody](../../../paths/storeinventory/get/responses/StoreinventoryGetCode200Response.md#sealedresponsebody) body, + [SuccessInlineContentAndHeaderHeadersSchema.SuccessInlineContentAndHeaderHeadersSchemaMap](../../../components/responses/successinlinecontentandheader/SuccessInlineContentAndHeaderHeadersSchema.md#successinlinecontentandheaderheadersschemamap) headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/storeinventory/get/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/storeinventory/get/responses/Code200Response.md deleted file mode 100644 index fa53032832a..00000000000 --- a/samples/client/petstore/java/docs/paths/storeinventory/get/responses/Code200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# Code200Response - -public class Code200Response extends [SuccessInlineContentAndHeader](../../components/responses/SuccessInlineContentAndHeader.md) - -A class (extended from the $ref class) that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## Code200Response1 -public static class Code200Response1 extends [SuccessInlineContentAndHeader1](../../components/responses/SuccessInlineContentAndHeader.md#successinlinecontentandheader1)
- -a class that deserializes responses, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/storeinventory/get/responses/StoreinventoryGetCode200Response.md b/samples/client/petstore/java/docs/paths/storeinventory/get/responses/StoreinventoryGetCode200Response.md new file mode 100644 index 00000000000..969b8dc35f3 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/storeinventory/get/responses/StoreinventoryGetCode200Response.md @@ -0,0 +1,17 @@ +# StoreinventoryGetCode200Response + +public class StoreinventoryGetCode200Response extends [SuccessInlineContentAndHeader](../../components/responses/SuccessInlineContentAndHeader.md) + +A class (extended from the $ref class) that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [StoreinventoryGetCode200Response.StoreinventoryGetCode200Response1](#storeinventorygetcode200response1)
class that deserializes responses | + +## StoreinventoryGetCode200Response1 +public static class StoreinventoryGetCode200Response1 extends [SuccessInlineContentAndHeader1](../../components/responses/SuccessInlineContentAndHeader.md#successinlinecontentandheader1)
+ +a class that deserializes responses, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/storeorder/Post.md b/samples/client/petstore/java/docs/paths/storeorder/Post.md deleted file mode 100644 index 02a949a945c..00000000000 --- a/samples/client/petstore/java/docs/paths/storeorder/Post.md +++ /dev/null @@ -1,192 +0,0 @@ -# Post - -public class Post - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Post1](#post1)
The class that has a post method to call the endpoint | -| static class | [PostRequest](#postrequest)
The final request inputs class | -| static class | [PostNullableRequest](#postnullablerequest)
The initial request inputs class | -| static class | [Post0RequestBuilder](#post0requestbuilder)
A builder for the request input class | -| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | - -## Post1 -public static class Post1 extends ApiClient.ApiClient1 implements PostOperation
- -a class that allows one to call the endpoint using a method named post - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.storeorder.post.RequestBody; -import org.openapijsonschematools.client.components.schemas.Order; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.storeorder.post.responses.Code200Response; -import org.openapijsonschematools.client.paths.storeorder.post.responses.Code400Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.storeorder.Post; -import org.openapijsonschematools.client.paths.storeorder.post.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Post.Post1 apiClient = new Post.Post1(apiConfiguration, schemaConfiguration); - - -Order1BoxedMap requestBodyPayload = - Order.Order1.validateAndBox( - new Order.OrderMapBuilder() - .id(1L) - - .petId(1L) - - .quantity(1) - - .shipDate("1970-01-01T00:00:00.00Z") - - .status("placed") - - .complete(true) - - .build(), - schemaConfiguration -); -Post.SealedRequestBody requestBody = new Post.ApplicationjsonRequestBody(requestBodyPayload); - -var request = new PostRequestBuilder() - .requestBody(requestBody) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.post(request); -} catch (Code400Response.ResponseApiException e) { - // server returned an error response defined in the openapi document - throw e; -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -if (castResponse.body instanceof Code200Response.ApplicationxmlResponseBody deserializedBody) { - // handle deserialized body here -} else { - Code200Response.ApplicationjsonResponseBody deserializedBody = (Code200Response.ApplicationjsonResponseBody) castResponse.body; - // handle deserialized body here -} -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/storeorder/post/Responses.md#endpointresponse) | post([PostRequest](#postrequest) request) | - -## PostRequest -public static class PostRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.SealedRequestBody](../../paths/storeorder/post/RequestBody.md#sealedrequestbody) | requestBody | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PostNullableRequest -public static class PostNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/storeorder/post/RequestBody.md#sealedrequestbody) | requestBody | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| @Nullable Duration | timeout | - -## Post0RequestBuilder -public static class Post0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post0RequestBuilder(Post0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | -| [Post0RequestBuilder](#post0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Post0RequestBuilder](#post0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## PostRequestBuilder -public static class PostRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PostRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Post0RequestBuilder](#post0requestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/storeorder/post/RequestBody.md#sealedrequestbody) requestBody)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/storeorder/StoreorderPost.md b/samples/client/petstore/java/docs/paths/storeorder/StoreorderPost.md new file mode 100644 index 00000000000..6b1f2d34607 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/storeorder/StoreorderPost.md @@ -0,0 +1,203 @@ +# StoreorderPost + +public class StoreorderPost + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Post](#post)
The class that has a post method to call the endpoint | +| interface | [PlaceOrderOperation](#placeorderoperation)
The interface that has a placeOrder method to call the endpoint | +| static class | [PostRequest](#postrequest)
The final request inputs class | +| static class | [PostNullableRequest](#postnullablerequest)
The initial request inputs class | +| static class | [Post0RequestBuilder](#post0requestbuilder)
A builder for the request input class | +| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | + +## Post +public static class Post extends ApiClient.ApiClient1 implements PostOperation
+ +a class that allows one to call the endpoint using a method named post + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.storeorder.post.StoreorderPostRequestBody; +import org.openapijsonschematools.client.components.schemas.Order; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.storeorder.post.responses.StoreorderPostCode200Response; +import org.openapijsonschematools.client.paths.storeorder.post.responses.StoreorderPostCode400Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.storeorder.StoreorderPost; +import org.openapijsonschematools.client.paths.storeorder.post.StoreorderPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +StoreorderPost.Post apiClient = new StoreorderPost.Post(apiConfiguration, schemaConfiguration); + + +Order1BoxedMap requestBodyPayload = + Order.Order1.validateAndBox( + new Order.OrderMapBuilder() + .id(1L) + + .petId(1L) + + .quantity(1) + + .shipDate("1970-01-01T00:00:00.00Z") + + .status("placed") + + .complete(true) + + .build(), + schemaConfiguration +); +StoreorderPost.SealedRequestBody requestBody = new StoreorderPost.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new StoreorderPost.PostRequestBuilder() + .requestBody(requestBody) + .build(); + +StoreorderPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (StoreorderPostCode400Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +StoreorderPostResponses.EndpointStoreorderPostCode200Response castResponse = (StoreorderPostResponses.EndpointStoreorderPostCode200Response) response; +if (castResponse.body instanceof StoreorderPostCode200Response.ApplicationxmlResponseBody deserializedBody) { + // handle deserialized body here +} else { + StoreorderPostCode200Response.ApplicationjsonResponseBody deserializedBody = (StoreorderPostCode200Response.ApplicationjsonResponseBody) castResponse.body; + // handle deserialized body here +} +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [StoreorderPostResponses.EndpointResponse](../../paths/storeorder/post/StoreorderPostResponses.md#endpointresponse) | post([PostRequest](#postrequest) request) | + +## PlaceOrderOperation +public interface PlaceOrderOperation
+ +an interface that allows one to call the endpoint using a method named placeOrder by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [StoreorderPostResponses.EndpointResponse](../../paths/storeorder/post/StoreorderPostResponses.md#endpointresponse) | placeOrder([PostRequest](#postrequest) request) | + +## PostRequest +public static class PostRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [StoreorderPostRequestBody.SealedRequestBody](../../paths/storeorder/post/StoreorderPostRequestBody.md#sealedrequestbody) | requestBody | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PostNullableRequest +public static class PostNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [StoreorderPostRequestBody.@Nullable SealedRequestBody](../../paths/storeorder/post/StoreorderPostRequestBody.md#sealedrequestbody) | requestBody | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| @Nullable Duration | timeout | + +## Post0RequestBuilder +public static class Post0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post0RequestBuilder(Post0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | +| [Post0RequestBuilder](#post0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Post0RequestBuilder](#post0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## PostRequestBuilder +public static class PostRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PostRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Post0RequestBuilder](#post0requestbuilder) | requestBody([StoreorderPostRequestBody.SealedRequestBody](../../paths/storeorder/post/StoreorderPostRequestBody.md#sealedrequestbody) requestBody)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/storeorder/post/RequestBody.md b/samples/client/petstore/java/docs/paths/storeorder/post/RequestBody.md deleted file mode 100644 index 98ae13f9473..00000000000 --- a/samples/client/petstore/java/docs/paths/storeorder/post/RequestBody.md +++ /dev/null @@ -1,90 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/storeorder/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/storeorder/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = true
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[ApplicationjsonRequestBody](#applicationjsonrequestbody) - -sealed interface that stores request contentType + validated schema data - -## ApplicationjsonRequestBody -public record ApplicationjsonRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonRequestBody(ApplicationjsonSchema.[Order1Boxed](../../../components/schemas/Order.md#order1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "application/json" | -| ApplicationjsonSchema.[Order1Boxed](../../../components/schemas/Order.md#order1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/storeorder/post/Responses.md b/samples/client/petstore/java/docs/paths/storeorder/post/Responses.md deleted file mode 100644 index b138f0fa617..00000000000 --- a/samples/client/petstore/java/docs/paths/storeorder/post/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/storeorder/post/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/storeorder/post/StoreorderPostRequestBody.md b/samples/client/petstore/java/docs/paths/storeorder/post/StoreorderPostRequestBody.md new file mode 100644 index 00000000000..84b67ae8225 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/storeorder/post/StoreorderPostRequestBody.md @@ -0,0 +1,90 @@ +# StoreorderPostRequestBody + +public class StoreorderPostRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [StoreorderPostRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [StoreorderPostRequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| static class | [StoreorderPostRequestBody.StoreorderPostRequestBody1](#storeorderpostrequestbody1)
class that serializes request bodies | +| sealed interface | [StoreorderPostRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [StoreorderPostRequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/storeorder/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/storeorder/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## StoreorderPostRequestBody1 +public static class StoreorderPostRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| StoreorderPostRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = true
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[ApplicationjsonRequestBody](#applicationjsonrequestbody) + +sealed interface that stores request contentType + validated schema data + +## ApplicationjsonRequestBody +public record ApplicationjsonRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonRequestBody(ApplicationjsonSchema.[Order1Boxed](../../../components/schemas/Order.md#order1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "application/json" | +| ApplicationjsonSchema.[Order1Boxed](../../../components/schemas/Order.md#order1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/storeorder/post/StoreorderPostResponses.md b/samples/client/petstore/java/docs/paths/storeorder/post/StoreorderPostResponses.md new file mode 100644 index 00000000000..48c83e88df4 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/storeorder/post/StoreorderPostResponses.md @@ -0,0 +1,29 @@ +# StoreorderPostResponses + +public class StoreorderPostResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointStoreorderPostCode200Response](#endpointstoreorderpostcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointStoreorderPostCode200Response](#endpointstoreorderpostcode200response) + +a sealed interface that stores endpoint responses + +## EndpointStoreorderPostCode200Response +public record EndpointStoreorderPostCode200Response( + HttpResponse response, + [StoreorderPostCode200Response.SealedResponseBody](../../../paths/storeorder/post/responses/StoreorderPostCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/storeorder/post/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/storeorder/post/responses/Code200Response.md deleted file mode 100644 index 27b46f7c421..00000000000 --- a/samples/client/petstore/java/docs/paths/storeorder/post/responses/Code200Response.md +++ /dev/null @@ -1,123 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationxmlMediaType](#applicationxmlmediatype)
record storing schema + encoding for a specific contentType | -| record | [Code200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationxmlResponseBody](#applicationxmlresponsebody)
implements sealed interface to store response body | -| record | [Code200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationxmlMediaType](#applicationxmlmediatype), -[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationxmlMediaType -public record ApplicationxmlMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationxmlSchema.ApplicationxmlSchema1](../../../../paths/storeorder/post/responses/code200response/content/applicationxml/ApplicationxmlSchema.md#applicationxmlschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationxmlMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationxmlSchema.ApplicationxmlSchema1](../../../../paths/storeorder/post/responses/code200response/content/applicationxml/ApplicationxmlSchema.md#applicationxmlschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/storeorder/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/storeorder/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationxmlResponseBody](#applicationxmlresponsebody), -[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationxmlResponseBody -public record ApplicationxmlResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/xml" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationxmlResponseBody(ApplicationxmlSchema.[Order1Boxed](../../../../components/schemas/Order.md#order1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationxmlSchema.[Order1Boxed](../../../../components/schemas/Order.md#order1boxed) | body()
returns the body passed in in the constructor | -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.[Order1Boxed](../../../../components/schemas/Order.md#order1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.[Order1Boxed](../../../../components/schemas/Order.md#order1boxed) | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/xml", new [ApplicationxmlMediaType](#applicationxmlmediatype)()),
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/storeorder/post/responses/Code400Response.md b/samples/client/petstore/java/docs/paths/storeorder/post/responses/Code400Response.md deleted file mode 100644 index 6f3af2df6d2..00000000000 --- a/samples/client/petstore/java/docs/paths/storeorder/post/responses/Code400Response.md +++ /dev/null @@ -1,32 +0,0 @@ -# Code400Response - -public class Code400Response - -A class that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code400Response.Code400Response1](#code400response1)
class that deserializes responses | - -## Code400Response1 -public static class Code400Response1
-extends ResponseDeserializer - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code400Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = MapUtils.makeMap(
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/storeorder/post/responses/StoreorderPostCode200Response.md b/samples/client/petstore/java/docs/paths/storeorder/post/responses/StoreorderPostCode200Response.md new file mode 100644 index 00000000000..0f5af758ef6 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/storeorder/post/responses/StoreorderPostCode200Response.md @@ -0,0 +1,123 @@ +# StoreorderPostCode200Response + +public class StoreorderPostCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [StoreorderPostCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [StoreorderPostCode200Response.ApplicationxmlMediaType](#applicationxmlmediatype)
record storing schema + encoding for a specific contentType | +| record | [StoreorderPostCode200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [StoreorderPostCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [StoreorderPostCode200Response.ApplicationxmlResponseBody](#applicationxmlresponsebody)
implements sealed interface to store response body | +| record | [StoreorderPostCode200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [StoreorderPostCode200Response.StoreorderPostCode200Response1](#storeorderpostcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationxmlMediaType](#applicationxmlmediatype), +[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationxmlMediaType +public record ApplicationxmlMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationxmlSchema.ApplicationxmlSchema1](../../../../paths/storeorder/post/responses/code200response/content/applicationxml/ApplicationxmlSchema.md#applicationxmlschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationxmlMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationxmlSchema.ApplicationxmlSchema1](../../../../paths/storeorder/post/responses/code200response/content/applicationxml/ApplicationxmlSchema.md#applicationxmlschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/storeorder/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/storeorder/post/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationxmlResponseBody](#applicationxmlresponsebody), +[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationxmlResponseBody +public record ApplicationxmlResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/xml" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationxmlResponseBody(ApplicationxmlSchema.[Order1Boxed](../../../../components/schemas/Order.md#order1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationxmlSchema.[Order1Boxed](../../../../components/schemas/Order.md#order1boxed) | body()
returns the body passed in in the constructor | +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.[Order1Boxed](../../../../components/schemas/Order.md#order1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.[Order1Boxed](../../../../components/schemas/Order.md#order1boxed) | body()
returns the body passed in in the constructor | + +## StoreorderPostCode200Response1 +public static class StoreorderPostCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| StoreorderPostCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/xml", new [ApplicationxmlMediaType](#applicationxmlmediatype)()),
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/storeorder/post/responses/StoreorderPostCode400Response.md b/samples/client/petstore/java/docs/paths/storeorder/post/responses/StoreorderPostCode400Response.md new file mode 100644 index 00000000000..d108179be92 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/storeorder/post/responses/StoreorderPostCode400Response.md @@ -0,0 +1,32 @@ +# StoreorderPostCode400Response + +public class StoreorderPostCode400Response + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [StoreorderPostCode400Response.StoreorderPostCode400Response1](#storeorderpostcode400response1)
class that deserializes responses | + +## StoreorderPostCode400Response1 +public static class StoreorderPostCode400Response1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| StoreorderPostCode400Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/storeorderorderid/Delete.md b/samples/client/petstore/java/docs/paths/storeorderorderid/Delete.md deleted file mode 100644 index c0d7e4a4dff..00000000000 --- a/samples/client/petstore/java/docs/paths/storeorderorderid/Delete.md +++ /dev/null @@ -1,174 +0,0 @@ -# Delete - -public class Delete - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Delete1](#delete1)
The class that has a delete method to call the endpoint | -| static class | [DeleteRequest](#deleterequest)
The final request inputs class | -| static class | [DeleteNullableRequest](#deletenullablerequest)
The initial request inputs class | -| static class | [Delete0RequestBuilder](#delete0requestbuilder)
A builder for the request input class | -| static class | [DeleteRequestBuilder](#deleterequestbuilder)
A builder for the request input class | - -## Delete1 -public static class Delete1 extends ApiClient.ApiClient1 implements DeleteOperation
- -a class that allows one to call the endpoint using a method named delete - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.storeorderorderid.delete.PathParameters; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.storeorderorderid.delete.responses.Code400Response; -import org.openapijsonschematools.client.paths.storeorderorderid.delete.responses.Code404Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.storeorderorderid.Delete; -import org.openapijsonschematools.client.paths.storeorderorderid.delete.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Delete.Delete1 apiClient = new Delete.Delete1(apiConfiguration, schemaConfiguration); - - -// Map validation -PathParameters.PathParametersMap pathParameters = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .order_id("a") - - .build(), - schemaConfiguration -); - -var request = new DeleteRequestBuilder() - .pathParameters(pathParameters) - .build(); - -Void response; -try { - response = apiClient.delete(request); -} catch (Code400Response.ResponseApiException | Code404Response.ResponseApiException e) { - // server returned an error response defined in the openapi document - throw e; -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Delete1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | delete([DeleteRequest](#deleterequest) request) | - -## DeleteRequest -public static class DeleteRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [PathParameters.PathParametersMap](../../paths/storeorderorderid/delete/PathParameters.md#pathparametersmap) | pathParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## DeleteNullableRequest -public static class DeleteNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [PathParameters.@Nullable PathParametersMap](../../paths/storeorderorderid/delete/PathParameters.md#pathparametersmap) | pathParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| @Nullable Duration | timeout | - -## Delete0RequestBuilder -public static class Delete0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Delete0RequestBuilder(Delete0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [DeleteRequest](#deleterequest) | build()
Returns the request input used to call an endpoint method | -| [Delete0RequestBuilder](#delete0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Delete0RequestBuilder](#delete0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## DeleteRequestBuilder -public static class DeleteRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| DeleteRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Delete0RequestBuilder](#delete0requestbuilder) | pathParameters([PathParametersPathParametersMap](../../paths/storeorderorderid/delete/PathParameters.md#pathparametersmap) pathParameters)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/storeorderorderid/Get.md b/samples/client/petstore/java/docs/paths/storeorderorderid/Get.md deleted file mode 100644 index 89a0141de5f..00000000000 --- a/samples/client/petstore/java/docs/paths/storeorderorderid/Get.md +++ /dev/null @@ -1,182 +0,0 @@ -# Get - -public class Get - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Get1](#get1)
The class that has a get method to call the endpoint | -| static class | [GetRequest](#getrequest)
The final request inputs class | -| static class | [GetNullableRequest](#getnullablerequest)
The initial request inputs class | -| static class | [Get0RequestBuilder](#get0requestbuilder)
A builder for the request input class | -| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | - -## Get1 -public static class Get1 extends ApiClient.ApiClient1 implements GetOperation
- -a class that allows one to call the endpoint using a method named get - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.storeorderorderid.get.PathParameters; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.storeorderorderid.get.responses.Code200Response; -import org.openapijsonschematools.client.paths.storeorderorderid.get.responses.Code400Response; -import org.openapijsonschematools.client.paths.storeorderorderid.get.responses.Code404Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.storeorderorderid.Get; -import org.openapijsonschematools.client.paths.storeorderorderid.get.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Get.Get1 apiClient = new Get.Get1(apiConfiguration, schemaConfiguration); - - -// Map validation -PathParameters.PathParametersMap pathParameters = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .order_id(1L) - - .build(), - schemaConfiguration -); - -var request = new GetRequestBuilder() - .pathParameters(pathParameters) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.get(request); -} catch (Code400Response.ResponseApiException | Code404Response.ResponseApiException e) { - // server returned an error response defined in the openapi document - throw e; -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -if (castResponse.body instanceof Code200Response.ApplicationxmlResponseBody deserializedBody) { - // handle deserialized body here -} else { - Code200Response.ApplicationjsonResponseBody deserializedBody = (Code200Response.ApplicationjsonResponseBody) castResponse.body; - // handle deserialized body here -} -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/storeorderorderid/get/Responses.md#endpointresponse) | get([GetRequest](#getrequest) request) | - -## GetRequest -public static class GetRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [PathParameters.PathParametersMap](../../paths/storeorderorderid/get/PathParameters.md#pathparametersmap) | pathParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## GetNullableRequest -public static class GetNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [PathParameters.@Nullable PathParametersMap](../../paths/storeorderorderid/get/PathParameters.md#pathparametersmap) | pathParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| @Nullable Duration | timeout | - -## Get0RequestBuilder -public static class Get0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get0RequestBuilder(Get0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | -| [Get0RequestBuilder](#get0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Get0RequestBuilder](#get0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## GetRequestBuilder -public static class GetRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| GetRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Get0RequestBuilder](#get0requestbuilder) | pathParameters([PathParametersPathParametersMap](../../paths/storeorderorderid/get/PathParameters.md#pathparametersmap) pathParameters)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/storeorderorderid/StoreorderorderidDelete.md b/samples/client/petstore/java/docs/paths/storeorderorderid/StoreorderorderidDelete.md new file mode 100644 index 00000000000..31530aa7b7c --- /dev/null +++ b/samples/client/petstore/java/docs/paths/storeorderorderid/StoreorderorderidDelete.md @@ -0,0 +1,185 @@ +# StoreorderorderidDelete + +public class StoreorderorderidDelete + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Delete](#delete)
The class that has a delete method to call the endpoint | +| interface | [DeleteOrderOperation](#deleteorderoperation)
The interface that has a deleteOrder method to call the endpoint | +| static class | [DeleteRequest](#deleterequest)
The final request inputs class | +| static class | [DeleteNullableRequest](#deletenullablerequest)
The initial request inputs class | +| static class | [Delete0RequestBuilder](#delete0requestbuilder)
A builder for the request input class | +| static class | [DeleteRequestBuilder](#deleterequestbuilder)
A builder for the request input class | + +## Delete +public static class Delete extends ApiClient.ApiClient1 implements DeleteOperation
+ +a class that allows one to call the endpoint using a method named delete + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.storeorderorderid.delete.StoreorderorderidDeletePathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.storeorderorderid.delete.responses.StoreorderorderidDeleteCode400Response; +import org.openapijsonschematools.client.paths.storeorderorderid.delete.responses.StoreorderorderidDeleteCode404Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.storeorderorderid.StoreorderorderidDelete; +import org.openapijsonschematools.client.paths.storeorderorderid.delete.StoreorderorderidDeleteResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +StoreorderorderidDelete.Delete apiClient = new StoreorderorderidDelete.Delete(apiConfiguration, schemaConfiguration); + + +// Map validation +StoreorderorderidDeletePathParameters.StoreorderorderidDeletePathParametersMap pathParameters = + StoreorderorderidDeletePathParameters.StoreorderorderidDeletePathParameters1.validate( + new StoreorderorderidDeletePathParameters.StoreorderorderidDeletePathParametersMapBuilder() + .order_id("a") + + .build(), + schemaConfiguration +); + +var request = new StoreorderorderidDelete.DeleteRequestBuilder() + .pathParameters(pathParameters) + .build(); + +Void response; +try { + response = apiClient.delete(request); +} catch (StoreorderorderidDeleteCode400Response.ResponseApiException | StoreorderorderidDeleteCode404Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Delete(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | delete([DeleteRequest](#deleterequest) request) | + +## DeleteOrderOperation +public interface DeleteOrderOperation
+ +an interface that allows one to call the endpoint using a method named deleteOrder by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | deleteOrder([DeleteRequest](#deleterequest) request) | + +## DeleteRequest +public static class DeleteRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [StoreorderorderidDeletePathParameters.StoreorderorderidDeletePathParametersMap](../../paths/storeorderorderid/delete/StoreorderorderidDeletePathParameters.md#storeorderorderiddeletepathparametersmap) | pathParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## DeleteNullableRequest +public static class DeleteNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [StoreorderorderidDeletePathParameters.@Nullable StoreorderorderidDeletePathParametersMap](../../paths/storeorderorderid/delete/StoreorderorderidDeletePathParameters.md#storeorderorderiddeletepathparametersmap) | pathParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| @Nullable Duration | timeout | + +## Delete0RequestBuilder +public static class Delete0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Delete0RequestBuilder(Delete0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [DeleteRequest](#deleterequest) | build()
Returns the request input used to call an endpoint method | +| [Delete0RequestBuilder](#delete0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Delete0RequestBuilder](#delete0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## DeleteRequestBuilder +public static class DeleteRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| DeleteRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Delete0RequestBuilder](#delete0requestbuilder) | pathParameters([StoreorderorderidDeletePathParametersStoreorderorderidDeletePathParametersMap](../../paths/storeorderorderid/delete/StoreorderorderidDeletePathParameters.md#storeorderorderiddeletepathparametersmap) pathParameters)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/storeorderorderid/StoreorderorderidGet.md b/samples/client/petstore/java/docs/paths/storeorderorderid/StoreorderorderidGet.md new file mode 100644 index 00000000000..8bce1036e40 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/storeorderorderid/StoreorderorderidGet.md @@ -0,0 +1,193 @@ +# StoreorderorderidGet + +public class StoreorderorderidGet + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Get](#get)
The class that has a get method to call the endpoint | +| interface | [GetOrderByIdOperation](#getorderbyidoperation)
The interface that has a getOrderById method to call the endpoint | +| static class | [GetRequest](#getrequest)
The final request inputs class | +| static class | [GetNullableRequest](#getnullablerequest)
The initial request inputs class | +| static class | [Get0RequestBuilder](#get0requestbuilder)
A builder for the request input class | +| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | + +## Get +public static class Get extends ApiClient.ApiClient1 implements GetOperation
+ +a class that allows one to call the endpoint using a method named get + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.storeorderorderid.get.StoreorderorderidGetPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.storeorderorderid.get.responses.StoreorderorderidGetCode200Response; +import org.openapijsonschematools.client.paths.storeorderorderid.get.responses.StoreorderorderidGetCode400Response; +import org.openapijsonschematools.client.paths.storeorderorderid.get.responses.StoreorderorderidGetCode404Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.storeorderorderid.StoreorderorderidGet; +import org.openapijsonschematools.client.paths.storeorderorderid.get.StoreorderorderidGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +StoreorderorderidGet.Get apiClient = new StoreorderorderidGet.Get(apiConfiguration, schemaConfiguration); + + +// Map validation +StoreorderorderidGetPathParameters.StoreorderorderidGetPathParametersMap pathParameters = + StoreorderorderidGetPathParameters.StoreorderorderidGetPathParameters1.validate( + new StoreorderorderidGetPathParameters.StoreorderorderidGetPathParametersMapBuilder() + .order_id(1L) + + .build(), + schemaConfiguration +); + +var request = new StoreorderorderidGet.GetRequestBuilder() + .pathParameters(pathParameters) + .build(); + +StoreorderorderidGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (StoreorderorderidGetCode400Response.ResponseApiException | StoreorderorderidGetCode404Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +StoreorderorderidGetResponses.EndpointStoreorderorderidGetCode200Response castResponse = (StoreorderorderidGetResponses.EndpointStoreorderorderidGetCode200Response) response; +if (castResponse.body instanceof StoreorderorderidGetCode200Response.ApplicationxmlResponseBody deserializedBody) { + // handle deserialized body here +} else { + StoreorderorderidGetCode200Response.ApplicationjsonResponseBody deserializedBody = (StoreorderorderidGetCode200Response.ApplicationjsonResponseBody) castResponse.body; + // handle deserialized body here +} +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [StoreorderorderidGetResponses.EndpointResponse](../../paths/storeorderorderid/get/StoreorderorderidGetResponses.md#endpointresponse) | get([GetRequest](#getrequest) request) | + +## GetOrderByIdOperation +public interface GetOrderByIdOperation
+ +an interface that allows one to call the endpoint using a method named getOrderById by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [StoreorderorderidGetResponses.EndpointResponse](../../paths/storeorderorderid/get/StoreorderorderidGetResponses.md#endpointresponse) | getOrderById([GetRequest](#getrequest) request) | + +## GetRequest +public static class GetRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [StoreorderorderidGetPathParameters.StoreorderorderidGetPathParametersMap](../../paths/storeorderorderid/get/StoreorderorderidGetPathParameters.md#storeorderorderidgetpathparametersmap) | pathParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## GetNullableRequest +public static class GetNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [StoreorderorderidGetPathParameters.@Nullable StoreorderorderidGetPathParametersMap](../../paths/storeorderorderid/get/StoreorderorderidGetPathParameters.md#storeorderorderidgetpathparametersmap) | pathParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| @Nullable Duration | timeout | + +## Get0RequestBuilder +public static class Get0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get0RequestBuilder(Get0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | +| [Get0RequestBuilder](#get0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Get0RequestBuilder](#get0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## GetRequestBuilder +public static class GetRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| GetRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Get0RequestBuilder](#get0requestbuilder) | pathParameters([StoreorderorderidGetPathParametersStoreorderorderidGetPathParametersMap](../../paths/storeorderorderid/get/StoreorderorderidGetPathParameters.md#storeorderorderidgetpathparametersmap) pathParameters)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/storeorderorderid/delete/PathParameters.md b/samples/client/petstore/java/docs/paths/storeorderorderid/delete/PathParameters.md deleted file mode 100644 index 0708d9f7470..00000000000 --- a/samples/client/petstore/java/docs/paths/storeorderorderid/delete/PathParameters.md +++ /dev/null @@ -1,268 +0,0 @@ -# PathParameters -public class PathParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [PathParameters.PathParameters1Boxed](#pathparameters1boxed)
sealed interface for validated payloads | -| record | [PathParameters.PathParameters1BoxedMap](#pathparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.PathParameters1](#pathparameters1)
schema class | -| static class | [PathParameters.PathParametersMapBuilder](#pathparametersmapbuilder)
builder for Map payloads | -| static class | [PathParameters.PathParametersMap](#pathparametersmap)
output class for Map payloads | -| sealed interface | [PathParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [PathParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [PathParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [PathParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [PathParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [PathParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [PathParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.AdditionalProperties](#additionalproperties)
schema class | - -## PathParameters1Boxed -public sealed interface PathParameters1Boxed
-permits
-[PathParameters1BoxedMap](#pathparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## PathParameters1BoxedMap -public record PathParameters1BoxedMap
-implements [PathParameters1Boxed](#pathparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParameters1BoxedMap([PathParametersMap](#pathparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## PathParameters1 -public static class PathParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.storeorderorderid.delete.PathParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -PathParameters.PathParametersMap validatedPayload = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .order_id("a") - - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("order_id", [Schema0.Schema01.class](../../../paths/storeorderorderid/delete/parameters/parameter0/Schema0.md#schema01))
)
| -| Set | required = Set.of(
    "order_id"
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | validate([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1BoxedMap](#pathparameters1boxedmap) | validateAndBox([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1Boxed](#pathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## PathParametersMap0Builder -public class PathParametersMap0Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | - -## PathParametersMapBuilder -public class PathParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap0Builder](#pathparametersmap0builder) | order_id(String value) | - -## PathParametersMap -public static class PathParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [PathParametersMap](#pathparametersmap) | of([Map](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| String | order_id()
| - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/storeorderorderid/delete/Responses.md b/samples/client/petstore/java/docs/paths/storeorderorderid/delete/Responses.md deleted file mode 100644 index 5841efd5c37..00000000000 --- a/samples/client/petstore/java/docs/paths/storeorderorderid/delete/Responses.md +++ /dev/null @@ -1,10 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | - diff --git a/samples/client/petstore/java/docs/paths/storeorderorderid/delete/StoreorderorderidDeletePathParameters.md b/samples/client/petstore/java/docs/paths/storeorderorderid/delete/StoreorderorderidDeletePathParameters.md new file mode 100644 index 00000000000..b7a84fd1a77 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/storeorderorderid/delete/StoreorderorderidDeletePathParameters.md @@ -0,0 +1,268 @@ +# StoreorderorderidDeletePathParameters +public class StoreorderorderidDeletePathParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [StoreorderorderidDeletePathParameters.StoreorderorderidDeletePathParameters1Boxed](#storeorderorderiddeletepathparameters1boxed)
sealed interface for validated payloads | +| record | [StoreorderorderidDeletePathParameters.StoreorderorderidDeletePathParameters1BoxedMap](#storeorderorderiddeletepathparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [StoreorderorderidDeletePathParameters.StoreorderorderidDeletePathParameters1](#storeorderorderiddeletepathparameters1)
schema class | +| static class | [StoreorderorderidDeletePathParameters.StoreorderorderidDeletePathParametersMapBuilder](#storeorderorderiddeletepathparametersmapbuilder)
builder for Map payloads | +| static class | [StoreorderorderidDeletePathParameters.StoreorderorderidDeletePathParametersMap](#storeorderorderiddeletepathparametersmap)
output class for Map payloads | +| sealed interface | [StoreorderorderidDeletePathParameters.StoreorderorderidDeleteadditionalPropertiesBoxed](#storeorderorderiddeleteadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [StoreorderorderidDeletePathParameters.StoreorderorderidDeleteadditionalPropertiesBoxedVoid](#storeorderorderiddeleteadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [StoreorderorderidDeletePathParameters.StoreorderorderidDeleteadditionalPropertiesBoxedBoolean](#storeorderorderiddeleteadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [StoreorderorderidDeletePathParameters.StoreorderorderidDeleteadditionalPropertiesBoxedNumber](#storeorderorderiddeleteadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [StoreorderorderidDeletePathParameters.StoreorderorderidDeleteadditionalPropertiesBoxedString](#storeorderorderiddeleteadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [StoreorderorderidDeletePathParameters.StoreorderorderidDeleteadditionalPropertiesBoxedList](#storeorderorderiddeleteadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [StoreorderorderidDeletePathParameters.StoreorderorderidDeleteadditionalPropertiesBoxedMap](#storeorderorderiddeleteadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [StoreorderorderidDeletePathParameters.StoreorderorderidDeleteadditionalProperties](#storeorderorderiddeleteadditionalproperties)
schema class | + +## StoreorderorderidDeletePathParameters1Boxed +public sealed interface StoreorderorderidDeletePathParameters1Boxed
+permits
+[StoreorderorderidDeletePathParameters1BoxedMap](#storeorderorderiddeletepathparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## StoreorderorderidDeletePathParameters1BoxedMap +public record StoreorderorderidDeletePathParameters1BoxedMap
+implements [StoreorderorderidDeletePathParameters1Boxed](#storeorderorderiddeletepathparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| StoreorderorderidDeletePathParameters1BoxedMap([StoreorderorderidDeletePathParametersMap](#storeorderorderiddeletepathparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [StoreorderorderidDeletePathParametersMap](#storeorderorderiddeletepathparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## StoreorderorderidDeletePathParameters1 +public static class StoreorderorderidDeletePathParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.storeorderorderid.delete.StoreorderorderidDeletePathParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +StoreorderorderidDeletePathParameters.StoreorderorderidDeletePathParametersMap validatedPayload = + StoreorderorderidDeletePathParameters.StoreorderorderidDeletePathParameters1.validate( + new StoreorderorderidDeletePathParameters.StoreorderorderidDeletePathParametersMapBuilder() + .order_id("a") + + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("order_id", [Schema0.Schema01.class](../../../paths/storeorderorderid/delete/parameters/parameter0/Schema0.md#schema01))
)
| +| Set | required = Set.of(
    "order_id"
)
| +| Class | additionalProperties = [StoreorderorderidDeleteadditionalProperties.class](#storeorderorderiddeleteadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [StoreorderorderidDeletePathParametersMap](#storeorderorderiddeletepathparametersmap) | validate([Map<?, ?>](#storeorderorderiddeletepathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [StoreorderorderidDeletePathParameters1BoxedMap](#storeorderorderiddeletepathparameters1boxedmap) | validateAndBox([Map<?, ?>](#storeorderorderiddeletepathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [StoreorderorderidDeletePathParameters1Boxed](#storeorderorderiddeletepathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## StoreorderorderidDeletePathParametersMap0Builder +public class StoreorderorderidDeletePathParametersMap0Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| StoreorderorderidDeletePathParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | + +## StoreorderorderidDeletePathParametersMapBuilder +public class StoreorderorderidDeletePathParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| StoreorderorderidDeletePathParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [StoreorderorderidDeletePathParametersMap0Builder](#storeorderorderiddeletepathparametersmap0builder) | order_id(String value) | + +## StoreorderorderidDeletePathParametersMap +public static class StoreorderorderidDeletePathParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [StoreorderorderidDeletePathParametersMap](#storeorderorderiddeletepathparametersmap) | of([Map](#storeorderorderiddeletepathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| String | order_id()
| + +## StoreorderorderidDeleteadditionalPropertiesBoxed +public sealed interface StoreorderorderidDeleteadditionalPropertiesBoxed
+permits
+[StoreorderorderidDeleteadditionalPropertiesBoxedVoid](#storeorderorderiddeleteadditionalpropertiesboxedvoid), +[StoreorderorderidDeleteadditionalPropertiesBoxedBoolean](#storeorderorderiddeleteadditionalpropertiesboxedboolean), +[StoreorderorderidDeleteadditionalPropertiesBoxedNumber](#storeorderorderiddeleteadditionalpropertiesboxednumber), +[StoreorderorderidDeleteadditionalPropertiesBoxedString](#storeorderorderiddeleteadditionalpropertiesboxedstring), +[StoreorderorderidDeleteadditionalPropertiesBoxedList](#storeorderorderiddeleteadditionalpropertiesboxedlist), +[StoreorderorderidDeleteadditionalPropertiesBoxedMap](#storeorderorderiddeleteadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## StoreorderorderidDeleteadditionalPropertiesBoxedVoid +public record StoreorderorderidDeleteadditionalPropertiesBoxedVoid
+implements [StoreorderorderidDeleteadditionalPropertiesBoxed](#storeorderorderiddeleteadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| StoreorderorderidDeleteadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## StoreorderorderidDeleteadditionalPropertiesBoxedBoolean +public record StoreorderorderidDeleteadditionalPropertiesBoxedBoolean
+implements [StoreorderorderidDeleteadditionalPropertiesBoxed](#storeorderorderiddeleteadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| StoreorderorderidDeleteadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## StoreorderorderidDeleteadditionalPropertiesBoxedNumber +public record StoreorderorderidDeleteadditionalPropertiesBoxedNumber
+implements [StoreorderorderidDeleteadditionalPropertiesBoxed](#storeorderorderiddeleteadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| StoreorderorderidDeleteadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## StoreorderorderidDeleteadditionalPropertiesBoxedString +public record StoreorderorderidDeleteadditionalPropertiesBoxedString
+implements [StoreorderorderidDeleteadditionalPropertiesBoxed](#storeorderorderiddeleteadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| StoreorderorderidDeleteadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## StoreorderorderidDeleteadditionalPropertiesBoxedList +public record StoreorderorderidDeleteadditionalPropertiesBoxedList
+implements [StoreorderorderidDeleteadditionalPropertiesBoxed](#storeorderorderiddeleteadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| StoreorderorderidDeleteadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## StoreorderorderidDeleteadditionalPropertiesBoxedMap +public record StoreorderorderidDeleteadditionalPropertiesBoxedMap
+implements [StoreorderorderidDeleteadditionalPropertiesBoxed](#storeorderorderiddeleteadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| StoreorderorderidDeleteadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## StoreorderorderidDeleteadditionalProperties +public static class StoreorderorderidDeleteadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/storeorderorderid/delete/StoreorderorderidDeleteResponses.md b/samples/client/petstore/java/docs/paths/storeorderorderid/delete/StoreorderorderidDeleteResponses.md new file mode 100644 index 00000000000..e4447a09189 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/storeorderorderid/delete/StoreorderorderidDeleteResponses.md @@ -0,0 +1,10 @@ +# StoreorderorderidDeleteResponses + +public class StoreorderorderidDeleteResponses + +A class that contains necessary responses classes + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | + diff --git a/samples/client/petstore/java/docs/paths/storeorderorderid/delete/responses/Code400Response.md b/samples/client/petstore/java/docs/paths/storeorderorderid/delete/responses/Code400Response.md deleted file mode 100644 index 6f3af2df6d2..00000000000 --- a/samples/client/petstore/java/docs/paths/storeorderorderid/delete/responses/Code400Response.md +++ /dev/null @@ -1,32 +0,0 @@ -# Code400Response - -public class Code400Response - -A class that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code400Response.Code400Response1](#code400response1)
class that deserializes responses | - -## Code400Response1 -public static class Code400Response1
-extends ResponseDeserializer - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code400Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = MapUtils.makeMap(
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/storeorderorderid/delete/responses/Code404Response.md b/samples/client/petstore/java/docs/paths/storeorderorderid/delete/responses/Code404Response.md deleted file mode 100644 index ee00cd369a7..00000000000 --- a/samples/client/petstore/java/docs/paths/storeorderorderid/delete/responses/Code404Response.md +++ /dev/null @@ -1,32 +0,0 @@ -# Code404Response - -public class Code404Response - -A class that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code404Response.Code404Response1](#code404response1)
class that deserializes responses | - -## Code404Response1 -public static class Code404Response1
-extends ResponseDeserializer - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code404Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = MapUtils.makeMap(
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/storeorderorderid/delete/responses/StoreorderorderidDeleteCode400Response.md b/samples/client/petstore/java/docs/paths/storeorderorderid/delete/responses/StoreorderorderidDeleteCode400Response.md new file mode 100644 index 00000000000..75463df967c --- /dev/null +++ b/samples/client/petstore/java/docs/paths/storeorderorderid/delete/responses/StoreorderorderidDeleteCode400Response.md @@ -0,0 +1,32 @@ +# StoreorderorderidDeleteCode400Response + +public class StoreorderorderidDeleteCode400Response + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [StoreorderorderidDeleteCode400Response.StoreorderorderidDeleteCode400Response1](#storeorderorderiddeletecode400response1)
class that deserializes responses | + +## StoreorderorderidDeleteCode400Response1 +public static class StoreorderorderidDeleteCode400Response1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| StoreorderorderidDeleteCode400Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/storeorderorderid/delete/responses/StoreorderorderidDeleteCode404Response.md b/samples/client/petstore/java/docs/paths/storeorderorderid/delete/responses/StoreorderorderidDeleteCode404Response.md new file mode 100644 index 00000000000..2f0b5d4407c --- /dev/null +++ b/samples/client/petstore/java/docs/paths/storeorderorderid/delete/responses/StoreorderorderidDeleteCode404Response.md @@ -0,0 +1,32 @@ +# StoreorderorderidDeleteCode404Response + +public class StoreorderorderidDeleteCode404Response + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [StoreorderorderidDeleteCode404Response.StoreorderorderidDeleteCode404Response1](#storeorderorderiddeletecode404response1)
class that deserializes responses | + +## StoreorderorderidDeleteCode404Response1 +public static class StoreorderorderidDeleteCode404Response1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| StoreorderorderidDeleteCode404Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/storeorderorderid/get/PathParameters.md b/samples/client/petstore/java/docs/paths/storeorderorderid/get/PathParameters.md deleted file mode 100644 index a6522456207..00000000000 --- a/samples/client/petstore/java/docs/paths/storeorderorderid/get/PathParameters.md +++ /dev/null @@ -1,271 +0,0 @@ -# PathParameters -public class PathParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [PathParameters.PathParameters1Boxed](#pathparameters1boxed)
sealed interface for validated payloads | -| record | [PathParameters.PathParameters1BoxedMap](#pathparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.PathParameters1](#pathparameters1)
schema class | -| static class | [PathParameters.PathParametersMapBuilder](#pathparametersmapbuilder)
builder for Map payloads | -| static class | [PathParameters.PathParametersMap](#pathparametersmap)
output class for Map payloads | -| sealed interface | [PathParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [PathParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [PathParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [PathParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [PathParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [PathParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [PathParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.AdditionalProperties](#additionalproperties)
schema class | - -## PathParameters1Boxed -public sealed interface PathParameters1Boxed
-permits
-[PathParameters1BoxedMap](#pathparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## PathParameters1BoxedMap -public record PathParameters1BoxedMap
-implements [PathParameters1Boxed](#pathparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParameters1BoxedMap([PathParametersMap](#pathparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## PathParameters1 -public static class PathParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.storeorderorderid.get.PathParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -PathParameters.PathParametersMap validatedPayload = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .order_id(1L) - - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("order_id", [Schema0.Schema01.class](../../../paths/storeorderorderid/get/parameters/parameter0/Schema0.md#schema01))
)
| -| Set | required = Set.of(
    "order_id"
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | validate([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1BoxedMap](#pathparameters1boxedmap) | validateAndBox([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1Boxed](#pathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## PathParametersMap0Builder -public class PathParametersMap0Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | - -## PathParametersMapBuilder -public class PathParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap0Builder](#pathparametersmap0builder) | order_id(int value) | -| [PathParametersMap0Builder](#pathparametersmap0builder) | order_id(float value) | -| [PathParametersMap0Builder](#pathparametersmap0builder) | order_id(long value) | -| [PathParametersMap0Builder](#pathparametersmap0builder) | order_id(double value) | - -## PathParametersMap -public static class PathParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [PathParametersMap](#pathparametersmap) | of([Map](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| Number | order_id()
| - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/storeorderorderid/get/Responses.md b/samples/client/petstore/java/docs/paths/storeorderorderid/get/Responses.md deleted file mode 100644 index a0f644a0687..00000000000 --- a/samples/client/petstore/java/docs/paths/storeorderorderid/get/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/storeorderorderid/get/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/storeorderorderid/get/StoreorderorderidGetPathParameters.md b/samples/client/petstore/java/docs/paths/storeorderorderid/get/StoreorderorderidGetPathParameters.md new file mode 100644 index 00000000000..eb32ebb7478 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/storeorderorderid/get/StoreorderorderidGetPathParameters.md @@ -0,0 +1,271 @@ +# StoreorderorderidGetPathParameters +public class StoreorderorderidGetPathParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [StoreorderorderidGetPathParameters.StoreorderorderidGetPathParameters1Boxed](#storeorderorderidgetpathparameters1boxed)
sealed interface for validated payloads | +| record | [StoreorderorderidGetPathParameters.StoreorderorderidGetPathParameters1BoxedMap](#storeorderorderidgetpathparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [StoreorderorderidGetPathParameters.StoreorderorderidGetPathParameters1](#storeorderorderidgetpathparameters1)
schema class | +| static class | [StoreorderorderidGetPathParameters.StoreorderorderidGetPathParametersMapBuilder](#storeorderorderidgetpathparametersmapbuilder)
builder for Map payloads | +| static class | [StoreorderorderidGetPathParameters.StoreorderorderidGetPathParametersMap](#storeorderorderidgetpathparametersmap)
output class for Map payloads | +| sealed interface | [StoreorderorderidGetPathParameters.StoreorderorderidGetadditionalPropertiesBoxed](#storeorderorderidgetadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [StoreorderorderidGetPathParameters.StoreorderorderidGetadditionalPropertiesBoxedVoid](#storeorderorderidgetadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [StoreorderorderidGetPathParameters.StoreorderorderidGetadditionalPropertiesBoxedBoolean](#storeorderorderidgetadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [StoreorderorderidGetPathParameters.StoreorderorderidGetadditionalPropertiesBoxedNumber](#storeorderorderidgetadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [StoreorderorderidGetPathParameters.StoreorderorderidGetadditionalPropertiesBoxedString](#storeorderorderidgetadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [StoreorderorderidGetPathParameters.StoreorderorderidGetadditionalPropertiesBoxedList](#storeorderorderidgetadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [StoreorderorderidGetPathParameters.StoreorderorderidGetadditionalPropertiesBoxedMap](#storeorderorderidgetadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [StoreorderorderidGetPathParameters.StoreorderorderidGetadditionalProperties](#storeorderorderidgetadditionalproperties)
schema class | + +## StoreorderorderidGetPathParameters1Boxed +public sealed interface StoreorderorderidGetPathParameters1Boxed
+permits
+[StoreorderorderidGetPathParameters1BoxedMap](#storeorderorderidgetpathparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## StoreorderorderidGetPathParameters1BoxedMap +public record StoreorderorderidGetPathParameters1BoxedMap
+implements [StoreorderorderidGetPathParameters1Boxed](#storeorderorderidgetpathparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| StoreorderorderidGetPathParameters1BoxedMap([StoreorderorderidGetPathParametersMap](#storeorderorderidgetpathparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [StoreorderorderidGetPathParametersMap](#storeorderorderidgetpathparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## StoreorderorderidGetPathParameters1 +public static class StoreorderorderidGetPathParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.storeorderorderid.get.StoreorderorderidGetPathParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +StoreorderorderidGetPathParameters.StoreorderorderidGetPathParametersMap validatedPayload = + StoreorderorderidGetPathParameters.StoreorderorderidGetPathParameters1.validate( + new StoreorderorderidGetPathParameters.StoreorderorderidGetPathParametersMapBuilder() + .order_id(1L) + + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("order_id", [Schema0.Schema01.class](../../../paths/storeorderorderid/get/parameters/parameter0/Schema0.md#schema01))
)
| +| Set | required = Set.of(
    "order_id"
)
| +| Class | additionalProperties = [StoreorderorderidGetadditionalProperties.class](#storeorderorderidgetadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [StoreorderorderidGetPathParametersMap](#storeorderorderidgetpathparametersmap) | validate([Map<?, ?>](#storeorderorderidgetpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [StoreorderorderidGetPathParameters1BoxedMap](#storeorderorderidgetpathparameters1boxedmap) | validateAndBox([Map<?, ?>](#storeorderorderidgetpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [StoreorderorderidGetPathParameters1Boxed](#storeorderorderidgetpathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## StoreorderorderidGetPathParametersMap0Builder +public class StoreorderorderidGetPathParametersMap0Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| StoreorderorderidGetPathParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | + +## StoreorderorderidGetPathParametersMapBuilder +public class StoreorderorderidGetPathParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| StoreorderorderidGetPathParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [StoreorderorderidGetPathParametersMap0Builder](#storeorderorderidgetpathparametersmap0builder) | order_id(int value) | +| [StoreorderorderidGetPathParametersMap0Builder](#storeorderorderidgetpathparametersmap0builder) | order_id(float value) | +| [StoreorderorderidGetPathParametersMap0Builder](#storeorderorderidgetpathparametersmap0builder) | order_id(long value) | +| [StoreorderorderidGetPathParametersMap0Builder](#storeorderorderidgetpathparametersmap0builder) | order_id(double value) | + +## StoreorderorderidGetPathParametersMap +public static class StoreorderorderidGetPathParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [StoreorderorderidGetPathParametersMap](#storeorderorderidgetpathparametersmap) | of([Map](#storeorderorderidgetpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| Number | order_id()
| + +## StoreorderorderidGetadditionalPropertiesBoxed +public sealed interface StoreorderorderidGetadditionalPropertiesBoxed
+permits
+[StoreorderorderidGetadditionalPropertiesBoxedVoid](#storeorderorderidgetadditionalpropertiesboxedvoid), +[StoreorderorderidGetadditionalPropertiesBoxedBoolean](#storeorderorderidgetadditionalpropertiesboxedboolean), +[StoreorderorderidGetadditionalPropertiesBoxedNumber](#storeorderorderidgetadditionalpropertiesboxednumber), +[StoreorderorderidGetadditionalPropertiesBoxedString](#storeorderorderidgetadditionalpropertiesboxedstring), +[StoreorderorderidGetadditionalPropertiesBoxedList](#storeorderorderidgetadditionalpropertiesboxedlist), +[StoreorderorderidGetadditionalPropertiesBoxedMap](#storeorderorderidgetadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## StoreorderorderidGetadditionalPropertiesBoxedVoid +public record StoreorderorderidGetadditionalPropertiesBoxedVoid
+implements [StoreorderorderidGetadditionalPropertiesBoxed](#storeorderorderidgetadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| StoreorderorderidGetadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## StoreorderorderidGetadditionalPropertiesBoxedBoolean +public record StoreorderorderidGetadditionalPropertiesBoxedBoolean
+implements [StoreorderorderidGetadditionalPropertiesBoxed](#storeorderorderidgetadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| StoreorderorderidGetadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## StoreorderorderidGetadditionalPropertiesBoxedNumber +public record StoreorderorderidGetadditionalPropertiesBoxedNumber
+implements [StoreorderorderidGetadditionalPropertiesBoxed](#storeorderorderidgetadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| StoreorderorderidGetadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## StoreorderorderidGetadditionalPropertiesBoxedString +public record StoreorderorderidGetadditionalPropertiesBoxedString
+implements [StoreorderorderidGetadditionalPropertiesBoxed](#storeorderorderidgetadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| StoreorderorderidGetadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## StoreorderorderidGetadditionalPropertiesBoxedList +public record StoreorderorderidGetadditionalPropertiesBoxedList
+implements [StoreorderorderidGetadditionalPropertiesBoxed](#storeorderorderidgetadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| StoreorderorderidGetadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## StoreorderorderidGetadditionalPropertiesBoxedMap +public record StoreorderorderidGetadditionalPropertiesBoxedMap
+implements [StoreorderorderidGetadditionalPropertiesBoxed](#storeorderorderidgetadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| StoreorderorderidGetadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## StoreorderorderidGetadditionalProperties +public static class StoreorderorderidGetadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/storeorderorderid/get/StoreorderorderidGetResponses.md b/samples/client/petstore/java/docs/paths/storeorderorderid/get/StoreorderorderidGetResponses.md new file mode 100644 index 00000000000..307f363c7c5 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/storeorderorderid/get/StoreorderorderidGetResponses.md @@ -0,0 +1,29 @@ +# StoreorderorderidGetResponses + +public class StoreorderorderidGetResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointStoreorderorderidGetCode200Response](#endpointstoreorderorderidgetcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointStoreorderorderidGetCode200Response](#endpointstoreorderorderidgetcode200response) + +a sealed interface that stores endpoint responses + +## EndpointStoreorderorderidGetCode200Response +public record EndpointStoreorderorderidGetCode200Response( + HttpResponse response, + [StoreorderorderidGetCode200Response.SealedResponseBody](../../../paths/storeorderorderid/get/responses/StoreorderorderidGetCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/Code200Response.md deleted file mode 100644 index e1f587a4eb6..00000000000 --- a/samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/Code200Response.md +++ /dev/null @@ -1,123 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationxmlMediaType](#applicationxmlmediatype)
record storing schema + encoding for a specific contentType | -| record | [Code200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationxmlResponseBody](#applicationxmlresponsebody)
implements sealed interface to store response body | -| record | [Code200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationxmlMediaType](#applicationxmlmediatype), -[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationxmlMediaType -public record ApplicationxmlMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationxmlSchema.ApplicationxmlSchema1](../../../../paths/storeorderorderid/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md#applicationxmlschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationxmlMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationxmlSchema.ApplicationxmlSchema1](../../../../paths/storeorderorderid/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md#applicationxmlschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/storeorderorderid/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/storeorderorderid/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationxmlResponseBody](#applicationxmlresponsebody), -[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationxmlResponseBody -public record ApplicationxmlResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/xml" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationxmlResponseBody(ApplicationxmlSchema.[Order1Boxed](../../../../components/schemas/Order.md#order1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationxmlSchema.[Order1Boxed](../../../../components/schemas/Order.md#order1boxed) | body()
returns the body passed in in the constructor | -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.[Order1Boxed](../../../../components/schemas/Order.md#order1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.[Order1Boxed](../../../../components/schemas/Order.md#order1boxed) | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/xml", new [ApplicationxmlMediaType](#applicationxmlmediatype)()),
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/Code400Response.md b/samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/Code400Response.md deleted file mode 100644 index 6f3af2df6d2..00000000000 --- a/samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/Code400Response.md +++ /dev/null @@ -1,32 +0,0 @@ -# Code400Response - -public class Code400Response - -A class that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code400Response.Code400Response1](#code400response1)
class that deserializes responses | - -## Code400Response1 -public static class Code400Response1
-extends ResponseDeserializer - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code400Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = MapUtils.makeMap(
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/Code404Response.md b/samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/Code404Response.md deleted file mode 100644 index ee00cd369a7..00000000000 --- a/samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/Code404Response.md +++ /dev/null @@ -1,32 +0,0 @@ -# Code404Response - -public class Code404Response - -A class that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code404Response.Code404Response1](#code404response1)
class that deserializes responses | - -## Code404Response1 -public static class Code404Response1
-extends ResponseDeserializer - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code404Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = MapUtils.makeMap(
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/StoreorderorderidGetCode200Response.md b/samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/StoreorderorderidGetCode200Response.md new file mode 100644 index 00000000000..fe8b3a5b61d --- /dev/null +++ b/samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/StoreorderorderidGetCode200Response.md @@ -0,0 +1,123 @@ +# StoreorderorderidGetCode200Response + +public class StoreorderorderidGetCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [StoreorderorderidGetCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [StoreorderorderidGetCode200Response.ApplicationxmlMediaType](#applicationxmlmediatype)
record storing schema + encoding for a specific contentType | +| record | [StoreorderorderidGetCode200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [StoreorderorderidGetCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [StoreorderorderidGetCode200Response.ApplicationxmlResponseBody](#applicationxmlresponsebody)
implements sealed interface to store response body | +| record | [StoreorderorderidGetCode200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [StoreorderorderidGetCode200Response.StoreorderorderidGetCode200Response1](#storeorderorderidgetcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationxmlMediaType](#applicationxmlmediatype), +[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationxmlMediaType +public record ApplicationxmlMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationxmlSchema.ApplicationxmlSchema1](../../../../paths/storeorderorderid/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md#applicationxmlschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationxmlMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationxmlSchema.ApplicationxmlSchema1](../../../../paths/storeorderorderid/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md#applicationxmlschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/storeorderorderid/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/storeorderorderid/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationxmlResponseBody](#applicationxmlresponsebody), +[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationxmlResponseBody +public record ApplicationxmlResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/xml" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationxmlResponseBody(ApplicationxmlSchema.[Order1Boxed](../../../../components/schemas/Order.md#order1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationxmlSchema.[Order1Boxed](../../../../components/schemas/Order.md#order1boxed) | body()
returns the body passed in in the constructor | +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.[Order1Boxed](../../../../components/schemas/Order.md#order1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.[Order1Boxed](../../../../components/schemas/Order.md#order1boxed) | body()
returns the body passed in in the constructor | + +## StoreorderorderidGetCode200Response1 +public static class StoreorderorderidGetCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| StoreorderorderidGetCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/xml", new [ApplicationxmlMediaType](#applicationxmlmediatype)()),
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/StoreorderorderidGetCode400Response.md b/samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/StoreorderorderidGetCode400Response.md new file mode 100644 index 00000000000..9abfdee4f94 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/StoreorderorderidGetCode400Response.md @@ -0,0 +1,32 @@ +# StoreorderorderidGetCode400Response + +public class StoreorderorderidGetCode400Response + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [StoreorderorderidGetCode400Response.StoreorderorderidGetCode400Response1](#storeorderorderidgetcode400response1)
class that deserializes responses | + +## StoreorderorderidGetCode400Response1 +public static class StoreorderorderidGetCode400Response1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| StoreorderorderidGetCode400Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/StoreorderorderidGetCode404Response.md b/samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/StoreorderorderidGetCode404Response.md new file mode 100644 index 00000000000..65dd947e134 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/storeorderorderid/get/responses/StoreorderorderidGetCode404Response.md @@ -0,0 +1,32 @@ +# StoreorderorderidGetCode404Response + +public class StoreorderorderidGetCode404Response + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [StoreorderorderidGetCode404Response.StoreorderorderidGetCode404Response1](#storeorderorderidgetcode404response1)
class that deserializes responses | + +## StoreorderorderidGetCode404Response1 +public static class StoreorderorderidGetCode404Response1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| StoreorderorderidGetCode404Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/user/Post.md b/samples/client/petstore/java/docs/paths/user/Post.md deleted file mode 100644 index 06bbac3ed12..00000000000 --- a/samples/client/petstore/java/docs/paths/user/Post.md +++ /dev/null @@ -1,188 +0,0 @@ -# Post - -public class Post - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Post1](#post1)
The class that has a post method to call the endpoint | -| static class | [PostRequest](#postrequest)
The final request inputs class | -| static class | [PostNullableRequest](#postnullablerequest)
The initial request inputs class | -| static class | [Post0RequestBuilder](#post0requestbuilder)
A builder for the request input class | -| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | - -## Post1 -public static class Post1 extends ApiClient.ApiClient1 implements PostOperation
- -a class that allows one to call the endpoint using a method named post - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.user.post.RequestBody; -import org.openapijsonschematools.client.components.schemas.User; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.user.post.responses.CodedefaultResponse; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.user.Post; -import org.openapijsonschematools.client.paths.user.post.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Post.Post1 apiClient = new Post.Post1(apiConfiguration, schemaConfiguration); - - -User1BoxedMap requestBodyPayload = - User.User1.validateAndBox( - new User.UserMapBuilder() - .id(1L) - - .username("a") - - .firstName("a") - - .lastName("a") - - .email("a") - - .password("a") - - .phone("a") - - .userStatus(1) - - .objectWithNoDeclaredPropsNullable(null) - - .build(), - schemaConfiguration -); -Post.SealedRequestBody requestBody = new Post.ApplicationjsonRequestBody(requestBodyPayload); - -var request = new PostRequestBuilder() - .requestBody(requestBody) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.post(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCodedefaultResponse castResponse = (Responses.EndpointCodedefaultResponse) response; -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/user/post/Responses.md#endpointresponse) | post([PostRequest](#postrequest) request) | - -## PostRequest -public static class PostRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.SealedRequestBody](../../paths/user/post/RequestBody.md#sealedrequestbody) | requestBody | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PostNullableRequest -public static class PostNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/user/post/RequestBody.md#sealedrequestbody) | requestBody | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| @Nullable Duration | timeout | - -## Post0RequestBuilder -public static class Post0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post0RequestBuilder(Post0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | -| [Post0RequestBuilder](#post0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Post0RequestBuilder](#post0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## PostRequestBuilder -public static class PostRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PostRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Post0RequestBuilder](#post0requestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/user/post/RequestBody.md#sealedrequestbody) requestBody)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/user/UserPost.md b/samples/client/petstore/java/docs/paths/user/UserPost.md new file mode 100644 index 00000000000..326411e49b4 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/user/UserPost.md @@ -0,0 +1,199 @@ +# UserPost + +public class UserPost + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Post](#post)
The class that has a post method to call the endpoint | +| interface | [CreateUserOperation](#createuseroperation)
The interface that has a createUser method to call the endpoint | +| static class | [PostRequest](#postrequest)
The final request inputs class | +| static class | [PostNullableRequest](#postnullablerequest)
The initial request inputs class | +| static class | [Post0RequestBuilder](#post0requestbuilder)
A builder for the request input class | +| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | + +## Post +public static class Post extends ApiClient.ApiClient1 implements PostOperation
+ +a class that allows one to call the endpoint using a method named post + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.user.post.UserPostRequestBody; +import org.openapijsonschematools.client.components.schemas.User; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.user.post.responses.UserPostCodedefaultResponse; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.user.UserPost; +import org.openapijsonschematools.client.paths.user.post.UserPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +UserPost.Post apiClient = new UserPost.Post(apiConfiguration, schemaConfiguration); + + +User1BoxedMap requestBodyPayload = + User.User1.validateAndBox( + new User.UserMapBuilder() + .id(1L) + + .username("a") + + .firstName("a") + + .lastName("a") + + .email("a") + + .password("a") + + .phone("a") + + .userStatus(1) + + .objectWithNoDeclaredPropsNullable(null) + + .build(), + schemaConfiguration +); +UserPost.SealedRequestBody requestBody = new UserPost.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new UserPost.PostRequestBuilder() + .requestBody(requestBody) + .build(); + +UserPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +UserPostResponses.EndpointUserPostCodedefaultResponse castResponse = (UserPostResponses.EndpointUserPostCodedefaultResponse) response; +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserPostResponses.EndpointResponse](../../paths/user/post/UserPostResponses.md#endpointresponse) | post([PostRequest](#postrequest) request) | + +## CreateUserOperation +public interface CreateUserOperation
+ +an interface that allows one to call the endpoint using a method named createUser by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserPostResponses.EndpointResponse](../../paths/user/post/UserPostResponses.md#endpointresponse) | createUser([PostRequest](#postrequest) request) | + +## PostRequest +public static class PostRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [UserPostRequestBody.SealedRequestBody](../../paths/user/post/UserPostRequestBody.md#sealedrequestbody) | requestBody | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PostNullableRequest +public static class PostNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [UserPostRequestBody.@Nullable SealedRequestBody](../../paths/user/post/UserPostRequestBody.md#sealedrequestbody) | requestBody | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| @Nullable Duration | timeout | + +## Post0RequestBuilder +public static class Post0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post0RequestBuilder(Post0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | +| [Post0RequestBuilder](#post0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Post0RequestBuilder](#post0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## PostRequestBuilder +public static class PostRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PostRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Post0RequestBuilder](#post0requestbuilder) | requestBody([UserPostRequestBody.SealedRequestBody](../../paths/user/post/UserPostRequestBody.md#sealedrequestbody) requestBody)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/user/post/RequestBody.md b/samples/client/petstore/java/docs/paths/user/post/RequestBody.md deleted file mode 100644 index 5717d3014a3..00000000000 --- a/samples/client/petstore/java/docs/paths/user/post/RequestBody.md +++ /dev/null @@ -1,90 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/user/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/user/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = true
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[ApplicationjsonRequestBody](#applicationjsonrequestbody) - -sealed interface that stores request contentType + validated schema data - -## ApplicationjsonRequestBody -public record ApplicationjsonRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonRequestBody(ApplicationjsonSchema.[User1Boxed](../../../components/schemas/User.md#user1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "application/json" | -| ApplicationjsonSchema.[User1Boxed](../../../components/schemas/User.md#user1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/user/post/Responses.md b/samples/client/petstore/java/docs/paths/user/post/Responses.md deleted file mode 100644 index abe0acf775e..00000000000 --- a/samples/client/petstore/java/docs/paths/user/post/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCodedefaultResponse](#endpointcodedefaultresponse)
the response for default | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCodedefaultResponse](#endpointcodedefaultresponse) - -a sealed interface that stores endpoint responses - -## EndpointCodedefaultResponse -public record EndpointCodedefaultResponse( - HttpResponse response, - Void body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/user/post/UserPostRequestBody.md b/samples/client/petstore/java/docs/paths/user/post/UserPostRequestBody.md new file mode 100644 index 00000000000..9d8ea2c758c --- /dev/null +++ b/samples/client/petstore/java/docs/paths/user/post/UserPostRequestBody.md @@ -0,0 +1,90 @@ +# UserPostRequestBody + +public class UserPostRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [UserPostRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [UserPostRequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| static class | [UserPostRequestBody.UserPostRequestBody1](#userpostrequestbody1)
class that serializes request bodies | +| sealed interface | [UserPostRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [UserPostRequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/user/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/user/post/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## UserPostRequestBody1 +public static class UserPostRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserPostRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = true
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[ApplicationjsonRequestBody](#applicationjsonrequestbody) + +sealed interface that stores request contentType + validated schema data + +## ApplicationjsonRequestBody +public record ApplicationjsonRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonRequestBody(ApplicationjsonSchema.[User1Boxed](../../../components/schemas/User.md#user1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "application/json" | +| ApplicationjsonSchema.[User1Boxed](../../../components/schemas/User.md#user1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/user/post/UserPostResponses.md b/samples/client/petstore/java/docs/paths/user/post/UserPostResponses.md new file mode 100644 index 00000000000..50ad602e72f --- /dev/null +++ b/samples/client/petstore/java/docs/paths/user/post/UserPostResponses.md @@ -0,0 +1,29 @@ +# UserPostResponses + +public class UserPostResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointUserPostCodedefaultResponse](#endpointuserpostcodedefaultresponse)
the response for default | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointUserPostCodedefaultResponse](#endpointuserpostcodedefaultresponse) + +a sealed interface that stores endpoint responses + +## EndpointUserPostCodedefaultResponse +public record EndpointUserPostCodedefaultResponse( + HttpResponse response, + Void body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/user/post/responses/CodedefaultResponse.md b/samples/client/petstore/java/docs/paths/user/post/responses/CodedefaultResponse.md deleted file mode 100644 index c2dd3d15c8b..00000000000 --- a/samples/client/petstore/java/docs/paths/user/post/responses/CodedefaultResponse.md +++ /dev/null @@ -1,32 +0,0 @@ -# CodedefaultResponse - -public class CodedefaultResponse - -A class that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [CodedefaultResponse.CodedefaultResponse1](#codedefaultresponse1)
class that deserializes responses | - -## CodedefaultResponse1 -public static class CodedefaultResponse1
-extends ResponseDeserializer - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| CodedefaultResponse1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = MapUtils.makeMap(
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/user/post/responses/UserPostCodedefaultResponse.md b/samples/client/petstore/java/docs/paths/user/post/responses/UserPostCodedefaultResponse.md new file mode 100644 index 00000000000..54d8a2d8398 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/user/post/responses/UserPostCodedefaultResponse.md @@ -0,0 +1,32 @@ +# UserPostCodedefaultResponse + +public class UserPostCodedefaultResponse + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [UserPostCodedefaultResponse.UserPostCodedefaultResponse1](#userpostcodedefaultresponse1)
class that deserializes responses | + +## UserPostCodedefaultResponse1 +public static class UserPostCodedefaultResponse1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserPostCodedefaultResponse1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/usercreatewitharray/Post.md b/samples/client/petstore/java/docs/paths/usercreatewitharray/Post.md deleted file mode 100644 index 006267d3476..00000000000 --- a/samples/client/petstore/java/docs/paths/usercreatewitharray/Post.md +++ /dev/null @@ -1,210 +0,0 @@ -# Post - -public class Post - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Post1](#post1)
The class that has a post method to call the endpoint | -| static class | [PostRequest](#postrequest)
The final request inputs class | -| static class | [PostNullableRequest](#postnullablerequest)
The initial request inputs class | -| static class | [Post0RequestBuilder](#post0requestbuilder)
A builder for the request input class | -| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | - -## Post1 -public static class Post1 extends ApiClient.ApiClient1 implements PostOperation
- -a class that allows one to call the endpoint using a method named post - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.usercreatewitharray.post.RequestBody; -import org.openapijsonschematools.client.components.requestbodies.userarray.content.applicationjson.ApplicationjsonSchema; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.usercreatewitharray.post.responses.CodedefaultResponse; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.usercreatewitharray.Post; -import org.openapijsonschematools.client.paths.usercreatewitharray.post.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Post.Post1 apiClient = new Post.Post1(apiConfiguration, schemaConfiguration); - - -ApplicationjsonSchema1BoxedList requestBodyPayload = - ApplicationjsonSchema.ApplicationjsonSchema1.validateAndBox( - new ApplicationjsonSchema.ApplicationjsonSchemaListBuilder() - .add( - MapUtils.makeMap( - new AbstractMap.SimpleEntry( - "id", - 1L - ), - new AbstractMap.SimpleEntry( - "username", - "a" - ), - new AbstractMap.SimpleEntry( - "firstName", - "a" - ), - new AbstractMap.SimpleEntry( - "lastName", - "a" - ), - new AbstractMap.SimpleEntry( - "email", - "a" - ), - new AbstractMap.SimpleEntry( - "password", - "a" - ), - new AbstractMap.SimpleEntry( - "phone", - "a" - ), - new AbstractMap.SimpleEntry( - "userStatus", - 1 - ), - new AbstractMap.SimpleEntry( - "objectWithNoDeclaredPropsNullable", - null - ) - ) - ) - .build(), - schemaConfiguration -); -RequestBody.SealedRequestBody requestBody = new RequestBody.ApplicationjsonRequestBody(requestBodyPayload); - -var request = new PostRequestBuilder() - .requestBody(requestBody) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.post(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCodedefaultResponse castResponse = (Responses.EndpointCodedefaultResponse) response; -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/usercreatewitharray/post/Responses.md#endpointresponse) | post([PostRequest](#postrequest) request) | - -## PostRequest -public static class PostRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.SealedRequestBody](../../paths/usercreatewitharray/post/RequestBody.md#sealedrequestbody) | requestBody | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PostNullableRequest -public static class PostNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/usercreatewitharray/post/RequestBody.md#sealedrequestbody) | requestBody | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| @Nullable Duration | timeout | - -## Post0RequestBuilder -public static class Post0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post0RequestBuilder(Post0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | -| [Post0RequestBuilder](#post0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Post0RequestBuilder](#post0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## PostRequestBuilder -public static class PostRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PostRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Post0RequestBuilder](#post0requestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/usercreatewitharray/post/RequestBody.md#sealedrequestbody) requestBody)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/usercreatewitharray/UsercreatewitharrayPost.md b/samples/client/petstore/java/docs/paths/usercreatewitharray/UsercreatewitharrayPost.md new file mode 100644 index 00000000000..2291468f4d3 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/usercreatewitharray/UsercreatewitharrayPost.md @@ -0,0 +1,221 @@ +# UsercreatewitharrayPost + +public class UsercreatewitharrayPost + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Post](#post)
The class that has a post method to call the endpoint | +| interface | [CreateUsersWithArrayInputOperation](#createuserswitharrayinputoperation)
The interface that has a createUsersWithArrayInput method to call the endpoint | +| static class | [PostRequest](#postrequest)
The final request inputs class | +| static class | [PostNullableRequest](#postnullablerequest)
The initial request inputs class | +| static class | [Post0RequestBuilder](#post0requestbuilder)
A builder for the request input class | +| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | + +## Post +public static class Post extends ApiClient.ApiClient1 implements PostOperation
+ +a class that allows one to call the endpoint using a method named post + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.usercreatewitharray.post.UsercreatewitharrayPostRequestBody; +import org.openapijsonschematools.client.components.requestbodies.userarray.content.applicationjson.ApplicationjsonSchema; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.usercreatewitharray.post.responses.UsercreatewitharrayPostCodedefaultResponse; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.usercreatewitharray.UsercreatewitharrayPost; +import org.openapijsonschematools.client.paths.usercreatewitharray.post.UsercreatewitharrayPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +UsercreatewitharrayPost.Post apiClient = new UsercreatewitharrayPost.Post(apiConfiguration, schemaConfiguration); + + +ApplicationjsonSchema1BoxedList requestBodyPayload = + ApplicationjsonSchema.ApplicationjsonSchema1.validateAndBox( + new ApplicationjsonSchema.ApplicationjsonSchemaListBuilder() + .add( + MapUtils.makeMap( + new AbstractMap.SimpleEntry( + "id", + 1L + ), + new AbstractMap.SimpleEntry( + "username", + "a" + ), + new AbstractMap.SimpleEntry( + "firstName", + "a" + ), + new AbstractMap.SimpleEntry( + "lastName", + "a" + ), + new AbstractMap.SimpleEntry( + "email", + "a" + ), + new AbstractMap.SimpleEntry( + "password", + "a" + ), + new AbstractMap.SimpleEntry( + "phone", + "a" + ), + new AbstractMap.SimpleEntry( + "userStatus", + 1 + ), + new AbstractMap.SimpleEntry( + "objectWithNoDeclaredPropsNullable", + null + ) + ) + ) + .build(), + schemaConfiguration +); +UsercreatewitharrayPostRequestBody.SealedRequestBody requestBody = new UsercreatewitharrayPostRequestBody.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new UsercreatewitharrayPost.PostRequestBuilder() + .requestBody(requestBody) + .build(); + +UsercreatewitharrayPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +UsercreatewitharrayPostResponses.EndpointUsercreatewitharrayPostCodedefaultResponse castResponse = (UsercreatewitharrayPostResponses.EndpointUsercreatewitharrayPostCodedefaultResponse) response; +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UsercreatewitharrayPostResponses.EndpointResponse](../../paths/usercreatewitharray/post/UsercreatewitharrayPostResponses.md#endpointresponse) | post([PostRequest](#postrequest) request) | + +## CreateUsersWithArrayInputOperation +public interface CreateUsersWithArrayInputOperation
+ +an interface that allows one to call the endpoint using a method named createUsersWithArrayInput by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UsercreatewitharrayPostResponses.EndpointResponse](../../paths/usercreatewitharray/post/UsercreatewitharrayPostResponses.md#endpointresponse) | createUsersWithArrayInput([PostRequest](#postrequest) request) | + +## PostRequest +public static class PostRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [UsercreatewitharrayPostRequestBody.SealedRequestBody](../../paths/usercreatewitharray/post/UsercreatewitharrayPostRequestBody.md#sealedrequestbody) | requestBody | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PostNullableRequest +public static class PostNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [UsercreatewitharrayPostRequestBody.@Nullable SealedRequestBody](../../paths/usercreatewitharray/post/UsercreatewitharrayPostRequestBody.md#sealedrequestbody) | requestBody | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| @Nullable Duration | timeout | + +## Post0RequestBuilder +public static class Post0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post0RequestBuilder(Post0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | +| [Post0RequestBuilder](#post0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Post0RequestBuilder](#post0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## PostRequestBuilder +public static class PostRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PostRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Post0RequestBuilder](#post0requestbuilder) | requestBody([UsercreatewitharrayPostRequestBody.SealedRequestBody](../../paths/usercreatewitharray/post/UsercreatewitharrayPostRequestBody.md#sealedrequestbody) requestBody)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/usercreatewitharray/post/RequestBody.md b/samples/client/petstore/java/docs/paths/usercreatewitharray/post/RequestBody.md deleted file mode 100644 index c3f2cf9f53e..00000000000 --- a/samples/client/petstore/java/docs/paths/usercreatewitharray/post/RequestBody.md +++ /dev/null @@ -1,17 +0,0 @@ -# RequestBody - -public class RequestBody extends [UserArray](../../../components/requestbodies/UserArray.md) - -A class (extended from the $ref class) that contains necessary nested request body classes -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | - -## RequestBody1 -public static class RequestBody1 extends [UserArray1](../../../components/requestbodies/UserArray.md#userarray1)
- -a class that serializes SealedRequestBody request bodies, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/usercreatewitharray/post/Responses.md b/samples/client/petstore/java/docs/paths/usercreatewitharray/post/Responses.md deleted file mode 100644 index abe0acf775e..00000000000 --- a/samples/client/petstore/java/docs/paths/usercreatewitharray/post/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCodedefaultResponse](#endpointcodedefaultresponse)
the response for default | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCodedefaultResponse](#endpointcodedefaultresponse) - -a sealed interface that stores endpoint responses - -## EndpointCodedefaultResponse -public record EndpointCodedefaultResponse( - HttpResponse response, - Void body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/usercreatewitharray/post/UsercreatewitharrayPostRequestBody.md b/samples/client/petstore/java/docs/paths/usercreatewitharray/post/UsercreatewitharrayPostRequestBody.md new file mode 100644 index 00000000000..b96ec049cfe --- /dev/null +++ b/samples/client/petstore/java/docs/paths/usercreatewitharray/post/UsercreatewitharrayPostRequestBody.md @@ -0,0 +1,17 @@ +# UsercreatewitharrayPostRequestBody + +public class UsercreatewitharrayPostRequestBody extends [UserArray](../../../components/requestbodies/UserArray.md) + +A class (extended from the $ref class) that contains necessary nested request body classes +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [UsercreatewitharrayPostRequestBody.UsercreatewitharrayPostRequestBody1](#usercreatewitharraypostrequestbody1)
class that serializes request bodies | + +## UsercreatewitharrayPostRequestBody1 +public static class UsercreatewitharrayPostRequestBody1 extends [UserArray1](../../../components/requestbodies/UserArray.md#userarray1)
+ +a class that serializes SealedRequestBody request bodies, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/usercreatewitharray/post/UsercreatewitharrayPostResponses.md b/samples/client/petstore/java/docs/paths/usercreatewitharray/post/UsercreatewitharrayPostResponses.md new file mode 100644 index 00000000000..c50e9f127c5 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/usercreatewitharray/post/UsercreatewitharrayPostResponses.md @@ -0,0 +1,29 @@ +# UsercreatewitharrayPostResponses + +public class UsercreatewitharrayPostResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointUsercreatewitharrayPostCodedefaultResponse](#endpointusercreatewitharraypostcodedefaultresponse)
the response for default | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointUsercreatewitharrayPostCodedefaultResponse](#endpointusercreatewitharraypostcodedefaultresponse) + +a sealed interface that stores endpoint responses + +## EndpointUsercreatewitharrayPostCodedefaultResponse +public record EndpointUsercreatewitharrayPostCodedefaultResponse( + HttpResponse response, + Void body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/usercreatewitharray/post/responses/CodedefaultResponse.md b/samples/client/petstore/java/docs/paths/usercreatewitharray/post/responses/CodedefaultResponse.md deleted file mode 100644 index c2dd3d15c8b..00000000000 --- a/samples/client/petstore/java/docs/paths/usercreatewitharray/post/responses/CodedefaultResponse.md +++ /dev/null @@ -1,32 +0,0 @@ -# CodedefaultResponse - -public class CodedefaultResponse - -A class that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [CodedefaultResponse.CodedefaultResponse1](#codedefaultresponse1)
class that deserializes responses | - -## CodedefaultResponse1 -public static class CodedefaultResponse1
-extends ResponseDeserializer - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| CodedefaultResponse1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = MapUtils.makeMap(
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/usercreatewitharray/post/responses/UsercreatewitharrayPostCodedefaultResponse.md b/samples/client/petstore/java/docs/paths/usercreatewitharray/post/responses/UsercreatewitharrayPostCodedefaultResponse.md new file mode 100644 index 00000000000..163464d78b5 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/usercreatewitharray/post/responses/UsercreatewitharrayPostCodedefaultResponse.md @@ -0,0 +1,32 @@ +# UsercreatewitharrayPostCodedefaultResponse + +public class UsercreatewitharrayPostCodedefaultResponse + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [UsercreatewitharrayPostCodedefaultResponse.UsercreatewitharrayPostCodedefaultResponse1](#usercreatewitharraypostcodedefaultresponse1)
class that deserializes responses | + +## UsercreatewitharrayPostCodedefaultResponse1 +public static class UsercreatewitharrayPostCodedefaultResponse1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UsercreatewitharrayPostCodedefaultResponse1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/usercreatewithlist/Post.md b/samples/client/petstore/java/docs/paths/usercreatewithlist/Post.md deleted file mode 100644 index 90b283456b3..00000000000 --- a/samples/client/petstore/java/docs/paths/usercreatewithlist/Post.md +++ /dev/null @@ -1,210 +0,0 @@ -# Post - -public class Post - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Post1](#post1)
The class that has a post method to call the endpoint | -| static class | [PostRequest](#postrequest)
The final request inputs class | -| static class | [PostNullableRequest](#postnullablerequest)
The initial request inputs class | -| static class | [Post0RequestBuilder](#post0requestbuilder)
A builder for the request input class | -| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | - -## Post1 -public static class Post1 extends ApiClient.ApiClient1 implements PostOperation
- -a class that allows one to call the endpoint using a method named post - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.usercreatewithlist.post.RequestBody; -import org.openapijsonschematools.client.components.requestbodies.userarray.content.applicationjson.ApplicationjsonSchema; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.usercreatewithlist.post.responses.CodedefaultResponse; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.usercreatewithlist.Post; -import org.openapijsonschematools.client.paths.usercreatewithlist.post.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Post.Post1 apiClient = new Post.Post1(apiConfiguration, schemaConfiguration); - - -ApplicationjsonSchema1BoxedList requestBodyPayload = - ApplicationjsonSchema.ApplicationjsonSchema1.validateAndBox( - new ApplicationjsonSchema.ApplicationjsonSchemaListBuilder() - .add( - MapUtils.makeMap( - new AbstractMap.SimpleEntry( - "id", - 1L - ), - new AbstractMap.SimpleEntry( - "username", - "a" - ), - new AbstractMap.SimpleEntry( - "firstName", - "a" - ), - new AbstractMap.SimpleEntry( - "lastName", - "a" - ), - new AbstractMap.SimpleEntry( - "email", - "a" - ), - new AbstractMap.SimpleEntry( - "password", - "a" - ), - new AbstractMap.SimpleEntry( - "phone", - "a" - ), - new AbstractMap.SimpleEntry( - "userStatus", - 1 - ), - new AbstractMap.SimpleEntry( - "objectWithNoDeclaredPropsNullable", - null - ) - ) - ) - .build(), - schemaConfiguration -); -RequestBody.SealedRequestBody requestBody = new RequestBody.ApplicationjsonRequestBody(requestBodyPayload); - -var request = new PostRequestBuilder() - .requestBody(requestBody) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.post(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCodedefaultResponse castResponse = (Responses.EndpointCodedefaultResponse) response; -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/usercreatewithlist/post/Responses.md#endpointresponse) | post([PostRequest](#postrequest) request) | - -## PostRequest -public static class PostRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.SealedRequestBody](../../paths/usercreatewithlist/post/RequestBody.md#sealedrequestbody) | requestBody | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PostNullableRequest -public static class PostNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/usercreatewithlist/post/RequestBody.md#sealedrequestbody) | requestBody | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| @Nullable Duration | timeout | - -## Post0RequestBuilder -public static class Post0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Post0RequestBuilder(Post0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | -| [Post0RequestBuilder](#post0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Post0RequestBuilder](#post0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## PostRequestBuilder -public static class PostRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PostRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Post0RequestBuilder](#post0requestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/usercreatewithlist/post/RequestBody.md#sealedrequestbody) requestBody)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/usercreatewithlist/UsercreatewithlistPost.md b/samples/client/petstore/java/docs/paths/usercreatewithlist/UsercreatewithlistPost.md new file mode 100644 index 00000000000..8eab60550b7 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/usercreatewithlist/UsercreatewithlistPost.md @@ -0,0 +1,221 @@ +# UsercreatewithlistPost + +public class UsercreatewithlistPost + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Post](#post)
The class that has a post method to call the endpoint | +| interface | [CreateUsersWithListInputOperation](#createuserswithlistinputoperation)
The interface that has a createUsersWithListInput method to call the endpoint | +| static class | [PostRequest](#postrequest)
The final request inputs class | +| static class | [PostNullableRequest](#postnullablerequest)
The initial request inputs class | +| static class | [Post0RequestBuilder](#post0requestbuilder)
A builder for the request input class | +| static class | [PostRequestBuilder](#postrequestbuilder)
A builder for the request input class | + +## Post +public static class Post extends ApiClient.ApiClient1 implements PostOperation
+ +a class that allows one to call the endpoint using a method named post + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.usercreatewithlist.post.UsercreatewithlistPostRequestBody; +import org.openapijsonschematools.client.components.requestbodies.userarray.content.applicationjson.ApplicationjsonSchema; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.usercreatewithlist.post.responses.UsercreatewithlistPostCodedefaultResponse; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.usercreatewithlist.UsercreatewithlistPost; +import org.openapijsonschematools.client.paths.usercreatewithlist.post.UsercreatewithlistPostResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +UsercreatewithlistPost.Post apiClient = new UsercreatewithlistPost.Post(apiConfiguration, schemaConfiguration); + + +ApplicationjsonSchema1BoxedList requestBodyPayload = + ApplicationjsonSchema.ApplicationjsonSchema1.validateAndBox( + new ApplicationjsonSchema.ApplicationjsonSchemaListBuilder() + .add( + MapUtils.makeMap( + new AbstractMap.SimpleEntry( + "id", + 1L + ), + new AbstractMap.SimpleEntry( + "username", + "a" + ), + new AbstractMap.SimpleEntry( + "firstName", + "a" + ), + new AbstractMap.SimpleEntry( + "lastName", + "a" + ), + new AbstractMap.SimpleEntry( + "email", + "a" + ), + new AbstractMap.SimpleEntry( + "password", + "a" + ), + new AbstractMap.SimpleEntry( + "phone", + "a" + ), + new AbstractMap.SimpleEntry( + "userStatus", + 1 + ), + new AbstractMap.SimpleEntry( + "objectWithNoDeclaredPropsNullable", + null + ) + ) + ) + .build(), + schemaConfiguration +); +UsercreatewithlistPostRequestBody.SealedRequestBody requestBody = new UsercreatewithlistPostRequestBody.ApplicationjsonRequestBody(requestBodyPayload); + +var request = new UsercreatewithlistPost.PostRequestBuilder() + .requestBody(requestBody) + .build(); + +UsercreatewithlistPostResponses.EndpointResponse response; +try { + response = apiClient.post(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +UsercreatewithlistPostResponses.EndpointUsercreatewithlistPostCodedefaultResponse castResponse = (UsercreatewithlistPostResponses.EndpointUsercreatewithlistPostCodedefaultResponse) response; +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UsercreatewithlistPostResponses.EndpointResponse](../../paths/usercreatewithlist/post/UsercreatewithlistPostResponses.md#endpointresponse) | post([PostRequest](#postrequest) request) | + +## CreateUsersWithListInputOperation +public interface CreateUsersWithListInputOperation
+ +an interface that allows one to call the endpoint using a method named createUsersWithListInput by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UsercreatewithlistPostResponses.EndpointResponse](../../paths/usercreatewithlist/post/UsercreatewithlistPostResponses.md#endpointresponse) | createUsersWithListInput([PostRequest](#postrequest) request) | + +## PostRequest +public static class PostRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [UsercreatewithlistPostRequestBody.SealedRequestBody](../../paths/usercreatewithlist/post/UsercreatewithlistPostRequestBody.md#sealedrequestbody) | requestBody | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PostNullableRequest +public static class PostNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [UsercreatewithlistPostRequestBody.@Nullable SealedRequestBody](../../paths/usercreatewithlist/post/UsercreatewithlistPostRequestBody.md#sealedrequestbody) | requestBody | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| @Nullable Duration | timeout | + +## Post0RequestBuilder +public static class Post0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Post0RequestBuilder(Post0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PostRequest](#postrequest) | build()
Returns the request input used to call an endpoint method | +| [Post0RequestBuilder](#post0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Post0RequestBuilder](#post0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## PostRequestBuilder +public static class PostRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PostRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Post0RequestBuilder](#post0requestbuilder) | requestBody([UsercreatewithlistPostRequestBody.SealedRequestBody](../../paths/usercreatewithlist/post/UsercreatewithlistPostRequestBody.md#sealedrequestbody) requestBody)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/usercreatewithlist/post/RequestBody.md b/samples/client/petstore/java/docs/paths/usercreatewithlist/post/RequestBody.md deleted file mode 100644 index 8a4cde3614a..00000000000 --- a/samples/client/petstore/java/docs/paths/usercreatewithlist/post/RequestBody.md +++ /dev/null @@ -1,17 +0,0 @@ -# RequestBody - -public class RequestBody extends [RefUserArray](../../../components/requestbodies/RefUserArray.md) - -A class (extended from the $ref class) that contains necessary nested request body classes -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | - -## RequestBody1 -public static class RequestBody1 extends [RefUserArray1](../../../components/requestbodies/RefUserArray.md#refuserarray1)
- -a class that serializes SealedRequestBody request bodies, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/usercreatewithlist/post/Responses.md b/samples/client/petstore/java/docs/paths/usercreatewithlist/post/Responses.md deleted file mode 100644 index abe0acf775e..00000000000 --- a/samples/client/petstore/java/docs/paths/usercreatewithlist/post/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCodedefaultResponse](#endpointcodedefaultresponse)
the response for default | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCodedefaultResponse](#endpointcodedefaultresponse) - -a sealed interface that stores endpoint responses - -## EndpointCodedefaultResponse -public record EndpointCodedefaultResponse( - HttpResponse response, - Void body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/usercreatewithlist/post/UsercreatewithlistPostRequestBody.md b/samples/client/petstore/java/docs/paths/usercreatewithlist/post/UsercreatewithlistPostRequestBody.md new file mode 100644 index 00000000000..872f7a38709 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/usercreatewithlist/post/UsercreatewithlistPostRequestBody.md @@ -0,0 +1,17 @@ +# UsercreatewithlistPostRequestBody + +public class UsercreatewithlistPostRequestBody extends [RefUserArray](../../../components/requestbodies/RefUserArray.md) + +A class (extended from the $ref class) that contains necessary nested request body classes +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [UsercreatewithlistPostRequestBody.UsercreatewithlistPostRequestBody1](#usercreatewithlistpostrequestbody1)
class that serializes request bodies | + +## UsercreatewithlistPostRequestBody1 +public static class UsercreatewithlistPostRequestBody1 extends [RefUserArray1](../../../components/requestbodies/RefUserArray.md#refuserarray1)
+ +a class that serializes SealedRequestBody request bodies, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/usercreatewithlist/post/UsercreatewithlistPostResponses.md b/samples/client/petstore/java/docs/paths/usercreatewithlist/post/UsercreatewithlistPostResponses.md new file mode 100644 index 00000000000..05dc4b47005 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/usercreatewithlist/post/UsercreatewithlistPostResponses.md @@ -0,0 +1,29 @@ +# UsercreatewithlistPostResponses + +public class UsercreatewithlistPostResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointUsercreatewithlistPostCodedefaultResponse](#endpointusercreatewithlistpostcodedefaultresponse)
the response for default | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointUsercreatewithlistPostCodedefaultResponse](#endpointusercreatewithlistpostcodedefaultresponse) + +a sealed interface that stores endpoint responses + +## EndpointUsercreatewithlistPostCodedefaultResponse +public record EndpointUsercreatewithlistPostCodedefaultResponse( + HttpResponse response, + Void body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/usercreatewithlist/post/responses/CodedefaultResponse.md b/samples/client/petstore/java/docs/paths/usercreatewithlist/post/responses/CodedefaultResponse.md deleted file mode 100644 index c2dd3d15c8b..00000000000 --- a/samples/client/petstore/java/docs/paths/usercreatewithlist/post/responses/CodedefaultResponse.md +++ /dev/null @@ -1,32 +0,0 @@ -# CodedefaultResponse - -public class CodedefaultResponse - -A class that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [CodedefaultResponse.CodedefaultResponse1](#codedefaultresponse1)
class that deserializes responses | - -## CodedefaultResponse1 -public static class CodedefaultResponse1
-extends ResponseDeserializer - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| CodedefaultResponse1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = MapUtils.makeMap(
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/usercreatewithlist/post/responses/UsercreatewithlistPostCodedefaultResponse.md b/samples/client/petstore/java/docs/paths/usercreatewithlist/post/responses/UsercreatewithlistPostCodedefaultResponse.md new file mode 100644 index 00000000000..35bfb7ff687 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/usercreatewithlist/post/responses/UsercreatewithlistPostCodedefaultResponse.md @@ -0,0 +1,32 @@ +# UsercreatewithlistPostCodedefaultResponse + +public class UsercreatewithlistPostCodedefaultResponse + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [UsercreatewithlistPostCodedefaultResponse.UsercreatewithlistPostCodedefaultResponse1](#usercreatewithlistpostcodedefaultresponse1)
class that deserializes responses | + +## UsercreatewithlistPostCodedefaultResponse1 +public static class UsercreatewithlistPostCodedefaultResponse1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UsercreatewithlistPostCodedefaultResponse1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/userlogin/Get.md b/samples/client/petstore/java/docs/paths/userlogin/Get.md deleted file mode 100644 index 54e6b3b874f..00000000000 --- a/samples/client/petstore/java/docs/paths/userlogin/Get.md +++ /dev/null @@ -1,184 +0,0 @@ -# Get - -public class Get - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Get1](#get1)
The class that has a get method to call the endpoint | -| static class | [GetRequest](#getrequest)
The final request inputs class | -| static class | [GetNullableRequest](#getnullablerequest)
The initial request inputs class | -| static class | [Get0RequestBuilder](#get0requestbuilder)
A builder for the request input class | -| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | - -## Get1 -public static class Get1 extends ApiClient.ApiClient1 implements GetOperation
- -a class that allows one to call the endpoint using a method named get - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.userlogin.get.QueryParameters; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.userlogin.get.responses.Code200Response; -import org.openapijsonschematools.client.paths.userlogin.get.responses.code200response.Code200ResponseHeadersSchema; -import org.openapijsonschematools.client.paths.userlogin.get.responses.Code400Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.userlogin.Get; -import org.openapijsonschematools.client.paths.userlogin.get.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Get.Get1 apiClient = new Get.Get1(apiConfiguration, schemaConfiguration); - - -// Map validation -QueryParameters.QueryParametersMap queryParameters = - QueryParameters.QueryParameters1.validate( - new QueryParameters.QueryParametersMapBuilder() - .password("a") - - .username("a") - - .build(), - schemaConfiguration -); - -var request = new GetRequestBuilder() - .queryParameters(queryParameters) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.get(request); -} catch (Code400Response.ResponseApiException e) { - // server returned an error response defined in the openapi document - throw e; -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -if (castResponse.body instanceof Code200Response.ApplicationxmlResponseBody deserializedBody) { - // handle deserialized body here -} else { - Code200Response.ApplicationjsonResponseBody deserializedBody = (Code200Response.ApplicationjsonResponseBody) castResponse.body; - // handle deserialized body here -} -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/userlogin/get/Responses.md#endpointresponse) | get([GetRequest](#getrequest) request) | - -## GetRequest -public static class GetRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [QueryParameters.QueryParametersMap](../../paths/userlogin/get/QueryParameters.md#queryparametersmap) | queryParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## GetNullableRequest -public static class GetNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [QueryParameters.@Nullable QueryParametersMap](../../paths/userlogin/get/QueryParameters.md#queryparametersmap) | queryParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| @Nullable Duration | timeout | - -## Get0RequestBuilder -public static class Get0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get0RequestBuilder(Get0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | -| [Get0RequestBuilder](#get0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Get0RequestBuilder](#get0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## GetRequestBuilder -public static class GetRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| GetRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Get0RequestBuilder](#get0requestbuilder) | queryParameters([QueryParametersQueryParametersMap](../../paths/userlogin/get/QueryParameters.md#queryparametersmap) queryParameters)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/userlogin/UserloginGet.md b/samples/client/petstore/java/docs/paths/userlogin/UserloginGet.md new file mode 100644 index 00000000000..8c68172aa07 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/userlogin/UserloginGet.md @@ -0,0 +1,195 @@ +# UserloginGet + +public class UserloginGet + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Get](#get)
The class that has a get method to call the endpoint | +| interface | [LoginUserOperation](#loginuseroperation)
The interface that has a loginUser method to call the endpoint | +| static class | [GetRequest](#getrequest)
The final request inputs class | +| static class | [GetNullableRequest](#getnullablerequest)
The initial request inputs class | +| static class | [Get0RequestBuilder](#get0requestbuilder)
A builder for the request input class | +| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | + +## Get +public static class Get extends ApiClient.ApiClient1 implements GetOperation
+ +a class that allows one to call the endpoint using a method named get + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.userlogin.get.UserloginGetQueryParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.userlogin.get.responses.UserloginGetCode200Response; +import org.openapijsonschematools.client.paths.userlogin.get.responses.code200response.UserloginGetCode200ResponseHeadersSchema; +import org.openapijsonschematools.client.paths.userlogin.get.responses.UserloginGetCode400Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.userlogin.UserloginGet; +import org.openapijsonschematools.client.paths.userlogin.get.UserloginGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +UserloginGet.Get apiClient = new UserloginGet.Get(apiConfiguration, schemaConfiguration); + + +// Map validation +UserloginGetQueryParameters.UserloginGetQueryParametersMap queryParameters = + UserloginGetQueryParameters.UserloginGetQueryParameters1.validate( + new UserloginGetQueryParameters.UserloginGetQueryParametersMapBuilder() + .password("a") + + .username("a") + + .build(), + schemaConfiguration +); + +var request = new UserloginGet.GetRequestBuilder() + .queryParameters(queryParameters) + .build(); + +UserloginGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (UserloginGetCode400Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +UserloginGetResponses.EndpointUserloginGetCode200Response castResponse = (UserloginGetResponses.EndpointUserloginGetCode200Response) response; +if (castResponse.body instanceof UserloginGetCode200Response.ApplicationxmlResponseBody deserializedBody) { + // handle deserialized body here +} else { + UserloginGetCode200Response.ApplicationjsonResponseBody deserializedBody = (UserloginGetCode200Response.ApplicationjsonResponseBody) castResponse.body; + // handle deserialized body here +} +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserloginGetResponses.EndpointResponse](../../paths/userlogin/get/UserloginGetResponses.md#endpointresponse) | get([GetRequest](#getrequest) request) | + +## LoginUserOperation +public interface LoginUserOperation
+ +an interface that allows one to call the endpoint using a method named loginUser by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserloginGetResponses.EndpointResponse](../../paths/userlogin/get/UserloginGetResponses.md#endpointresponse) | loginUser([GetRequest](#getrequest) request) | + +## GetRequest +public static class GetRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [UserloginGetQueryParameters.UserloginGetQueryParametersMap](../../paths/userlogin/get/UserloginGetQueryParameters.md#userlogingetqueryparametersmap) | queryParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## GetNullableRequest +public static class GetNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [UserloginGetQueryParameters.@Nullable UserloginGetQueryParametersMap](../../paths/userlogin/get/UserloginGetQueryParameters.md#userlogingetqueryparametersmap) | queryParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| @Nullable Duration | timeout | + +## Get0RequestBuilder +public static class Get0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get0RequestBuilder(Get0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | +| [Get0RequestBuilder](#get0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Get0RequestBuilder](#get0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## GetRequestBuilder +public static class GetRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| GetRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Get0RequestBuilder](#get0requestbuilder) | queryParameters([UserloginGetQueryParametersUserloginGetQueryParametersMap](../../paths/userlogin/get/UserloginGetQueryParameters.md#userlogingetqueryparametersmap) queryParameters)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/userlogin/get/QueryParameters.md b/samples/client/petstore/java/docs/paths/userlogin/get/QueryParameters.md deleted file mode 100644 index c6893bbeb8b..00000000000 --- a/samples/client/petstore/java/docs/paths/userlogin/get/QueryParameters.md +++ /dev/null @@ -1,304 +0,0 @@ -# QueryParameters -public class QueryParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [QueryParameters.QueryParameters1Boxed](#queryparameters1boxed)
sealed interface for validated payloads | -| record | [QueryParameters.QueryParameters1BoxedMap](#queryparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [QueryParameters.QueryParameters1](#queryparameters1)
schema class | -| static class | [QueryParameters.QueryParametersMapBuilder](#queryparametersmapbuilder)
builder for Map payloads | -| static class | [QueryParameters.QueryParametersMap](#queryparametersmap)
output class for Map payloads | -| sealed interface | [QueryParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [QueryParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [QueryParameters.AdditionalProperties](#additionalproperties)
schema class | - -## QueryParameters1Boxed -public sealed interface QueryParameters1Boxed
-permits
-[QueryParameters1BoxedMap](#queryparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## QueryParameters1BoxedMap -public record QueryParameters1BoxedMap
-implements [QueryParameters1Boxed](#queryparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParameters1BoxedMap([QueryParametersMap](#queryparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap](#queryparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## QueryParameters1 -public static class QueryParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.userlogin.get.QueryParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -QueryParameters.QueryParametersMap validatedPayload = - QueryParameters.QueryParameters1.validate( - new QueryParameters.QueryParametersMapBuilder() - .password("a") - - .username("a") - - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("password", [Schema1.Schema11.class](../../../paths/userlogin/get/parameters/parameter1/Schema1.md#schema11)),
    new PropertyEntry("username", [Schema0.Schema01.class](../../../paths/userlogin/get/parameters/parameter0/Schema0.md#schema01))
)
| -| Set | required = Set.of(
    "password",
    "username"
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap](#queryparametersmap) | validate([Map<?, ?>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [QueryParameters1BoxedMap](#queryparameters1boxedmap) | validateAndBox([Map<?, ?>](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [QueryParameters1Boxed](#queryparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## QueryParametersMap00Builder -public class QueryParametersMap00Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap00Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | - -## QueryParametersMap01Builder -public class QueryParametersMap01Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap01Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap00Builder](#queryparametersmap00builder) | username(String value) | - -## QueryParametersMap10Builder -public class QueryParametersMap10Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMap10Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap00Builder](#queryparametersmap00builder) | password(String value) | - -## QueryParametersMapBuilder -public class QueryParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| QueryParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [QueryParametersMap01Builder](#queryparametersmap01builder) | password(String value) | -| [QueryParametersMap10Builder](#queryparametersmap10builder) | username(String value) | - -## QueryParametersMap -public static class QueryParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [QueryParametersMap](#queryparametersmap) | of([Map](#queryparametersmapbuilder) arg, SchemaConfiguration configuration) | -| String | password()
| -| String | username()
| - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/userlogin/get/Responses.md b/samples/client/petstore/java/docs/paths/userlogin/get/Responses.md deleted file mode 100644 index 3fd3efa6dea..00000000000 --- a/samples/client/petstore/java/docs/paths/userlogin/get/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/userlogin/get/responses/Code200Response.md#sealedresponsebody) body, - [Code200ResponseHeadersSchema.Code200ResponseHeadersSchemaMap](../../../paths/userlogin/get/responses/code200response/Code200ResponseHeadersSchema.md#code200responseheadersschemamap) headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/userlogin/get/UserloginGetQueryParameters.md b/samples/client/petstore/java/docs/paths/userlogin/get/UserloginGetQueryParameters.md new file mode 100644 index 00000000000..5d116801e21 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/userlogin/get/UserloginGetQueryParameters.md @@ -0,0 +1,304 @@ +# UserloginGetQueryParameters +public class UserloginGetQueryParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [UserloginGetQueryParameters.UserloginGetQueryParameters1Boxed](#userlogingetqueryparameters1boxed)
sealed interface for validated payloads | +| record | [UserloginGetQueryParameters.UserloginGetQueryParameters1BoxedMap](#userlogingetqueryparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [UserloginGetQueryParameters.UserloginGetQueryParameters1](#userlogingetqueryparameters1)
schema class | +| static class | [UserloginGetQueryParameters.UserloginGetQueryParametersMapBuilder](#userlogingetqueryparametersmapbuilder)
builder for Map payloads | +| static class | [UserloginGetQueryParameters.UserloginGetQueryParametersMap](#userlogingetqueryparametersmap)
output class for Map payloads | +| sealed interface | [UserloginGetQueryParameters.UserloginGetadditionalPropertiesBoxed](#userlogingetadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [UserloginGetQueryParameters.UserloginGetadditionalPropertiesBoxedVoid](#userlogingetadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [UserloginGetQueryParameters.UserloginGetadditionalPropertiesBoxedBoolean](#userlogingetadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [UserloginGetQueryParameters.UserloginGetadditionalPropertiesBoxedNumber](#userlogingetadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [UserloginGetQueryParameters.UserloginGetadditionalPropertiesBoxedString](#userlogingetadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [UserloginGetQueryParameters.UserloginGetadditionalPropertiesBoxedList](#userlogingetadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [UserloginGetQueryParameters.UserloginGetadditionalPropertiesBoxedMap](#userlogingetadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [UserloginGetQueryParameters.UserloginGetadditionalProperties](#userlogingetadditionalproperties)
schema class | + +## UserloginGetQueryParameters1Boxed +public sealed interface UserloginGetQueryParameters1Boxed
+permits
+[UserloginGetQueryParameters1BoxedMap](#userlogingetqueryparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## UserloginGetQueryParameters1BoxedMap +public record UserloginGetQueryParameters1BoxedMap
+implements [UserloginGetQueryParameters1Boxed](#userlogingetqueryparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserloginGetQueryParameters1BoxedMap([UserloginGetQueryParametersMap](#userlogingetqueryparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserloginGetQueryParametersMap](#userlogingetqueryparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserloginGetQueryParameters1 +public static class UserloginGetQueryParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.userlogin.get.UserloginGetQueryParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +UserloginGetQueryParameters.UserloginGetQueryParametersMap validatedPayload = + UserloginGetQueryParameters.UserloginGetQueryParameters1.validate( + new UserloginGetQueryParameters.UserloginGetQueryParametersMapBuilder() + .password("a") + + .username("a") + + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("password", [Schema1.Schema11.class](../../../paths/userlogin/get/parameters/parameter1/Schema1.md#schema11)),
    new PropertyEntry("username", [Schema0.Schema01.class](../../../paths/userlogin/get/parameters/parameter0/Schema0.md#schema01))
)
| +| Set | required = Set.of(
    "password",
    "username"
)
| +| Class | additionalProperties = [UserloginGetadditionalProperties.class](#userlogingetadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserloginGetQueryParametersMap](#userlogingetqueryparametersmap) | validate([Map<?, ?>](#userlogingetqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [UserloginGetQueryParameters1BoxedMap](#userlogingetqueryparameters1boxedmap) | validateAndBox([Map<?, ?>](#userlogingetqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [UserloginGetQueryParameters1Boxed](#userlogingetqueryparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## UserloginGetQueryParametersMap00Builder +public class UserloginGetQueryParametersMap00Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserloginGetQueryParametersMap00Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | + +## UserloginGetQueryParametersMap01Builder +public class UserloginGetQueryParametersMap01Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserloginGetQueryParametersMap01Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserloginGetQueryParametersMap00Builder](#userlogingetqueryparametersmap00builder) | username(String value) | + +## UserloginGetQueryParametersMap10Builder +public class UserloginGetQueryParametersMap10Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserloginGetQueryParametersMap10Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserloginGetQueryParametersMap00Builder](#userlogingetqueryparametersmap00builder) | password(String value) | + +## UserloginGetQueryParametersMapBuilder +public class UserloginGetQueryParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserloginGetQueryParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserloginGetQueryParametersMap01Builder](#userlogingetqueryparametersmap01builder) | password(String value) | +| [UserloginGetQueryParametersMap10Builder](#userlogingetqueryparametersmap10builder) | username(String value) | + +## UserloginGetQueryParametersMap +public static class UserloginGetQueryParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [UserloginGetQueryParametersMap](#userlogingetqueryparametersmap) | of([Map](#userlogingetqueryparametersmapbuilder) arg, SchemaConfiguration configuration) | +| String | password()
| +| String | username()
| + +## UserloginGetadditionalPropertiesBoxed +public sealed interface UserloginGetadditionalPropertiesBoxed
+permits
+[UserloginGetadditionalPropertiesBoxedVoid](#userlogingetadditionalpropertiesboxedvoid), +[UserloginGetadditionalPropertiesBoxedBoolean](#userlogingetadditionalpropertiesboxedboolean), +[UserloginGetadditionalPropertiesBoxedNumber](#userlogingetadditionalpropertiesboxednumber), +[UserloginGetadditionalPropertiesBoxedString](#userlogingetadditionalpropertiesboxedstring), +[UserloginGetadditionalPropertiesBoxedList](#userlogingetadditionalpropertiesboxedlist), +[UserloginGetadditionalPropertiesBoxedMap](#userlogingetadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## UserloginGetadditionalPropertiesBoxedVoid +public record UserloginGetadditionalPropertiesBoxedVoid
+implements [UserloginGetadditionalPropertiesBoxed](#userlogingetadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserloginGetadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserloginGetadditionalPropertiesBoxedBoolean +public record UserloginGetadditionalPropertiesBoxedBoolean
+implements [UserloginGetadditionalPropertiesBoxed](#userlogingetadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserloginGetadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserloginGetadditionalPropertiesBoxedNumber +public record UserloginGetadditionalPropertiesBoxedNumber
+implements [UserloginGetadditionalPropertiesBoxed](#userlogingetadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserloginGetadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserloginGetadditionalPropertiesBoxedString +public record UserloginGetadditionalPropertiesBoxedString
+implements [UserloginGetadditionalPropertiesBoxed](#userlogingetadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserloginGetadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserloginGetadditionalPropertiesBoxedList +public record UserloginGetadditionalPropertiesBoxedList
+implements [UserloginGetadditionalPropertiesBoxed](#userlogingetadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserloginGetadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserloginGetadditionalPropertiesBoxedMap +public record UserloginGetadditionalPropertiesBoxedMap
+implements [UserloginGetadditionalPropertiesBoxed](#userlogingetadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserloginGetadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserloginGetadditionalProperties +public static class UserloginGetadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/userlogin/get/UserloginGetResponses.md b/samples/client/petstore/java/docs/paths/userlogin/get/UserloginGetResponses.md new file mode 100644 index 00000000000..2bec55a9491 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/userlogin/get/UserloginGetResponses.md @@ -0,0 +1,29 @@ +# UserloginGetResponses + +public class UserloginGetResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointUserloginGetCode200Response](#endpointuserlogingetcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointUserloginGetCode200Response](#endpointuserlogingetcode200response) + +a sealed interface that stores endpoint responses + +## EndpointUserloginGetCode200Response +public record EndpointUserloginGetCode200Response( + HttpResponse response, + [UserloginGetCode200Response.SealedResponseBody](../../../paths/userlogin/get/responses/UserloginGetCode200Response.md#sealedresponsebody) body, + [UserloginGetCode200ResponseHeadersSchema.UserloginGetCode200ResponseHeadersSchemaMap](../../../paths/userlogin/get/responses/code200response/UserloginGetCode200ResponseHeadersSchema.md#userlogingetcode200responseheadersschemamap) headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/userlogin/get/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/userlogin/get/responses/Code200Response.md deleted file mode 100644 index 0b06d1bdf31..00000000000 --- a/samples/client/petstore/java/docs/paths/userlogin/get/responses/Code200Response.md +++ /dev/null @@ -1,123 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationxmlMediaType](#applicationxmlmediatype)
record storing schema + encoding for a specific contentType | -| record | [Code200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationxmlResponseBody](#applicationxmlresponsebody)
implements sealed interface to store response body | -| record | [Code200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationxmlMediaType](#applicationxmlmediatype), -[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationxmlMediaType -public record ApplicationxmlMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationxmlSchema.ApplicationxmlSchema1](../../../../paths/userlogin/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md#applicationxmlschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationxmlMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationxmlSchema.ApplicationxmlSchema1](../../../../paths/userlogin/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md#applicationxmlschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/userlogin/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/userlogin/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationxmlResponseBody](#applicationxmlresponsebody), -[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationxmlResponseBody -public record ApplicationxmlResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/xml" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationxmlResponseBody(ApplicationxmlSchema.StringJsonSchema1Boxed body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationxmlSchema.StringJsonSchema1Boxed | body()
returns the body passed in in the constructor | -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.StringJsonSchema1Boxed body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.StringJsonSchema1Boxed | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), [Code200ResponseHeadersSchema.Code200ResponseHeadersSchemaMap](../../../../paths/userlogin/get/responses/code200response/Code200ResponseHeadersSchema.md#code200responseheadersschemamap), [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/xml", new [ApplicationxmlMediaType](#applicationxmlmediatype)()),
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), [Code200ResponseHeadersSchema.Code200ResponseHeadersSchemaMap](../../../../paths/userlogin/get/responses/code200response/Code200ResponseHeadersSchema.md#code200responseheadersschemamap)> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/userlogin/get/responses/Code400Response.md b/samples/client/petstore/java/docs/paths/userlogin/get/responses/Code400Response.md deleted file mode 100644 index 6f3af2df6d2..00000000000 --- a/samples/client/petstore/java/docs/paths/userlogin/get/responses/Code400Response.md +++ /dev/null @@ -1,32 +0,0 @@ -# Code400Response - -public class Code400Response - -A class that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code400Response.Code400Response1](#code400response1)
class that deserializes responses | - -## Code400Response1 -public static class Code400Response1
-extends ResponseDeserializer - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code400Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = MapUtils.makeMap(
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/userlogin/get/responses/UserloginGetCode200Response.md b/samples/client/petstore/java/docs/paths/userlogin/get/responses/UserloginGetCode200Response.md new file mode 100644 index 00000000000..14b2b09ab89 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/userlogin/get/responses/UserloginGetCode200Response.md @@ -0,0 +1,123 @@ +# UserloginGetCode200Response + +public class UserloginGetCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [UserloginGetCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [UserloginGetCode200Response.ApplicationxmlMediaType](#applicationxmlmediatype)
record storing schema + encoding for a specific contentType | +| record | [UserloginGetCode200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [UserloginGetCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [UserloginGetCode200Response.ApplicationxmlResponseBody](#applicationxmlresponsebody)
implements sealed interface to store response body | +| record | [UserloginGetCode200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [UserloginGetCode200Response.UserloginGetCode200Response1](#userlogingetcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationxmlMediaType](#applicationxmlmediatype), +[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationxmlMediaType +public record ApplicationxmlMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationxmlSchema.ApplicationxmlSchema1](../../../../paths/userlogin/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md#applicationxmlschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationxmlMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationxmlSchema.ApplicationxmlSchema1](../../../../paths/userlogin/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md#applicationxmlschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/userlogin/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/userlogin/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationxmlResponseBody](#applicationxmlresponsebody), +[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationxmlResponseBody +public record ApplicationxmlResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/xml" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationxmlResponseBody(ApplicationxmlSchema.StringJsonSchema1Boxed body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationxmlSchema.StringJsonSchema1Boxed | body()
returns the body passed in in the constructor | +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.StringJsonSchema1Boxed body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.StringJsonSchema1Boxed | body()
returns the body passed in in the constructor | + +## UserloginGetCode200Response1 +public static class UserloginGetCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), [UserloginGetCode200ResponseHeadersSchema.UserloginGetCode200ResponseHeadersSchemaMap](../../../../paths/userlogin/get/responses/code200response/UserloginGetCode200ResponseHeadersSchema.md#userlogingetcode200responseheadersschemamap), [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserloginGetCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/xml", new [ApplicationxmlMediaType](#applicationxmlmediatype)()),
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), [UserloginGetCode200ResponseHeadersSchema.UserloginGetCode200ResponseHeadersSchemaMap](../../../../paths/userlogin/get/responses/code200response/UserloginGetCode200ResponseHeadersSchema.md#userlogingetcode200responseheadersschemamap)> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/userlogin/get/responses/UserloginGetCode400Response.md b/samples/client/petstore/java/docs/paths/userlogin/get/responses/UserloginGetCode400Response.md new file mode 100644 index 00000000000..6e8fcff275c --- /dev/null +++ b/samples/client/petstore/java/docs/paths/userlogin/get/responses/UserloginGetCode400Response.md @@ -0,0 +1,32 @@ +# UserloginGetCode400Response + +public class UserloginGetCode400Response + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [UserloginGetCode400Response.UserloginGetCode400Response1](#userlogingetcode400response1)
class that deserializes responses | + +## UserloginGetCode400Response1 +public static class UserloginGetCode400Response1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserloginGetCode400Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/userlogin/get/responses/code200response/Code200ResponseHeadersSchema.md b/samples/client/petstore/java/docs/paths/userlogin/get/responses/code200response/Code200ResponseHeadersSchema.md deleted file mode 100644 index 508abc4d1a2..00000000000 --- a/samples/client/petstore/java/docs/paths/userlogin/get/responses/code200response/Code200ResponseHeadersSchema.md +++ /dev/null @@ -1,389 +0,0 @@ -# Code200ResponseHeadersSchema -public class Code200ResponseHeadersSchema
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [Code200ResponseHeadersSchema.Code200ResponseHeadersSchema1Boxed](#code200responseheadersschema1boxed)
sealed interface for validated payloads | -| record | [Code200ResponseHeadersSchema.Code200ResponseHeadersSchema1BoxedMap](#code200responseheadersschema1boxedmap)
boxed class to store validated Map payloads | -| static class | [Code200ResponseHeadersSchema.Code200ResponseHeadersSchema1](#code200responseheadersschema1)
schema class | -| static class | [Code200ResponseHeadersSchema.Code200ResponseHeadersSchemaMapBuilder](#code200responseheadersschemamapbuilder)
builder for Map payloads | -| static class | [Code200ResponseHeadersSchema.Code200ResponseHeadersSchemaMap](#code200responseheadersschemamap)
output class for Map payloads | -| sealed interface | [Code200ResponseHeadersSchema.Code200ResponseAdditionalPropertiesBoxed](#code200responseadditionalpropertiesboxed)
sealed interface for validated payloads | -| record | [Code200ResponseHeadersSchema.Code200ResponseAdditionalPropertiesBoxedVoid](#code200responseadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [Code200ResponseHeadersSchema.Code200ResponseAdditionalPropertiesBoxedBoolean](#code200responseadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [Code200ResponseHeadersSchema.Code200ResponseAdditionalPropertiesBoxedNumber](#code200responseadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [Code200ResponseHeadersSchema.Code200ResponseAdditionalPropertiesBoxedString](#code200responseadditionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [Code200ResponseHeadersSchema.Code200ResponseAdditionalPropertiesBoxedList](#code200responseadditionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [Code200ResponseHeadersSchema.Code200ResponseAdditionalPropertiesBoxedMap](#code200responseadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [Code200ResponseHeadersSchema.Code200ResponseAdditionalProperties](#code200responseadditionalproperties)
schema class | - -## Code200ResponseHeadersSchema1Boxed -public sealed interface Code200ResponseHeadersSchema1Boxed
-permits
-[Code200ResponseHeadersSchema1BoxedMap](#code200responseheadersschema1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## Code200ResponseHeadersSchema1BoxedMap -public record Code200ResponseHeadersSchema1BoxedMap
-implements [Code200ResponseHeadersSchema1Boxed](#code200responseheadersschema1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200ResponseHeadersSchema1BoxedMap([Code200ResponseHeadersSchemaMap](#code200responseheadersschemamap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Code200ResponseHeadersSchemaMap](#code200responseheadersschemamap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## Code200ResponseHeadersSchema1 -public static class Code200ResponseHeadersSchema1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.userlogin.get.responses.code200response.Code200ResponseHeadersSchema; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -Code200ResponseHeadersSchema.Code200ResponseHeadersSchemaMap validatedPayload = - Code200ResponseHeadersSchema.Code200ResponseHeadersSchema1.validate( - new Code200ResponseHeadersSchema.Code200ResponseHeadersSchemaMapBuilder() - .xHyphenMinusRateHyphenMinusLimit(1) - - .int32(1) - - .refHyphenMinusContentHyphenMinusSchemaHyphenMinusHeader("a") - - .xHyphenMinusExpiresHyphenMinusAfter("1970-01-01T00:00:00.00Z") - - .numberHeader("3.14") - - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("X-Rate-Limit", [XRateLimitSchema.XRateLimitSchema1.class](../../../../../paths/userlogin/get/responses/code200response/headers/xratelimit/content/applicationjson/XRateLimitSchema.md#xratelimitschema1)),
    new PropertyEntry("int32", [Int32JsonContentTypeHeaderSchema.Int32JsonContentTypeHeaderSchema1.class](../../../../../components/headers/int32jsoncontenttypeheader/content/applicationjson/Int32JsonContentTypeHeaderSchema.md#int32jsoncontenttypeheaderschema1)),
    new PropertyEntry("X-Expires-After", [XExpiresAfterSchema.XExpiresAfterSchema1.class](../../../../../paths/userlogin/get/responses/code200response/headers/xexpiresafter/XExpiresAfterSchema.md#xexpiresafterschema1)),
    new PropertyEntry("ref-content-schema-header", [StringWithValidation.StringWithValidation1.class](../../../../../components/schemas/StringWithValidation.md#stringwithvalidation1)),
    new PropertyEntry("numberHeader", [NumberHeaderSchema.NumberHeaderSchema1.class](../../../../../components/headers/numberheader/NumberHeaderSchema.md#numberheaderschema1))
)
| -| Set | required = Set.of(
    "X-Rate-Limit",
    "int32",
    "ref-content-schema-header"
)
| -| Class | additionalProperties = [Code200ResponseAdditionalProperties.class](#code200responseadditionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Code200ResponseHeadersSchemaMap](#code200responseheadersschemamap) | validate([Map<?, ?>](#code200responseheadersschemamapbuilder) arg, SchemaConfiguration configuration) | -| [Code200ResponseHeadersSchema1BoxedMap](#code200responseheadersschema1boxedmap) | validateAndBox([Map<?, ?>](#code200responseheadersschemamapbuilder) arg, SchemaConfiguration configuration) | -| [Code200ResponseHeadersSchema1Boxed](#code200responseheadersschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## Code200ResponseHeadersSchemaMap000Builder -public class Code200ResponseHeadersSchemaMap000Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200ResponseHeadersSchemaMap000Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | -| [Code200ResponseHeadersSchemaMap000Builder](#code200responseheadersschemamap000builder) | xHyphenMinusExpiresHyphenMinusAfter(String value) | -| [Code200ResponseHeadersSchemaMap000Builder](#code200responseheadersschemamap000builder) | numberHeader(String value) | - -## Code200ResponseHeadersSchemaMap001Builder -public class Code200ResponseHeadersSchemaMap001Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200ResponseHeadersSchemaMap001Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Code200ResponseHeadersSchemaMap000Builder](#code200responseheadersschemamap000builder) | refHyphenMinusContentHyphenMinusSchemaHyphenMinusHeader(String value) | - -## Code200ResponseHeadersSchemaMap010Builder -public class Code200ResponseHeadersSchemaMap010Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200ResponseHeadersSchemaMap010Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Code200ResponseHeadersSchemaMap000Builder](#code200responseheadersschemamap000builder) | int32(int value) | -| [Code200ResponseHeadersSchemaMap000Builder](#code200responseheadersschemamap000builder) | int32(float value) | - -## Code200ResponseHeadersSchemaMap011Builder -public class Code200ResponseHeadersSchemaMap011Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200ResponseHeadersSchemaMap011Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Code200ResponseHeadersSchemaMap001Builder](#code200responseheadersschemamap001builder) | int32(int value) | -| [Code200ResponseHeadersSchemaMap001Builder](#code200responseheadersschemamap001builder) | int32(float value) | -| [Code200ResponseHeadersSchemaMap010Builder](#code200responseheadersschemamap010builder) | refHyphenMinusContentHyphenMinusSchemaHyphenMinusHeader(String value) | - -## Code200ResponseHeadersSchemaMap100Builder -public class Code200ResponseHeadersSchemaMap100Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200ResponseHeadersSchemaMap100Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Code200ResponseHeadersSchemaMap000Builder](#code200responseheadersschemamap000builder) | xHyphenMinusRateHyphenMinusLimit(int value) | -| [Code200ResponseHeadersSchemaMap000Builder](#code200responseheadersschemamap000builder) | xHyphenMinusRateHyphenMinusLimit(float value) | - -## Code200ResponseHeadersSchemaMap101Builder -public class Code200ResponseHeadersSchemaMap101Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200ResponseHeadersSchemaMap101Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Code200ResponseHeadersSchemaMap001Builder](#code200responseheadersschemamap001builder) | xHyphenMinusRateHyphenMinusLimit(int value) | -| [Code200ResponseHeadersSchemaMap001Builder](#code200responseheadersschemamap001builder) | xHyphenMinusRateHyphenMinusLimit(float value) | -| [Code200ResponseHeadersSchemaMap100Builder](#code200responseheadersschemamap100builder) | refHyphenMinusContentHyphenMinusSchemaHyphenMinusHeader(String value) | - -## Code200ResponseHeadersSchemaMap110Builder -public class Code200ResponseHeadersSchemaMap110Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200ResponseHeadersSchemaMap110Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Code200ResponseHeadersSchemaMap010Builder](#code200responseheadersschemamap010builder) | xHyphenMinusRateHyphenMinusLimit(int value) | -| [Code200ResponseHeadersSchemaMap010Builder](#code200responseheadersschemamap010builder) | xHyphenMinusRateHyphenMinusLimit(float value) | -| [Code200ResponseHeadersSchemaMap100Builder](#code200responseheadersschemamap100builder) | int32(int value) | -| [Code200ResponseHeadersSchemaMap100Builder](#code200responseheadersschemamap100builder) | int32(float value) | - -## Code200ResponseHeadersSchemaMapBuilder -public class Code200ResponseHeadersSchemaMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200ResponseHeadersSchemaMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Code200ResponseHeadersSchemaMap011Builder](#code200responseheadersschemamap011builder) | xHyphenMinusRateHyphenMinusLimit(int value) | -| [Code200ResponseHeadersSchemaMap011Builder](#code200responseheadersschemamap011builder) | xHyphenMinusRateHyphenMinusLimit(float value) | -| [Code200ResponseHeadersSchemaMap101Builder](#code200responseheadersschemamap101builder) | int32(int value) | -| [Code200ResponseHeadersSchemaMap101Builder](#code200responseheadersschemamap101builder) | int32(float value) | -| [Code200ResponseHeadersSchemaMap110Builder](#code200responseheadersschemamap110builder) | refHyphenMinusContentHyphenMinusSchemaHyphenMinusHeader(String value) | - -## Code200ResponseHeadersSchemaMap -public static class Code200ResponseHeadersSchemaMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [Code200ResponseHeadersSchemaMap](#code200responseheadersschemamap) | of([Map](#code200responseheadersschemamapbuilder) arg, SchemaConfiguration configuration) | -| Number | int32()
| -| String | numberHeader()
[optional] | -| @Nullable Object | get(String key)
This schema has invalid Java names so this method must be used when you access instance["X-Rate-Limit"], instance["ref-content-schema-header"], instance["X-Expires-After"], | - -## Code200ResponseAdditionalPropertiesBoxed -public sealed interface Code200ResponseAdditionalPropertiesBoxed
-permits
-[Code200ResponseAdditionalPropertiesBoxedVoid](#code200responseadditionalpropertiesboxedvoid), -[Code200ResponseAdditionalPropertiesBoxedBoolean](#code200responseadditionalpropertiesboxedboolean), -[Code200ResponseAdditionalPropertiesBoxedNumber](#code200responseadditionalpropertiesboxednumber), -[Code200ResponseAdditionalPropertiesBoxedString](#code200responseadditionalpropertiesboxedstring), -[Code200ResponseAdditionalPropertiesBoxedList](#code200responseadditionalpropertiesboxedlist), -[Code200ResponseAdditionalPropertiesBoxedMap](#code200responseadditionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## Code200ResponseAdditionalPropertiesBoxedVoid -public record Code200ResponseAdditionalPropertiesBoxedVoid
-implements [Code200ResponseAdditionalPropertiesBoxed](#code200responseadditionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200ResponseAdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## Code200ResponseAdditionalPropertiesBoxedBoolean -public record Code200ResponseAdditionalPropertiesBoxedBoolean
-implements [Code200ResponseAdditionalPropertiesBoxed](#code200responseadditionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200ResponseAdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## Code200ResponseAdditionalPropertiesBoxedNumber -public record Code200ResponseAdditionalPropertiesBoxedNumber
-implements [Code200ResponseAdditionalPropertiesBoxed](#code200responseadditionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200ResponseAdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## Code200ResponseAdditionalPropertiesBoxedString -public record Code200ResponseAdditionalPropertiesBoxedString
-implements [Code200ResponseAdditionalPropertiesBoxed](#code200responseadditionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200ResponseAdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## Code200ResponseAdditionalPropertiesBoxedList -public record Code200ResponseAdditionalPropertiesBoxedList
-implements [Code200ResponseAdditionalPropertiesBoxed](#code200responseadditionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200ResponseAdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## Code200ResponseAdditionalPropertiesBoxedMap -public record Code200ResponseAdditionalPropertiesBoxedMap
-implements [Code200ResponseAdditionalPropertiesBoxed](#code200responseadditionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200ResponseAdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## Code200ResponseAdditionalProperties -public static class Code200ResponseAdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/userlogin/get/responses/code200response/UserloginGetCode200ResponseHeadersSchema.md b/samples/client/petstore/java/docs/paths/userlogin/get/responses/code200response/UserloginGetCode200ResponseHeadersSchema.md new file mode 100644 index 00000000000..e97c60a1e57 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/userlogin/get/responses/code200response/UserloginGetCode200ResponseHeadersSchema.md @@ -0,0 +1,389 @@ +# UserloginGetCode200ResponseHeadersSchema +public class UserloginGetCode200ResponseHeadersSchema
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [UserloginGetCode200ResponseHeadersSchema.UserloginGetCode200ResponseHeadersSchema1Boxed](#userlogingetcode200responseheadersschema1boxed)
sealed interface for validated payloads | +| record | [UserloginGetCode200ResponseHeadersSchema.UserloginGetCode200ResponseHeadersSchema1BoxedMap](#userlogingetcode200responseheadersschema1boxedmap)
boxed class to store validated Map payloads | +| static class | [UserloginGetCode200ResponseHeadersSchema.UserloginGetCode200ResponseHeadersSchema1](#userlogingetcode200responseheadersschema1)
schema class | +| static class | [UserloginGetCode200ResponseHeadersSchema.UserloginGetCode200ResponseHeadersSchemaMapBuilder](#userlogingetcode200responseheadersschemamapbuilder)
builder for Map payloads | +| static class | [UserloginGetCode200ResponseHeadersSchema.UserloginGetCode200ResponseHeadersSchemaMap](#userlogingetcode200responseheadersschemamap)
output class for Map payloads | +| sealed interface | [UserloginGetCode200ResponseHeadersSchema.UserloginGetCode200ResponseAdditionalPropertiesBoxed](#userlogingetcode200responseadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [UserloginGetCode200ResponseHeadersSchema.UserloginGetCode200ResponseAdditionalPropertiesBoxedVoid](#userlogingetcode200responseadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [UserloginGetCode200ResponseHeadersSchema.UserloginGetCode200ResponseAdditionalPropertiesBoxedBoolean](#userlogingetcode200responseadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [UserloginGetCode200ResponseHeadersSchema.UserloginGetCode200ResponseAdditionalPropertiesBoxedNumber](#userlogingetcode200responseadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [UserloginGetCode200ResponseHeadersSchema.UserloginGetCode200ResponseAdditionalPropertiesBoxedString](#userlogingetcode200responseadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [UserloginGetCode200ResponseHeadersSchema.UserloginGetCode200ResponseAdditionalPropertiesBoxedList](#userlogingetcode200responseadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [UserloginGetCode200ResponseHeadersSchema.UserloginGetCode200ResponseAdditionalPropertiesBoxedMap](#userlogingetcode200responseadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [UserloginGetCode200ResponseHeadersSchema.UserloginGetCode200ResponseAdditionalProperties](#userlogingetcode200responseadditionalproperties)
schema class | + +## UserloginGetCode200ResponseHeadersSchema1Boxed +public sealed interface UserloginGetCode200ResponseHeadersSchema1Boxed
+permits
+[UserloginGetCode200ResponseHeadersSchema1BoxedMap](#userlogingetcode200responseheadersschema1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## UserloginGetCode200ResponseHeadersSchema1BoxedMap +public record UserloginGetCode200ResponseHeadersSchema1BoxedMap
+implements [UserloginGetCode200ResponseHeadersSchema1Boxed](#userlogingetcode200responseheadersschema1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserloginGetCode200ResponseHeadersSchema1BoxedMap([UserloginGetCode200ResponseHeadersSchemaMap](#userlogingetcode200responseheadersschemamap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserloginGetCode200ResponseHeadersSchemaMap](#userlogingetcode200responseheadersschemamap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserloginGetCode200ResponseHeadersSchema1 +public static class UserloginGetCode200ResponseHeadersSchema1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.userlogin.get.responses.code200response.UserloginGetCode200ResponseHeadersSchema; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +UserloginGetCode200ResponseHeadersSchema.UserloginGetCode200ResponseHeadersSchemaMap validatedPayload = + UserloginGetCode200ResponseHeadersSchema.UserloginGetCode200ResponseHeadersSchema1.validate( + new UserloginGetCode200ResponseHeadersSchema.UserloginGetCode200ResponseHeadersSchemaMapBuilder() + .xHyphenMinusRateHyphenMinusLimit(1) + + .int32(1) + + .refHyphenMinusContentHyphenMinusSchemaHyphenMinusHeader("a") + + .xHyphenMinusExpiresHyphenMinusAfter("1970-01-01T00:00:00.00Z") + + .numberHeader("3.14") + + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("X-Rate-Limit", [XRateLimitSchema.XRateLimitSchema1.class](../../../../../paths/userlogin/get/responses/code200response/headers/xratelimit/content/applicationjson/XRateLimitSchema.md#xratelimitschema1)),
    new PropertyEntry("int32", [Int32JsonContentTypeHeaderSchema.Int32JsonContentTypeHeaderSchema1.class](../../../../../components/headers/int32jsoncontenttypeheader/content/applicationjson/Int32JsonContentTypeHeaderSchema.md#int32jsoncontenttypeheaderschema1)),
    new PropertyEntry("X-Expires-After", [XExpiresAfterSchema.XExpiresAfterSchema1.class](../../../../../paths/userlogin/get/responses/code200response/headers/xexpiresafter/XExpiresAfterSchema.md#xexpiresafterschema1)),
    new PropertyEntry("ref-content-schema-header", [StringWithValidation.StringWithValidation1.class](../../../../../components/schemas/StringWithValidation.md#stringwithvalidation1)),
    new PropertyEntry("numberHeader", [NumberHeaderSchema.NumberHeaderSchema1.class](../../../../../components/headers/numberheader/NumberHeaderSchema.md#numberheaderschema1))
)
| +| Set | required = Set.of(
    "X-Rate-Limit",
    "int32",
    "ref-content-schema-header"
)
| +| Class | additionalProperties = [UserloginGetCode200ResponseAdditionalProperties.class](#userlogingetcode200responseadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserloginGetCode200ResponseHeadersSchemaMap](#userlogingetcode200responseheadersschemamap) | validate([Map<?, ?>](#userlogingetcode200responseheadersschemamapbuilder) arg, SchemaConfiguration configuration) | +| [UserloginGetCode200ResponseHeadersSchema1BoxedMap](#userlogingetcode200responseheadersschema1boxedmap) | validateAndBox([Map<?, ?>](#userlogingetcode200responseheadersschemamapbuilder) arg, SchemaConfiguration configuration) | +| [UserloginGetCode200ResponseHeadersSchema1Boxed](#userlogingetcode200responseheadersschema1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## UserloginGetCode200ResponseHeadersSchemaMap000Builder +public class UserloginGetCode200ResponseHeadersSchemaMap000Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserloginGetCode200ResponseHeadersSchemaMap000Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | +| [UserloginGetCode200ResponseHeadersSchemaMap000Builder](#userlogingetcode200responseheadersschemamap000builder) | xHyphenMinusExpiresHyphenMinusAfter(String value) | +| [UserloginGetCode200ResponseHeadersSchemaMap000Builder](#userlogingetcode200responseheadersschemamap000builder) | numberHeader(String value) | + +## UserloginGetCode200ResponseHeadersSchemaMap001Builder +public class UserloginGetCode200ResponseHeadersSchemaMap001Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserloginGetCode200ResponseHeadersSchemaMap001Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserloginGetCode200ResponseHeadersSchemaMap000Builder](#userlogingetcode200responseheadersschemamap000builder) | refHyphenMinusContentHyphenMinusSchemaHyphenMinusHeader(String value) | + +## UserloginGetCode200ResponseHeadersSchemaMap010Builder +public class UserloginGetCode200ResponseHeadersSchemaMap010Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserloginGetCode200ResponseHeadersSchemaMap010Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserloginGetCode200ResponseHeadersSchemaMap000Builder](#userlogingetcode200responseheadersschemamap000builder) | int32(int value) | +| [UserloginGetCode200ResponseHeadersSchemaMap000Builder](#userlogingetcode200responseheadersschemamap000builder) | int32(float value) | + +## UserloginGetCode200ResponseHeadersSchemaMap011Builder +public class UserloginGetCode200ResponseHeadersSchemaMap011Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserloginGetCode200ResponseHeadersSchemaMap011Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserloginGetCode200ResponseHeadersSchemaMap001Builder](#userlogingetcode200responseheadersschemamap001builder) | int32(int value) | +| [UserloginGetCode200ResponseHeadersSchemaMap001Builder](#userlogingetcode200responseheadersschemamap001builder) | int32(float value) | +| [UserloginGetCode200ResponseHeadersSchemaMap010Builder](#userlogingetcode200responseheadersschemamap010builder) | refHyphenMinusContentHyphenMinusSchemaHyphenMinusHeader(String value) | + +## UserloginGetCode200ResponseHeadersSchemaMap100Builder +public class UserloginGetCode200ResponseHeadersSchemaMap100Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserloginGetCode200ResponseHeadersSchemaMap100Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserloginGetCode200ResponseHeadersSchemaMap000Builder](#userlogingetcode200responseheadersschemamap000builder) | xHyphenMinusRateHyphenMinusLimit(int value) | +| [UserloginGetCode200ResponseHeadersSchemaMap000Builder](#userlogingetcode200responseheadersschemamap000builder) | xHyphenMinusRateHyphenMinusLimit(float value) | + +## UserloginGetCode200ResponseHeadersSchemaMap101Builder +public class UserloginGetCode200ResponseHeadersSchemaMap101Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserloginGetCode200ResponseHeadersSchemaMap101Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserloginGetCode200ResponseHeadersSchemaMap001Builder](#userlogingetcode200responseheadersschemamap001builder) | xHyphenMinusRateHyphenMinusLimit(int value) | +| [UserloginGetCode200ResponseHeadersSchemaMap001Builder](#userlogingetcode200responseheadersschemamap001builder) | xHyphenMinusRateHyphenMinusLimit(float value) | +| [UserloginGetCode200ResponseHeadersSchemaMap100Builder](#userlogingetcode200responseheadersschemamap100builder) | refHyphenMinusContentHyphenMinusSchemaHyphenMinusHeader(String value) | + +## UserloginGetCode200ResponseHeadersSchemaMap110Builder +public class UserloginGetCode200ResponseHeadersSchemaMap110Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserloginGetCode200ResponseHeadersSchemaMap110Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserloginGetCode200ResponseHeadersSchemaMap010Builder](#userlogingetcode200responseheadersschemamap010builder) | xHyphenMinusRateHyphenMinusLimit(int value) | +| [UserloginGetCode200ResponseHeadersSchemaMap010Builder](#userlogingetcode200responseheadersschemamap010builder) | xHyphenMinusRateHyphenMinusLimit(float value) | +| [UserloginGetCode200ResponseHeadersSchemaMap100Builder](#userlogingetcode200responseheadersschemamap100builder) | int32(int value) | +| [UserloginGetCode200ResponseHeadersSchemaMap100Builder](#userlogingetcode200responseheadersschemamap100builder) | int32(float value) | + +## UserloginGetCode200ResponseHeadersSchemaMapBuilder +public class UserloginGetCode200ResponseHeadersSchemaMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserloginGetCode200ResponseHeadersSchemaMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserloginGetCode200ResponseHeadersSchemaMap011Builder](#userlogingetcode200responseheadersschemamap011builder) | xHyphenMinusRateHyphenMinusLimit(int value) | +| [UserloginGetCode200ResponseHeadersSchemaMap011Builder](#userlogingetcode200responseheadersschemamap011builder) | xHyphenMinusRateHyphenMinusLimit(float value) | +| [UserloginGetCode200ResponseHeadersSchemaMap101Builder](#userlogingetcode200responseheadersschemamap101builder) | int32(int value) | +| [UserloginGetCode200ResponseHeadersSchemaMap101Builder](#userlogingetcode200responseheadersschemamap101builder) | int32(float value) | +| [UserloginGetCode200ResponseHeadersSchemaMap110Builder](#userlogingetcode200responseheadersschemamap110builder) | refHyphenMinusContentHyphenMinusSchemaHyphenMinusHeader(String value) | + +## UserloginGetCode200ResponseHeadersSchemaMap +public static class UserloginGetCode200ResponseHeadersSchemaMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [UserloginGetCode200ResponseHeadersSchemaMap](#userlogingetcode200responseheadersschemamap) | of([Map](#userlogingetcode200responseheadersschemamapbuilder) arg, SchemaConfiguration configuration) | +| Number | int32()
| +| String | numberHeader()
[optional] | +| @Nullable Object | get(String key)
This schema has invalid Java names so this method must be used when you access instance["X-Rate-Limit"], instance["ref-content-schema-header"], instance["X-Expires-After"], | + +## UserloginGetCode200ResponseAdditionalPropertiesBoxed +public sealed interface UserloginGetCode200ResponseAdditionalPropertiesBoxed
+permits
+[UserloginGetCode200ResponseAdditionalPropertiesBoxedVoid](#userlogingetcode200responseadditionalpropertiesboxedvoid), +[UserloginGetCode200ResponseAdditionalPropertiesBoxedBoolean](#userlogingetcode200responseadditionalpropertiesboxedboolean), +[UserloginGetCode200ResponseAdditionalPropertiesBoxedNumber](#userlogingetcode200responseadditionalpropertiesboxednumber), +[UserloginGetCode200ResponseAdditionalPropertiesBoxedString](#userlogingetcode200responseadditionalpropertiesboxedstring), +[UserloginGetCode200ResponseAdditionalPropertiesBoxedList](#userlogingetcode200responseadditionalpropertiesboxedlist), +[UserloginGetCode200ResponseAdditionalPropertiesBoxedMap](#userlogingetcode200responseadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## UserloginGetCode200ResponseAdditionalPropertiesBoxedVoid +public record UserloginGetCode200ResponseAdditionalPropertiesBoxedVoid
+implements [UserloginGetCode200ResponseAdditionalPropertiesBoxed](#userlogingetcode200responseadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserloginGetCode200ResponseAdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserloginGetCode200ResponseAdditionalPropertiesBoxedBoolean +public record UserloginGetCode200ResponseAdditionalPropertiesBoxedBoolean
+implements [UserloginGetCode200ResponseAdditionalPropertiesBoxed](#userlogingetcode200responseadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserloginGetCode200ResponseAdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserloginGetCode200ResponseAdditionalPropertiesBoxedNumber +public record UserloginGetCode200ResponseAdditionalPropertiesBoxedNumber
+implements [UserloginGetCode200ResponseAdditionalPropertiesBoxed](#userlogingetcode200responseadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserloginGetCode200ResponseAdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserloginGetCode200ResponseAdditionalPropertiesBoxedString +public record UserloginGetCode200ResponseAdditionalPropertiesBoxedString
+implements [UserloginGetCode200ResponseAdditionalPropertiesBoxed](#userlogingetcode200responseadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserloginGetCode200ResponseAdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserloginGetCode200ResponseAdditionalPropertiesBoxedList +public record UserloginGetCode200ResponseAdditionalPropertiesBoxedList
+implements [UserloginGetCode200ResponseAdditionalPropertiesBoxed](#userlogingetcode200responseadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserloginGetCode200ResponseAdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserloginGetCode200ResponseAdditionalPropertiesBoxedMap +public record UserloginGetCode200ResponseAdditionalPropertiesBoxedMap
+implements [UserloginGetCode200ResponseAdditionalPropertiesBoxed](#userlogingetcode200responseadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserloginGetCode200ResponseAdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserloginGetCode200ResponseAdditionalProperties +public static class UserloginGetCode200ResponseAdditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/userlogin/get/responses/code200response/headers/xexpiresafter/Schema200Schema.md b/samples/client/petstore/java/docs/paths/userlogin/get/responses/code200response/headers/xexpiresafter/Schema200Schema.md deleted file mode 100644 index 190f86e0058..00000000000 --- a/samples/client/petstore/java/docs/paths/userlogin/get/responses/code200response/headers/xexpiresafter/Schema200Schema.md +++ /dev/null @@ -1,49 +0,0 @@ -# Schema200Schema -public class Schema200Schema
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [Schema200Schema.Schema200Schema1Boxed](#schema200schema1boxed)
sealed interface for validated payloads | -| record | [Schema200Schema.Schema200Schema1BoxedString](#schema200schema1boxedstring)
boxed class to store validated String payloads | -| static class | [Schema200Schema.Schema200Schema1](#schema200schema1)
schema class | - -## Schema200Schema1Boxed -public sealed interface Schema200Schema1Boxed
-permits
-[Schema200Schema1BoxedString](#schema200schema1boxedstring) - -sealed interface that stores validated payloads using boxed classes - -## Schema200Schema1BoxedString -public record Schema200Schema1BoxedString
-implements [Schema200Schema1Boxed](#schema200schema1boxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Schema200Schema1BoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## Schema200Schema1 -public static class Schema200Schema1
-extends DateTimeJsonSchema.DateTimeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.DateTimeJsonSchema.DateTimeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/userlogin/get/responses/code200response/headers/xratelimit/content/applicationjson/Schema200Schema.md b/samples/client/petstore/java/docs/paths/userlogin/get/responses/code200response/headers/xratelimit/content/applicationjson/Schema200Schema.md deleted file mode 100644 index 4bb062364ad..00000000000 --- a/samples/client/petstore/java/docs/paths/userlogin/get/responses/code200response/headers/xratelimit/content/applicationjson/Schema200Schema.md +++ /dev/null @@ -1,49 +0,0 @@ -# Schema200Schema -public class Schema200Schema
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [Schema200Schema.Schema200Schema1Boxed](#schema200schema1boxed)
sealed interface for validated payloads | -| record | [Schema200Schema.Schema200Schema1BoxedNumber](#schema200schema1boxednumber)
boxed class to store validated Number payloads | -| static class | [Schema200Schema.Schema200Schema1](#schema200schema1)
schema class | - -## Schema200Schema1Boxed -public sealed interface Schema200Schema1Boxed
-permits
-[Schema200Schema1BoxedNumber](#schema200schema1boxednumber) - -sealed interface that stores validated payloads using boxed classes - -## Schema200Schema1BoxedNumber -public record Schema200Schema1BoxedNumber
-implements [Schema200Schema1Boxed](#schema200schema1boxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Schema200Schema1BoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## Schema200Schema1 -public static class Schema200Schema1
-extends Int32JsonSchema.Int32JsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.Int32JsonSchema.Int32JsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/userlogout/Get.md b/samples/client/petstore/java/docs/paths/userlogout/Get.md deleted file mode 100644 index 8a32d82824d..00000000000 --- a/samples/client/petstore/java/docs/paths/userlogout/Get.md +++ /dev/null @@ -1,128 +0,0 @@ -# Get - -public class Get - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Get1](#get1)
The class that has a get method to call the endpoint | -| static class | [GetRequest](#getrequest)
The request inputs class | -| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | - -## Get1 -public static class Get1 extends ApiClient.ApiClient1 implements GetOperation
- -a class that allows one to call the endpoint using a method named get - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.userlogout.get.responses.CodedefaultResponse; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.userlogout.Get; -import org.openapijsonschematools.client.paths.userlogout.get.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Get.Get1 apiClient = new Get.Get1(apiConfiguration, schemaConfiguration); - - -var request = new GetRequestBuilder().build(); - -Responses.EndpointResponse response; -try { - response = apiClient.get(request); -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCodedefaultResponse castResponse = (Responses.EndpointCodedefaultResponse) response; -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/userlogout/get/Responses.md#endpointresponse) | get([GetRequest](#getrequest) request) | - -## GetRequest -public static class GetRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## GetRequestBuilder -public static class GetRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| GetRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | -| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/userlogout/UserlogoutGet.md b/samples/client/petstore/java/docs/paths/userlogout/UserlogoutGet.md new file mode 100644 index 00000000000..8e851da3eda --- /dev/null +++ b/samples/client/petstore/java/docs/paths/userlogout/UserlogoutGet.md @@ -0,0 +1,139 @@ +# UserlogoutGet + +public class UserlogoutGet + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Get](#get)
The class that has a get method to call the endpoint | +| interface | [LogoutUserOperation](#logoutuseroperation)
The interface that has a logoutUser method to call the endpoint | +| static class | [GetRequest](#getrequest)
The request inputs class | +| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | + +## Get +public static class Get extends ApiClient.ApiClient1 implements GetOperation
+ +a class that allows one to call the endpoint using a method named get + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.userlogout.get.responses.UserlogoutGetCodedefaultResponse; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.userlogout.UserlogoutGet; +import org.openapijsonschematools.client.paths.userlogout.get.UserlogoutGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +UserlogoutGet.Get apiClient = new UserlogoutGet.Get(apiConfiguration, schemaConfiguration); + + +var request = new UserlogoutGet.GetRequestBuilder().build(); + +UserlogoutGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +UserlogoutGetResponses.EndpointUserlogoutGetCodedefaultResponse castResponse = (UserlogoutGetResponses.EndpointUserlogoutGetCodedefaultResponse) response; +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserlogoutGetResponses.EndpointResponse](../../paths/userlogout/get/UserlogoutGetResponses.md#endpointresponse) | get([GetRequest](#getrequest) request) | + +## LogoutUserOperation +public interface LogoutUserOperation
+ +an interface that allows one to call the endpoint using a method named logoutUser by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserlogoutGetResponses.EndpointResponse](../../paths/userlogout/get/UserlogoutGetResponses.md#endpointresponse) | logoutUser([GetRequest](#getrequest) request) | + +## GetRequest +public static class GetRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## GetRequestBuilder +public static class GetRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| GetRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | +| [GetRequestBuilder](#getrequestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [GetRequestBuilder](#getrequestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/userlogout/get/Responses.md b/samples/client/petstore/java/docs/paths/userlogout/get/Responses.md deleted file mode 100644 index abe0acf775e..00000000000 --- a/samples/client/petstore/java/docs/paths/userlogout/get/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCodedefaultResponse](#endpointcodedefaultresponse)
the response for default | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCodedefaultResponse](#endpointcodedefaultresponse) - -a sealed interface that stores endpoint responses - -## EndpointCodedefaultResponse -public record EndpointCodedefaultResponse( - HttpResponse response, - Void body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/userlogout/get/UserlogoutGetResponses.md b/samples/client/petstore/java/docs/paths/userlogout/get/UserlogoutGetResponses.md new file mode 100644 index 00000000000..794cda537cb --- /dev/null +++ b/samples/client/petstore/java/docs/paths/userlogout/get/UserlogoutGetResponses.md @@ -0,0 +1,29 @@ +# UserlogoutGetResponses + +public class UserlogoutGetResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointUserlogoutGetCodedefaultResponse](#endpointuserlogoutgetcodedefaultresponse)
the response for default | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointUserlogoutGetCodedefaultResponse](#endpointuserlogoutgetcodedefaultresponse) + +a sealed interface that stores endpoint responses + +## EndpointUserlogoutGetCodedefaultResponse +public record EndpointUserlogoutGetCodedefaultResponse( + HttpResponse response, + Void body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/userlogout/get/responses/CodedefaultResponse.md b/samples/client/petstore/java/docs/paths/userlogout/get/responses/CodedefaultResponse.md deleted file mode 100644 index 6a7ba49992d..00000000000 --- a/samples/client/petstore/java/docs/paths/userlogout/get/responses/CodedefaultResponse.md +++ /dev/null @@ -1,17 +0,0 @@ -# CodedefaultResponse - -public class CodedefaultResponse extends [RefSuccessDescriptionOnly](../../components/responses/RefSuccessDescriptionOnly.md) - -A class (extended from the $ref class) that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [CodedefaultResponse.CodedefaultResponse1](#codedefaultresponse1)
class that deserializes responses | - -## CodedefaultResponse1 -public static class CodedefaultResponse1 extends [RefSuccessDescriptionOnly1](../../components/responses/RefSuccessDescriptionOnly.md#refsuccessdescriptiononly1)
- -a class that deserializes responses, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/userlogout/get/responses/UserlogoutGetCodedefaultResponse.md b/samples/client/petstore/java/docs/paths/userlogout/get/responses/UserlogoutGetCodedefaultResponse.md new file mode 100644 index 00000000000..7f34ffefe37 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/userlogout/get/responses/UserlogoutGetCodedefaultResponse.md @@ -0,0 +1,17 @@ +# UserlogoutGetCodedefaultResponse + +public class UserlogoutGetCodedefaultResponse extends [RefSuccessDescriptionOnly](../../components/responses/RefSuccessDescriptionOnly.md) + +A class (extended from the $ref class) that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [UserlogoutGetCodedefaultResponse.UserlogoutGetCodedefaultResponse1](#userlogoutgetcodedefaultresponse1)
class that deserializes responses | + +## UserlogoutGetCodedefaultResponse1 +public static class UserlogoutGetCodedefaultResponse1 extends [RefSuccessDescriptionOnly1](../../components/responses/RefSuccessDescriptionOnly.md#refsuccessdescriptiononly1)
+ +a class that deserializes responses, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/userusername/Delete.md b/samples/client/petstore/java/docs/paths/userusername/Delete.md deleted file mode 100644 index d9918ee712b..00000000000 --- a/samples/client/petstore/java/docs/paths/userusername/Delete.md +++ /dev/null @@ -1,175 +0,0 @@ -# Delete - -public class Delete - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Delete1](#delete1)
The class that has a delete method to call the endpoint | -| static class | [DeleteRequest](#deleterequest)
The final request inputs class | -| static class | [DeleteNullableRequest](#deletenullablerequest)
The initial request inputs class | -| static class | [Delete0RequestBuilder](#delete0requestbuilder)
A builder for the request input class | -| static class | [DeleteRequestBuilder](#deleterequestbuilder)
A builder for the request input class | - -## Delete1 -public static class Delete1 extends ApiClient.ApiClient1 implements DeleteOperation
- -a class that allows one to call the endpoint using a method named delete - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.userusername.delete.PathParameters; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.userusername.delete.responses.Code200Response; -import org.openapijsonschematools.client.paths.userusername.delete.responses.Code404Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.userusername.Delete; -import org.openapijsonschematools.client.paths.userusername.delete.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Delete.Delete1 apiClient = new Delete.Delete1(apiConfiguration, schemaConfiguration); - - -// Map validation -PathParameters.PathParametersMap pathParameters = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .username("a") - - .build(), - schemaConfiguration -); - -var request = new DeleteRequestBuilder() - .pathParameters(pathParameters) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.delete(request); -} catch (Code404Response.ResponseApiException e) { - // server returned an error response defined in the openapi document - throw e; -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Delete1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/userusername/delete/Responses.md#endpointresponse) | delete([DeleteRequest](#deleterequest) request) | - -## DeleteRequest -public static class DeleteRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [PathParameters.PathParametersMap](../../paths/userusername/delete/PathParameters.md#pathparametersmap) | pathParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## DeleteNullableRequest -public static class DeleteNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [PathParameters.@Nullable PathParametersMap](../../paths/userusername/delete/PathParameters.md#pathparametersmap) | pathParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| @Nullable Duration | timeout | - -## Delete0RequestBuilder -public static class Delete0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Delete0RequestBuilder(Delete0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [DeleteRequest](#deleterequest) | build()
Returns the request input used to call an endpoint method | -| [Delete0RequestBuilder](#delete0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Delete0RequestBuilder](#delete0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## DeleteRequestBuilder -public static class DeleteRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| DeleteRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Delete0RequestBuilder](#delete0requestbuilder) | pathParameters([PathParametersPathParametersMap](../../paths/userusername/delete/PathParameters.md#pathparametersmap) pathParameters)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/userusername/Get.md b/samples/client/petstore/java/docs/paths/userusername/Get.md deleted file mode 100644 index 00672634aab..00000000000 --- a/samples/client/petstore/java/docs/paths/userusername/Get.md +++ /dev/null @@ -1,182 +0,0 @@ -# Get - -public class Get - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Get1](#get1)
The class that has a get method to call the endpoint | -| static class | [GetRequest](#getrequest)
The final request inputs class | -| static class | [GetNullableRequest](#getnullablerequest)
The initial request inputs class | -| static class | [Get0RequestBuilder](#get0requestbuilder)
A builder for the request input class | -| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | - -## Get1 -public static class Get1 extends ApiClient.ApiClient1 implements GetOperation
- -a class that allows one to call the endpoint using a method named get - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.userusername.get.PathParameters; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.userusername.get.responses.Code200Response; -import org.openapijsonschematools.client.paths.userusername.get.responses.Code400Response; -import org.openapijsonschematools.client.paths.userusername.get.responses.Code404Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.userusername.Get; -import org.openapijsonschematools.client.paths.userusername.get.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Get.Get1 apiClient = new Get.Get1(apiConfiguration, schemaConfiguration); - - -// Map validation -PathParameters.PathParametersMap pathParameters = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .username("a") - - .build(), - schemaConfiguration -); - -var request = new GetRequestBuilder() - .pathParameters(pathParameters) - .build(); - -Responses.EndpointResponse response; -try { - response = apiClient.get(request); -} catch (Code400Response.ResponseApiException | Code404Response.ResponseApiException e) { - // server returned an error response defined in the openapi document - throw e; -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -Responses.EndpointCode200Response castResponse = (Responses.EndpointCode200Response) response; -if (castResponse.body instanceof Code200Response.ApplicationxmlResponseBody deserializedBody) { - // handle deserialized body here -} else { - Code200Response.ApplicationjsonResponseBody deserializedBody = (Code200Response.ApplicationjsonResponseBody) castResponse.body; - // handle deserialized body here -} -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Responses.EndpointResponse](../../paths/userusername/get/Responses.md#endpointresponse) | get([GetRequest](#getrequest) request) | - -## GetRequest -public static class GetRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [PathParameters.PathParametersMap](../../paths/userusername/get/PathParameters.md#pathparametersmap) | pathParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## GetNullableRequest -public static class GetNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [PathParameters.@Nullable PathParametersMap](../../paths/userusername/get/PathParameters.md#pathparametersmap) | pathParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| @Nullable Duration | timeout | - -## Get0RequestBuilder -public static class Get0RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Get0RequestBuilder(Get0RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | -| [Get0RequestBuilder](#get0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Get0RequestBuilder](#get0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## GetRequestBuilder -public static class GetRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| GetRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Get0RequestBuilder](#get0requestbuilder) | pathParameters([PathParametersPathParametersMap](../../paths/userusername/get/PathParameters.md#pathparametersmap) pathParameters)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/userusername/Put.md b/samples/client/petstore/java/docs/paths/userusername/Put.md deleted file mode 100644 index f8d1fa60840..00000000000 --- a/samples/client/petstore/java/docs/paths/userusername/Put.md +++ /dev/null @@ -1,238 +0,0 @@ -# Put - -public class Put - -A class that contains necessary endpoint classes -- a class that calls the endpoint method using the http verb -- a class that calls the endpoint method using the operationId name -- class(es) to store the request inputs -- builder(s) to set the request input data - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Put1](#put1)
The class that has a put method to call the endpoint | -| static class | [PutRequest](#putrequest)
The final request inputs class | -| static class | [PutNullableRequest](#putnullablerequest)
The initial request inputs class | -| static class | [Put00RequestBuilder](#put00requestbuilder)
A builder for the request input class | -| static class | [Put01RequestBuilder](#put01requestbuilder)
A builder for the request input class | -| static class | [Put10RequestBuilder](#put10requestbuilder)
A builder for the request input class | -| static class | [PutRequestBuilder](#putrequestbuilder)
A builder for the request input class | - -## Put1 -public static class Put1 extends ApiClient.ApiClient1 implements PutOperation
- -a class that allows one to call the endpoint using a method named put - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.userusername.put.RequestBody; -import org.openapijsonschematools.client.components.schemas.User; -import org.openapijsonschematools.client.paths.userusername.put.PathParameters; -import org.openapijsonschematools.client.servers.Server0; -import org.openapijsonschematools.client.servers.Server1; -import org.openapijsonschematools.client.servers.Server2; -import org.openapijsonschematools.client.paths.userusername.put.responses.Code400Response; -import org.openapijsonschematools.client.paths.userusername.put.responses.Code404Response; -import org.openapijsonschematools.client.servers.RootServerInfo; -import org.openapijsonschematools.client.paths.userusername.Put; -import org.openapijsonschematools.client.paths.userusername.put.Responses; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below -ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() - .rootServerInfo( - new RootServerInfo.RootServerInfoBuilder() - .server0(new Server0()) - .build() - ) - .build(); -ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() - .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) - .build(); -Duration timeout = Duration.ofSeconds(1L); -ApiConfiguration apiConfiguration = new ApiConfiguration( - serverInfo - serverIndexInfo, - timeout -); -SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -Put.Put1 apiClient = new Put.Put1(apiConfiguration, schemaConfiguration); - - -User1BoxedMap requestBodyPayload = - User.User1.validateAndBox( - new User.UserMapBuilder() - .id(1L) - - .username("a") - - .firstName("a") - - .lastName("a") - - .email("a") - - .password("a") - - .phone("a") - - .userStatus(1) - - .objectWithNoDeclaredPropsNullable(null) - - .build(), - schemaConfiguration -); -Put.SealedRequestBody requestBody = new Put.ApplicationjsonRequestBody(requestBodyPayload); - -// Map validation -PathParameters.PathParametersMap pathParameters = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .username("a") - - .build(), - schemaConfiguration -); - -var request = new PutRequestBuilder() - .requestBody(requestBody) - .pathParameters(pathParameters) - .build(); - -Void response; -try { - response = apiClient.put(request); -} catch (Code400Response.ResponseApiException | Code404Response.ResponseApiException e) { - // server returned an error response defined in the openapi document - throw e; -} catch (ApiException e) { - // server returned a response/contentType not defined in the openapi document - throw e; -} catch (ValidationException e) { - // the returned response body or header values do not conform the the schema validation requirements - throw e; -} catch (IOException | InterruptedException e) { - // an exception happened when making the request - throw e; -} catch (NotImplementedException e) { - // the request body serialization or deserialization has not yet been implemented - // or the header content type deserialization has not yet been implemented for this contentType - throw e; -} -``` -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Put1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | put([PutRequest](#putrequest) request) | - -## PutRequest -public static class PutRequest
- -a class that stores the final request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.SealedRequestBody](../../paths/userusername/put/RequestBody.md#sealedrequestbody) | requestBody | -| [PathParameters.PathParametersMap](../../paths/userusername/put/PathParameters.md#pathparametersmap) | pathParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | -| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | - -## PutNullableRequest -public static class PutNullableRequest
- -a class that stores the initial request inputs - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| [RequestBody.@Nullable SealedRequestBody](../../paths/userusername/put/RequestBody.md#sealedrequestbody) | requestBody | -| [PathParameters.@Nullable PathParametersMap](../../paths/userusername/put/PathParameters.md#pathparametersmap) | pathParameters | -| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | -| @Nullable Duration | timeout | - -## Put00RequestBuilder -public static class Put00RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Put00RequestBuilder(Put00RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PutRequest](#putrequest) | build()
Returns the request input used to call an endpoint method | -| [Put00RequestBuilder](#put00requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | -| [Put00RequestBuilder](#put00requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | - -## Put01RequestBuilder -public static class Put01RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Put01RequestBuilder(Put01RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Put00RequestBuilder](#put00requestbuilder) | pathParameters([PathParametersPathParametersMap](../../paths/userusername/put/PathParameters.md#pathparametersmap) pathParameters)
sets the property | - -## Put10RequestBuilder -public static class Put10RequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Put10RequestBuilder(Put10RequestBuilder instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Put00RequestBuilder](#put00requestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/userusername/put/RequestBody.md#sealedrequestbody) requestBody)
sets the property | - -## PutRequestBuilder -public static class PutRequestBuilder
- -a builder for request inputs - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PutRequestBuilder()
Creates a builder that contains null for all parameters | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [Put01RequestBuilder](#put01requestbuilder) | requestBody([RequestBody.SealedRequestBody](../../paths/userusername/put/RequestBody.md#sealedrequestbody) requestBody)
sets the property | -| [Put10RequestBuilder](#put10requestbuilder) | pathParameters([PathParametersPathParametersMap](../../paths/userusername/put/PathParameters.md#pathparametersmap) pathParameters)
sets the property | - -[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/userusername/UserusernameDelete.md b/samples/client/petstore/java/docs/paths/userusername/UserusernameDelete.md new file mode 100644 index 00000000000..ffa3d7280a4 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/userusername/UserusernameDelete.md @@ -0,0 +1,186 @@ +# UserusernameDelete + +public class UserusernameDelete + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Delete](#delete)
The class that has a delete method to call the endpoint | +| interface | [DeleteUserOperation](#deleteuseroperation)
The interface that has a deleteUser method to call the endpoint | +| static class | [DeleteRequest](#deleterequest)
The final request inputs class | +| static class | [DeleteNullableRequest](#deletenullablerequest)
The initial request inputs class | +| static class | [Delete0RequestBuilder](#delete0requestbuilder)
A builder for the request input class | +| static class | [DeleteRequestBuilder](#deleterequestbuilder)
A builder for the request input class | + +## Delete +public static class Delete extends ApiClient.ApiClient1 implements DeleteOperation
+ +a class that allows one to call the endpoint using a method named delete + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.userusername.delete.UserusernameDeletePathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.userusername.delete.responses.UserusernameDeleteCode200Response; +import org.openapijsonschematools.client.paths.userusername.delete.responses.UserusernameDeleteCode404Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.userusername.UserusernameDelete; +import org.openapijsonschematools.client.paths.userusername.delete.UserusernameDeleteResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +UserusernameDelete.Delete apiClient = new UserusernameDelete.Delete(apiConfiguration, schemaConfiguration); + + +// Map validation +UserusernameDeletePathParameters.UserusernameDeletePathParametersMap pathParameters = + UserusernameDeletePathParameters.UserusernameDeletePathParameters1.validate( + new UserusernameDeletePathParameters.UserusernameDeletePathParametersMapBuilder() + .username("a") + + .build(), + schemaConfiguration +); + +var request = new UserusernameDelete.DeleteRequestBuilder() + .pathParameters(pathParameters) + .build(); + +UserusernameDeleteResponses.EndpointResponse response; +try { + response = apiClient.delete(request); +} catch (UserusernameDeleteCode404Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +UserusernameDeleteResponses.EndpointUserusernameDeleteCode200Response castResponse = (UserusernameDeleteResponses.EndpointUserusernameDeleteCode200Response) response; +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Delete(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserusernameDeleteResponses.EndpointResponse](../../paths/userusername/delete/UserusernameDeleteResponses.md#endpointresponse) | delete([DeleteRequest](#deleterequest) request) | + +## DeleteUserOperation +public interface DeleteUserOperation
+ +an interface that allows one to call the endpoint using a method named deleteUser by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserusernameDeleteResponses.EndpointResponse](../../paths/userusername/delete/UserusernameDeleteResponses.md#endpointresponse) | deleteUser([DeleteRequest](#deleterequest) request) | + +## DeleteRequest +public static class DeleteRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [UserusernameDeletePathParameters.UserusernameDeletePathParametersMap](../../paths/userusername/delete/UserusernameDeletePathParameters.md#userusernamedeletepathparametersmap) | pathParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## DeleteNullableRequest +public static class DeleteNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [UserusernameDeletePathParameters.@Nullable UserusernameDeletePathParametersMap](../../paths/userusername/delete/UserusernameDeletePathParameters.md#userusernamedeletepathparametersmap) | pathParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| @Nullable Duration | timeout | + +## Delete0RequestBuilder +public static class Delete0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Delete0RequestBuilder(Delete0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [DeleteRequest](#deleterequest) | build()
Returns the request input used to call an endpoint method | +| [Delete0RequestBuilder](#delete0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Delete0RequestBuilder](#delete0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## DeleteRequestBuilder +public static class DeleteRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| DeleteRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Delete0RequestBuilder](#delete0requestbuilder) | pathParameters([UserusernameDeletePathParametersUserusernameDeletePathParametersMap](../../paths/userusername/delete/UserusernameDeletePathParameters.md#userusernamedeletepathparametersmap) pathParameters)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/userusername/UserusernameGet.md b/samples/client/petstore/java/docs/paths/userusername/UserusernameGet.md new file mode 100644 index 00000000000..ae6cad77caf --- /dev/null +++ b/samples/client/petstore/java/docs/paths/userusername/UserusernameGet.md @@ -0,0 +1,193 @@ +# UserusernameGet + +public class UserusernameGet + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Get](#get)
The class that has a get method to call the endpoint | +| interface | [GetUserByNameOperation](#getuserbynameoperation)
The interface that has a getUserByName method to call the endpoint | +| static class | [GetRequest](#getrequest)
The final request inputs class | +| static class | [GetNullableRequest](#getnullablerequest)
The initial request inputs class | +| static class | [Get0RequestBuilder](#get0requestbuilder)
A builder for the request input class | +| static class | [GetRequestBuilder](#getrequestbuilder)
A builder for the request input class | + +## Get +public static class Get extends ApiClient.ApiClient1 implements GetOperation
+ +a class that allows one to call the endpoint using a method named get + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.userusername.get.UserusernameGetPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.userusername.get.responses.UserusernameGetCode200Response; +import org.openapijsonschematools.client.paths.userusername.get.responses.UserusernameGetCode400Response; +import org.openapijsonschematools.client.paths.userusername.get.responses.UserusernameGetCode404Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.userusername.UserusernameGet; +import org.openapijsonschematools.client.paths.userusername.get.UserusernameGetResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +UserusernameGet.Get apiClient = new UserusernameGet.Get(apiConfiguration, schemaConfiguration); + + +// Map validation +UserusernameGetPathParameters.UserusernameGetPathParametersMap pathParameters = + UserusernameGetPathParameters.UserusernameGetPathParameters1.validate( + new UserusernameGetPathParameters.UserusernameGetPathParametersMapBuilder() + .username("a") + + .build(), + schemaConfiguration +); + +var request = new UserusernameGet.GetRequestBuilder() + .pathParameters(pathParameters) + .build(); + +UserusernameGetResponses.EndpointResponse response; +try { + response = apiClient.get(request); +} catch (UserusernameGetCode400Response.ResponseApiException | UserusernameGetCode404Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +UserusernameGetResponses.EndpointUserusernameGetCode200Response castResponse = (UserusernameGetResponses.EndpointUserusernameGetCode200Response) response; +if (castResponse.body instanceof UserusernameGetCode200Response.ApplicationxmlResponseBody deserializedBody) { + // handle deserialized body here +} else { + UserusernameGetCode200Response.ApplicationjsonResponseBody deserializedBody = (UserusernameGetCode200Response.ApplicationjsonResponseBody) castResponse.body; + // handle deserialized body here +} +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserusernameGetResponses.EndpointResponse](../../paths/userusername/get/UserusernameGetResponses.md#endpointresponse) | get([GetRequest](#getrequest) request) | + +## GetUserByNameOperation +public interface GetUserByNameOperation
+ +an interface that allows one to call the endpoint using a method named getUserByName by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserusernameGetResponses.EndpointResponse](../../paths/userusername/get/UserusernameGetResponses.md#endpointresponse) | getUserByName([GetRequest](#getrequest) request) | + +## GetRequest +public static class GetRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [UserusernameGetPathParameters.UserusernameGetPathParametersMap](../../paths/userusername/get/UserusernameGetPathParameters.md#userusernamegetpathparametersmap) | pathParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## GetNullableRequest +public static class GetNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [UserusernameGetPathParameters.@Nullable UserusernameGetPathParametersMap](../../paths/userusername/get/UserusernameGetPathParameters.md#userusernamegetpathparametersmap) | pathParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| @Nullable Duration | timeout | + +## Get0RequestBuilder +public static class Get0RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Get0RequestBuilder(Get0RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [GetRequest](#getrequest) | build()
Returns the request input used to call an endpoint method | +| [Get0RequestBuilder](#get0requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Get0RequestBuilder](#get0requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## GetRequestBuilder +public static class GetRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| GetRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Get0RequestBuilder](#get0requestbuilder) | pathParameters([UserusernameGetPathParametersUserusernameGetPathParametersMap](../../paths/userusername/get/UserusernameGetPathParameters.md#userusernamegetpathparametersmap) pathParameters)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/userusername/UserusernamePut.md b/samples/client/petstore/java/docs/paths/userusername/UserusernamePut.md new file mode 100644 index 00000000000..9e6a085dbb0 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/userusername/UserusernamePut.md @@ -0,0 +1,249 @@ +# UserusernamePut + +public class UserusernamePut + +A class that contains necessary endpoint classes +- a class that calls the endpoint method using the http verb +- a class that calls the endpoint method using the operationId name +- class(es) to store the request inputs +- builder(s) to set the request input data + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [Put](#put)
The class that has a put method to call the endpoint | +| interface | [UpdateUserOperation](#updateuseroperation)
The interface that has a updateUser method to call the endpoint | +| static class | [PutRequest](#putrequest)
The final request inputs class | +| static class | [PutNullableRequest](#putnullablerequest)
The initial request inputs class | +| static class | [Put00RequestBuilder](#put00requestbuilder)
A builder for the request input class | +| static class | [Put01RequestBuilder](#put01requestbuilder)
A builder for the request input class | +| static class | [Put10RequestBuilder](#put10requestbuilder)
A builder for the request input class | +| static class | [PutRequestBuilder](#putrequestbuilder)
A builder for the request input class | + +## Put +public static class Put extends ApiClient.ApiClient1 implements PutOperation
+ +a class that allows one to call the endpoint using a method named put + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.userusername.put.UserusernamePutRequestBody; +import org.openapijsonschematools.client.components.schemas.User; +import org.openapijsonschematools.client.paths.userusername.put.UserusernamePutPathParameters; +import org.openapijsonschematools.client.servers.Server0; +import org.openapijsonschematools.client.servers.Server1; +import org.openapijsonschematools.client.servers.Server2; +import org.openapijsonschematools.client.paths.userusername.put.responses.UserusernamePutCode400Response; +import org.openapijsonschematools.client.paths.userusername.put.responses.UserusernamePutCode404Response; +import org.openapijsonschematools.client.servers.RootServerInfo; +import org.openapijsonschematools.client.paths.userusername.UserusernamePut; +import org.openapijsonschematools.client.paths.userusername.put.UserusernamePutResponses; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +// if you want to use a server that is not SERVER_0 pass it in here and change the ServerIndex input below +ApiConfiguration.ServerInfo serverInfo = new ApiConfiguration.ServerInfoBuilder() + .rootServerInfo( + new RootServerInfo.RootServerInfoBuilder() + .server0(new Server0()) + .build() + ) + .build(); +ApiConfiguration.ServerIndexInfo serverIndexInfo = new ApiConfiguration.ServerIndexInfoBuilder() + .rootServerInfoServerIndex(RootServerInfo.ServerIndex.SERVER_0) + .build(); +Duration timeout = Duration.ofSeconds(1L); +ApiConfiguration apiConfiguration = new ApiConfiguration( + serverInfo + serverIndexInfo, + timeout +); +SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); +UserusernamePut.Put apiClient = new UserusernamePut.Put(apiConfiguration, schemaConfiguration); + + +User1BoxedMap requestBodyPayload = + User.User1.validateAndBox( + new User.UserMapBuilder() + .id(1L) + + .username("a") + + .firstName("a") + + .lastName("a") + + .email("a") + + .password("a") + + .phone("a") + + .userStatus(1) + + .objectWithNoDeclaredPropsNullable(null) + + .build(), + schemaConfiguration +); +UserusernamePut.SealedRequestBody requestBody = new UserusernamePut.ApplicationjsonRequestBody(requestBodyPayload); + +// Map validation +UserusernamePutPathParameters.UserusernamePutPathParametersMap pathParameters = + UserusernamePutPathParameters.UserusernamePutPathParameters1.validate( + new UserusernamePutPathParameters.UserusernamePutPathParametersMapBuilder() + .username("a") + + .build(), + schemaConfiguration +); + +var request = new UserusernamePut.PutRequestBuilder() + .requestBody(requestBody) + .pathParameters(pathParameters) + .build(); + +Void response; +try { + response = apiClient.put(request); +} catch (UserusernamePutCode400Response.ResponseApiException | UserusernamePutCode404Response.ResponseApiException e) { + // server returned an error response defined in the openapi document + throw e; +} catch (ApiException e) { + // server returned a response/contentType not defined in the openapi document + throw e; +} catch (ValidationException e) { + // the returned response body or header values do not conform the the schema validation requirements + throw e; +} catch (IOException | InterruptedException e) { + // an exception happened when making the request + throw e; +} catch (NotImplementedException e) { + // the request body serialization or deserialization has not yet been implemented + // or the header content type deserialization has not yet been implemented for this contentType + throw e; +} +``` +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Put(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | put([PutRequest](#putrequest) request) | + +## UpdateUserOperation +public interface UpdateUserOperation
+ +an interface that allows one to call the endpoint using a method named updateUser by the operationId + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | updateUser([PutRequest](#putrequest) request) | + +## PutRequest +public static class PutRequest
+ +a class that stores the final request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [UserusernamePutRequestBody.SealedRequestBody](../../paths/userusername/put/UserusernamePutRequestBody.md#sealedrequestbody) | requestBody | +| [UserusernamePutPathParameters.UserusernamePutPathParametersMap](../../paths/userusername/put/UserusernamePutPathParameters.md#userusernameputpathparametersmap) | pathParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex
optional. Note: this will override the value in apiConfiguration | +| @Nullable Duration | timeout
optional. Note: this will override the value in apiConfiguration | + +## PutNullableRequest +public static class PutNullableRequest
+ +a class that stores the initial request inputs + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| [UserusernamePutRequestBody.@Nullable SealedRequestBody](../../paths/userusername/put/UserusernamePutRequestBody.md#sealedrequestbody) | requestBody | +| [UserusernamePutPathParameters.@Nullable UserusernamePutPathParametersMap](../../paths/userusername/put/UserusernamePutPathParameters.md#userusernameputpathparametersmap) | pathParameters | +| [RootServerInfo.@Nullable ServerIndex](../../RootServerInfo.md#serverindex) | serverIndex | +| @Nullable Duration | timeout | + +## Put00RequestBuilder +public static class Put00RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Put00RequestBuilder(Put00RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [PutRequest](#putrequest) | build()
Returns the request input used to call an endpoint method | +| [Put00RequestBuilder](#put00requestbuilder) | serverIndex([RootServerInfo.ServerIndex](../../RootServerInfo.md#serverindex) serverIndex)
sets the optional property. Note: this will override the value in apiConfiguration | +| [Put00RequestBuilder](#put00requestbuilder) | timeout(Duration timeout)
sets the optional property. Note: this will override the value in apiConfiguration | + +## Put01RequestBuilder +public static class Put01RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Put01RequestBuilder(Put01RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Put00RequestBuilder](#put00requestbuilder) | pathParameters([UserusernamePutPathParametersUserusernamePutPathParametersMap](../../paths/userusername/put/UserusernamePutPathParameters.md#userusernameputpathparametersmap) pathParameters)
sets the property | + +## Put10RequestBuilder +public static class Put10RequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| Put10RequestBuilder(Put10RequestBuilder instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Put00RequestBuilder](#put00requestbuilder) | requestBody([UserusernamePutRequestBody.SealedRequestBody](../../paths/userusername/put/UserusernamePutRequestBody.md#sealedrequestbody) requestBody)
sets the property | + +## PutRequestBuilder +public static class PutRequestBuilder
+ +a builder for request inputs + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| PutRequestBuilder()
Creates a builder that contains null for all parameters | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [Put01RequestBuilder](#put01requestbuilder) | requestBody([UserusernamePutRequestBody.SealedRequestBody](../../paths/userusername/put/UserusernamePutRequestBody.md#sealedrequestbody) requestBody)
sets the property | +| [Put10RequestBuilder](#put10requestbuilder) | pathParameters([UserusernamePutPathParametersUserusernamePutPathParametersMap](../../paths/userusername/put/UserusernamePutPathParameters.md#userusernameputpathparametersmap) pathParameters)
sets the property | + +[[Back to top]](#top) [[Back to README]](../../../README.md) diff --git a/samples/client/petstore/java/docs/paths/userusername/delete/PathParameters.md b/samples/client/petstore/java/docs/paths/userusername/delete/PathParameters.md deleted file mode 100644 index 412ad64ab3a..00000000000 --- a/samples/client/petstore/java/docs/paths/userusername/delete/PathParameters.md +++ /dev/null @@ -1,268 +0,0 @@ -# PathParameters -public class PathParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [PathParameters.PathParameters1Boxed](#pathparameters1boxed)
sealed interface for validated payloads | -| record | [PathParameters.PathParameters1BoxedMap](#pathparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.PathParameters1](#pathparameters1)
schema class | -| static class | [PathParameters.PathParametersMapBuilder](#pathparametersmapbuilder)
builder for Map payloads | -| static class | [PathParameters.PathParametersMap](#pathparametersmap)
output class for Map payloads | -| sealed interface | [PathParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [PathParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [PathParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [PathParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [PathParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [PathParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [PathParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.AdditionalProperties](#additionalproperties)
schema class | - -## PathParameters1Boxed -public sealed interface PathParameters1Boxed
-permits
-[PathParameters1BoxedMap](#pathparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## PathParameters1BoxedMap -public record PathParameters1BoxedMap
-implements [PathParameters1Boxed](#pathparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParameters1BoxedMap([PathParametersMap](#pathparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## PathParameters1 -public static class PathParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.userusername.delete.PathParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -PathParameters.PathParametersMap validatedPayload = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .username("a") - - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("username", [Schema.Schema1.class](../../../components/parameters/pathusername/Schema.md#schema1))
)
| -| Set | required = Set.of(
    "username"
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | validate([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1BoxedMap](#pathparameters1boxedmap) | validateAndBox([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1Boxed](#pathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## PathParametersMap0Builder -public class PathParametersMap0Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | - -## PathParametersMapBuilder -public class PathParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap0Builder](#pathparametersmap0builder) | username(String value) | - -## PathParametersMap -public static class PathParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [PathParametersMap](#pathparametersmap) | of([Map](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| String | username()
| - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/userusername/delete/Responses.md b/samples/client/petstore/java/docs/paths/userusername/delete/Responses.md deleted file mode 100644 index d4bf4fdb8f5..00000000000 --- a/samples/client/petstore/java/docs/paths/userusername/delete/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/userusername/delete/UserusernameDeletePathParameters.md b/samples/client/petstore/java/docs/paths/userusername/delete/UserusernameDeletePathParameters.md new file mode 100644 index 00000000000..07fdc670fb1 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/userusername/delete/UserusernameDeletePathParameters.md @@ -0,0 +1,268 @@ +# UserusernameDeletePathParameters +public class UserusernameDeletePathParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [UserusernameDeletePathParameters.UserusernameDeletePathParameters1Boxed](#userusernamedeletepathparameters1boxed)
sealed interface for validated payloads | +| record | [UserusernameDeletePathParameters.UserusernameDeletePathParameters1BoxedMap](#userusernamedeletepathparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [UserusernameDeletePathParameters.UserusernameDeletePathParameters1](#userusernamedeletepathparameters1)
schema class | +| static class | [UserusernameDeletePathParameters.UserusernameDeletePathParametersMapBuilder](#userusernamedeletepathparametersmapbuilder)
builder for Map payloads | +| static class | [UserusernameDeletePathParameters.UserusernameDeletePathParametersMap](#userusernamedeletepathparametersmap)
output class for Map payloads | +| sealed interface | [UserusernameDeletePathParameters.UserusernameDeleteadditionalPropertiesBoxed](#userusernamedeleteadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [UserusernameDeletePathParameters.UserusernameDeleteadditionalPropertiesBoxedVoid](#userusernamedeleteadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [UserusernameDeletePathParameters.UserusernameDeleteadditionalPropertiesBoxedBoolean](#userusernamedeleteadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [UserusernameDeletePathParameters.UserusernameDeleteadditionalPropertiesBoxedNumber](#userusernamedeleteadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [UserusernameDeletePathParameters.UserusernameDeleteadditionalPropertiesBoxedString](#userusernamedeleteadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [UserusernameDeletePathParameters.UserusernameDeleteadditionalPropertiesBoxedList](#userusernamedeleteadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [UserusernameDeletePathParameters.UserusernameDeleteadditionalPropertiesBoxedMap](#userusernamedeleteadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [UserusernameDeletePathParameters.UserusernameDeleteadditionalProperties](#userusernamedeleteadditionalproperties)
schema class | + +## UserusernameDeletePathParameters1Boxed +public sealed interface UserusernameDeletePathParameters1Boxed
+permits
+[UserusernameDeletePathParameters1BoxedMap](#userusernamedeletepathparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## UserusernameDeletePathParameters1BoxedMap +public record UserusernameDeletePathParameters1BoxedMap
+implements [UserusernameDeletePathParameters1Boxed](#userusernamedeletepathparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernameDeletePathParameters1BoxedMap([UserusernameDeletePathParametersMap](#userusernamedeletepathparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserusernameDeletePathParametersMap](#userusernamedeletepathparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserusernameDeletePathParameters1 +public static class UserusernameDeletePathParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.userusername.delete.UserusernameDeletePathParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +UserusernameDeletePathParameters.UserusernameDeletePathParametersMap validatedPayload = + UserusernameDeletePathParameters.UserusernameDeletePathParameters1.validate( + new UserusernameDeletePathParameters.UserusernameDeletePathParametersMapBuilder() + .username("a") + + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("username", [Schema.Schema1.class](../../../components/parameters/pathusername/Schema.md#schema1))
)
| +| Set | required = Set.of(
    "username"
)
| +| Class | additionalProperties = [UserusernameDeleteadditionalProperties.class](#userusernamedeleteadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserusernameDeletePathParametersMap](#userusernamedeletepathparametersmap) | validate([Map<?, ?>](#userusernamedeletepathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [UserusernameDeletePathParameters1BoxedMap](#userusernamedeletepathparameters1boxedmap) | validateAndBox([Map<?, ?>](#userusernamedeletepathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [UserusernameDeletePathParameters1Boxed](#userusernamedeletepathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## UserusernameDeletePathParametersMap0Builder +public class UserusernameDeletePathParametersMap0Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernameDeletePathParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | + +## UserusernameDeletePathParametersMapBuilder +public class UserusernameDeletePathParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernameDeletePathParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserusernameDeletePathParametersMap0Builder](#userusernamedeletepathparametersmap0builder) | username(String value) | + +## UserusernameDeletePathParametersMap +public static class UserusernameDeletePathParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [UserusernameDeletePathParametersMap](#userusernamedeletepathparametersmap) | of([Map](#userusernamedeletepathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| String | username()
| + +## UserusernameDeleteadditionalPropertiesBoxed +public sealed interface UserusernameDeleteadditionalPropertiesBoxed
+permits
+[UserusernameDeleteadditionalPropertiesBoxedVoid](#userusernamedeleteadditionalpropertiesboxedvoid), +[UserusernameDeleteadditionalPropertiesBoxedBoolean](#userusernamedeleteadditionalpropertiesboxedboolean), +[UserusernameDeleteadditionalPropertiesBoxedNumber](#userusernamedeleteadditionalpropertiesboxednumber), +[UserusernameDeleteadditionalPropertiesBoxedString](#userusernamedeleteadditionalpropertiesboxedstring), +[UserusernameDeleteadditionalPropertiesBoxedList](#userusernamedeleteadditionalpropertiesboxedlist), +[UserusernameDeleteadditionalPropertiesBoxedMap](#userusernamedeleteadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## UserusernameDeleteadditionalPropertiesBoxedVoid +public record UserusernameDeleteadditionalPropertiesBoxedVoid
+implements [UserusernameDeleteadditionalPropertiesBoxed](#userusernamedeleteadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernameDeleteadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserusernameDeleteadditionalPropertiesBoxedBoolean +public record UserusernameDeleteadditionalPropertiesBoxedBoolean
+implements [UserusernameDeleteadditionalPropertiesBoxed](#userusernamedeleteadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernameDeleteadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserusernameDeleteadditionalPropertiesBoxedNumber +public record UserusernameDeleteadditionalPropertiesBoxedNumber
+implements [UserusernameDeleteadditionalPropertiesBoxed](#userusernamedeleteadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernameDeleteadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserusernameDeleteadditionalPropertiesBoxedString +public record UserusernameDeleteadditionalPropertiesBoxedString
+implements [UserusernameDeleteadditionalPropertiesBoxed](#userusernamedeleteadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernameDeleteadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserusernameDeleteadditionalPropertiesBoxedList +public record UserusernameDeleteadditionalPropertiesBoxedList
+implements [UserusernameDeleteadditionalPropertiesBoxed](#userusernamedeleteadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernameDeleteadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserusernameDeleteadditionalPropertiesBoxedMap +public record UserusernameDeleteadditionalPropertiesBoxedMap
+implements [UserusernameDeleteadditionalPropertiesBoxed](#userusernamedeleteadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernameDeleteadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserusernameDeleteadditionalProperties +public static class UserusernameDeleteadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/userusername/delete/UserusernameDeleteResponses.md b/samples/client/petstore/java/docs/paths/userusername/delete/UserusernameDeleteResponses.md new file mode 100644 index 00000000000..b753c79b8d9 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/userusername/delete/UserusernameDeleteResponses.md @@ -0,0 +1,29 @@ +# UserusernameDeleteResponses + +public class UserusernameDeleteResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointUserusernameDeleteCode200Response](#endpointuserusernamedeletecode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointUserusernameDeleteCode200Response](#endpointuserusernamedeletecode200response) + +a sealed interface that stores endpoint responses + +## EndpointUserusernameDeleteCode200Response +public record EndpointUserusernameDeleteCode200Response( + HttpResponse response, + Void body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/userusername/delete/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/userusername/delete/responses/Code200Response.md deleted file mode 100644 index e89c75b2e12..00000000000 --- a/samples/client/petstore/java/docs/paths/userusername/delete/responses/Code200Response.md +++ /dev/null @@ -1,17 +0,0 @@ -# Code200Response - -public class Code200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) - -A class (extended from the $ref class) that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## Code200Response1 -public static class Code200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
- -a class that deserializes responses, extended from the $ref class - diff --git a/samples/client/petstore/java/docs/paths/userusername/delete/responses/Code404Response.md b/samples/client/petstore/java/docs/paths/userusername/delete/responses/Code404Response.md deleted file mode 100644 index ee00cd369a7..00000000000 --- a/samples/client/petstore/java/docs/paths/userusername/delete/responses/Code404Response.md +++ /dev/null @@ -1,32 +0,0 @@ -# Code404Response - -public class Code404Response - -A class that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code404Response.Code404Response1](#code404response1)
class that deserializes responses | - -## Code404Response1 -public static class Code404Response1
-extends ResponseDeserializer - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code404Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = MapUtils.makeMap(
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/userusername/delete/responses/UserusernameDeleteCode200Response.md b/samples/client/petstore/java/docs/paths/userusername/delete/responses/UserusernameDeleteCode200Response.md new file mode 100644 index 00000000000..bf7c6aee09d --- /dev/null +++ b/samples/client/petstore/java/docs/paths/userusername/delete/responses/UserusernameDeleteCode200Response.md @@ -0,0 +1,17 @@ +# UserusernameDeleteCode200Response + +public class UserusernameDeleteCode200Response extends [SuccessDescriptionOnly](../../components/responses/SuccessDescriptionOnly.md) + +A class (extended from the $ref class) that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [UserusernameDeleteCode200Response.UserusernameDeleteCode200Response1](#userusernamedeletecode200response1)
class that deserializes responses | + +## UserusernameDeleteCode200Response1 +public static class UserusernameDeleteCode200Response1 extends [SuccessDescriptionOnly1](../../components/responses/SuccessDescriptionOnly.md#successdescriptiononly1)
+ +a class that deserializes responses, extended from the $ref class + diff --git a/samples/client/petstore/java/docs/paths/userusername/delete/responses/UserusernameDeleteCode404Response.md b/samples/client/petstore/java/docs/paths/userusername/delete/responses/UserusernameDeleteCode404Response.md new file mode 100644 index 00000000000..971ff60ecb9 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/userusername/delete/responses/UserusernameDeleteCode404Response.md @@ -0,0 +1,32 @@ +# UserusernameDeleteCode404Response + +public class UserusernameDeleteCode404Response + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [UserusernameDeleteCode404Response.UserusernameDeleteCode404Response1](#userusernamedeletecode404response1)
class that deserializes responses | + +## UserusernameDeleteCode404Response1 +public static class UserusernameDeleteCode404Response1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernameDeleteCode404Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/userusername/get/PathParameters.md b/samples/client/petstore/java/docs/paths/userusername/get/PathParameters.md deleted file mode 100644 index 1e6b20064f5..00000000000 --- a/samples/client/petstore/java/docs/paths/userusername/get/PathParameters.md +++ /dev/null @@ -1,268 +0,0 @@ -# PathParameters -public class PathParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [PathParameters.PathParameters1Boxed](#pathparameters1boxed)
sealed interface for validated payloads | -| record | [PathParameters.PathParameters1BoxedMap](#pathparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.PathParameters1](#pathparameters1)
schema class | -| static class | [PathParameters.PathParametersMapBuilder](#pathparametersmapbuilder)
builder for Map payloads | -| static class | [PathParameters.PathParametersMap](#pathparametersmap)
output class for Map payloads | -| sealed interface | [PathParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [PathParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [PathParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [PathParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [PathParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [PathParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [PathParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.AdditionalProperties](#additionalproperties)
schema class | - -## PathParameters1Boxed -public sealed interface PathParameters1Boxed
-permits
-[PathParameters1BoxedMap](#pathparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## PathParameters1BoxedMap -public record PathParameters1BoxedMap
-implements [PathParameters1Boxed](#pathparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParameters1BoxedMap([PathParametersMap](#pathparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## PathParameters1 -public static class PathParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.userusername.get.PathParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -PathParameters.PathParametersMap validatedPayload = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .username("a") - - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("username", [Schema.Schema1.class](../../../components/parameters/pathusername/Schema.md#schema1))
)
| -| Set | required = Set.of(
    "username"
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | validate([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1BoxedMap](#pathparameters1boxedmap) | validateAndBox([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1Boxed](#pathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## PathParametersMap0Builder -public class PathParametersMap0Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | - -## PathParametersMapBuilder -public class PathParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap0Builder](#pathparametersmap0builder) | username(String value) | - -## PathParametersMap -public static class PathParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [PathParametersMap](#pathparametersmap) | of([Map](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| String | username()
| - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/userusername/get/Responses.md b/samples/client/petstore/java/docs/paths/userusername/get/Responses.md deleted file mode 100644 index 6af1f0c3d9a..00000000000 --- a/samples/client/petstore/java/docs/paths/userusername/get/Responses.md +++ /dev/null @@ -1,29 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes -- a sealed interface, EndpointResponse, that stores endpoint responses -- records for each endpoint response - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | -| record | [EndpointCode200Response](#endpointcode200response)
the response for 200 | - -## EndpointResponse -public sealed interface EndpointResponse permits
-[EndpointCode200Response](#endpointcode200response) - -a sealed interface that stores endpoint responses - -## EndpointCode200Response -public record EndpointCode200Response( - HttpResponse response, - [Code200Response.SealedResponseBody](../../../paths/userusername/get/responses/Code200Response.md#sealedresponsebody) body, - Void headers -) implements EndpointResponse, ApiResponse
- -a class that stores an endpoint response - diff --git a/samples/client/petstore/java/docs/paths/userusername/get/UserusernameGetPathParameters.md b/samples/client/petstore/java/docs/paths/userusername/get/UserusernameGetPathParameters.md new file mode 100644 index 00000000000..4927b37131a --- /dev/null +++ b/samples/client/petstore/java/docs/paths/userusername/get/UserusernameGetPathParameters.md @@ -0,0 +1,268 @@ +# UserusernameGetPathParameters +public class UserusernameGetPathParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [UserusernameGetPathParameters.UserusernameGetPathParameters1Boxed](#userusernamegetpathparameters1boxed)
sealed interface for validated payloads | +| record | [UserusernameGetPathParameters.UserusernameGetPathParameters1BoxedMap](#userusernamegetpathparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [UserusernameGetPathParameters.UserusernameGetPathParameters1](#userusernamegetpathparameters1)
schema class | +| static class | [UserusernameGetPathParameters.UserusernameGetPathParametersMapBuilder](#userusernamegetpathparametersmapbuilder)
builder for Map payloads | +| static class | [UserusernameGetPathParameters.UserusernameGetPathParametersMap](#userusernamegetpathparametersmap)
output class for Map payloads | +| sealed interface | [UserusernameGetPathParameters.UserusernameGetadditionalPropertiesBoxed](#userusernamegetadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [UserusernameGetPathParameters.UserusernameGetadditionalPropertiesBoxedVoid](#userusernamegetadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [UserusernameGetPathParameters.UserusernameGetadditionalPropertiesBoxedBoolean](#userusernamegetadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [UserusernameGetPathParameters.UserusernameGetadditionalPropertiesBoxedNumber](#userusernamegetadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [UserusernameGetPathParameters.UserusernameGetadditionalPropertiesBoxedString](#userusernamegetadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [UserusernameGetPathParameters.UserusernameGetadditionalPropertiesBoxedList](#userusernamegetadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [UserusernameGetPathParameters.UserusernameGetadditionalPropertiesBoxedMap](#userusernamegetadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [UserusernameGetPathParameters.UserusernameGetadditionalProperties](#userusernamegetadditionalproperties)
schema class | + +## UserusernameGetPathParameters1Boxed +public sealed interface UserusernameGetPathParameters1Boxed
+permits
+[UserusernameGetPathParameters1BoxedMap](#userusernamegetpathparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## UserusernameGetPathParameters1BoxedMap +public record UserusernameGetPathParameters1BoxedMap
+implements [UserusernameGetPathParameters1Boxed](#userusernamegetpathparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernameGetPathParameters1BoxedMap([UserusernameGetPathParametersMap](#userusernamegetpathparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserusernameGetPathParametersMap](#userusernamegetpathparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserusernameGetPathParameters1 +public static class UserusernameGetPathParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.userusername.get.UserusernameGetPathParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +UserusernameGetPathParameters.UserusernameGetPathParametersMap validatedPayload = + UserusernameGetPathParameters.UserusernameGetPathParameters1.validate( + new UserusernameGetPathParameters.UserusernameGetPathParametersMapBuilder() + .username("a") + + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("username", [Schema.Schema1.class](../../../components/parameters/pathusername/Schema.md#schema1))
)
| +| Set | required = Set.of(
    "username"
)
| +| Class | additionalProperties = [UserusernameGetadditionalProperties.class](#userusernamegetadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserusernameGetPathParametersMap](#userusernamegetpathparametersmap) | validate([Map<?, ?>](#userusernamegetpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [UserusernameGetPathParameters1BoxedMap](#userusernamegetpathparameters1boxedmap) | validateAndBox([Map<?, ?>](#userusernamegetpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [UserusernameGetPathParameters1Boxed](#userusernamegetpathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## UserusernameGetPathParametersMap0Builder +public class UserusernameGetPathParametersMap0Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernameGetPathParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | + +## UserusernameGetPathParametersMapBuilder +public class UserusernameGetPathParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernameGetPathParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserusernameGetPathParametersMap0Builder](#userusernamegetpathparametersmap0builder) | username(String value) | + +## UserusernameGetPathParametersMap +public static class UserusernameGetPathParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [UserusernameGetPathParametersMap](#userusernamegetpathparametersmap) | of([Map](#userusernamegetpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| String | username()
| + +## UserusernameGetadditionalPropertiesBoxed +public sealed interface UserusernameGetadditionalPropertiesBoxed
+permits
+[UserusernameGetadditionalPropertiesBoxedVoid](#userusernamegetadditionalpropertiesboxedvoid), +[UserusernameGetadditionalPropertiesBoxedBoolean](#userusernamegetadditionalpropertiesboxedboolean), +[UserusernameGetadditionalPropertiesBoxedNumber](#userusernamegetadditionalpropertiesboxednumber), +[UserusernameGetadditionalPropertiesBoxedString](#userusernamegetadditionalpropertiesboxedstring), +[UserusernameGetadditionalPropertiesBoxedList](#userusernamegetadditionalpropertiesboxedlist), +[UserusernameGetadditionalPropertiesBoxedMap](#userusernamegetadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## UserusernameGetadditionalPropertiesBoxedVoid +public record UserusernameGetadditionalPropertiesBoxedVoid
+implements [UserusernameGetadditionalPropertiesBoxed](#userusernamegetadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernameGetadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserusernameGetadditionalPropertiesBoxedBoolean +public record UserusernameGetadditionalPropertiesBoxedBoolean
+implements [UserusernameGetadditionalPropertiesBoxed](#userusernamegetadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernameGetadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserusernameGetadditionalPropertiesBoxedNumber +public record UserusernameGetadditionalPropertiesBoxedNumber
+implements [UserusernameGetadditionalPropertiesBoxed](#userusernamegetadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernameGetadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserusernameGetadditionalPropertiesBoxedString +public record UserusernameGetadditionalPropertiesBoxedString
+implements [UserusernameGetadditionalPropertiesBoxed](#userusernamegetadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernameGetadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserusernameGetadditionalPropertiesBoxedList +public record UserusernameGetadditionalPropertiesBoxedList
+implements [UserusernameGetadditionalPropertiesBoxed](#userusernamegetadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernameGetadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserusernameGetadditionalPropertiesBoxedMap +public record UserusernameGetadditionalPropertiesBoxedMap
+implements [UserusernameGetadditionalPropertiesBoxed](#userusernamegetadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernameGetadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserusernameGetadditionalProperties +public static class UserusernameGetadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/userusername/get/UserusernameGetResponses.md b/samples/client/petstore/java/docs/paths/userusername/get/UserusernameGetResponses.md new file mode 100644 index 00000000000..25ade8993d1 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/userusername/get/UserusernameGetResponses.md @@ -0,0 +1,29 @@ +# UserusernameGetResponses + +public class UserusernameGetResponses + +A class that contains necessary responses classes +- a sealed interface, EndpointResponse, that stores endpoint responses +- records for each endpoint response + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [EndpointResponse](#endpointresponse)
stores the endpoint responses | +| record | [EndpointUserusernameGetCode200Response](#endpointuserusernamegetcode200response)
the response for 200 | + +## EndpointResponse +public sealed interface EndpointResponse permits
+[EndpointUserusernameGetCode200Response](#endpointuserusernamegetcode200response) + +a sealed interface that stores endpoint responses + +## EndpointUserusernameGetCode200Response +public record EndpointUserusernameGetCode200Response( + HttpResponse response, + [UserusernameGetCode200Response.SealedResponseBody](../../../paths/userusername/get/responses/UserusernameGetCode200Response.md#sealedresponsebody) body, + Void headers +) implements EndpointResponse, ApiResponse
+ +a class that stores an endpoint response + diff --git a/samples/client/petstore/java/docs/paths/userusername/get/responses/Code200Response.md b/samples/client/petstore/java/docs/paths/userusername/get/responses/Code200Response.md deleted file mode 100644 index 0096aa4e61d..00000000000 --- a/samples/client/petstore/java/docs/paths/userusername/get/responses/Code200Response.md +++ /dev/null @@ -1,123 +0,0 @@ -# Code200Response - -public class Code200Response - -A class that contains necessary nested response classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- SealedResponseBody, a sealed interface which contains all the contentType/schema types -- records which implement SealedResponseBody, the concrete response body types -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [Code200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [Code200Response.ApplicationxmlMediaType](#applicationxmlmediatype)
record storing schema + encoding for a specific contentType | -| record | [Code200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| sealed interface | [Code200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | -| record | [Code200Response.ApplicationxmlResponseBody](#applicationxmlresponsebody)
implements sealed interface to store response body | -| record | [Code200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | -| static class | [Code200Response.Code200Response1](#code200response1)
class that deserializes responses | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationxmlMediaType](#applicationxmlmediatype), -[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - -## ApplicationxmlMediaType -public record ApplicationxmlMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationxmlSchema.ApplicationxmlSchema1](../../../../paths/userusername/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md#applicationxmlschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationxmlMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationxmlSchema.ApplicationxmlSchema1](../../../../paths/userusername/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md#applicationxmlschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/userusername/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/userusername/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## SealedResponseBody -public sealed interface SealedResponseBody
-permits
-[ApplicationxmlResponseBody](#applicationxmlresponsebody), -[ApplicationjsonResponseBody](#applicationjsonresponsebody) - -sealed interface that stores response body - -## ApplicationxmlResponseBody -public record ApplicationxmlResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/xml" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationxmlResponseBody(ApplicationxmlSchema.[User1Boxed](../../../../components/schemas/User.md#user1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationxmlSchema.[User1Boxed](../../../../components/schemas/User.md#user1boxed) | body()
returns the body passed in in the constructor | -## ApplicationjsonResponseBody -public record ApplicationjsonResponseBody
-implements [SealedResponseBody](#sealedresponsebody) - -A record class to store response body for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonResponseBody(ApplicationjsonSchema.[User1Boxed](../../../../components/schemas/User.md#user1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApplicationjsonSchema.[User1Boxed](../../../../components/schemas/User.md#user1boxed) | body()
returns the body passed in in the constructor | - -## Code200Response1 -public static class Code200Response1
-extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code200Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/xml", new [ApplicationxmlMediaType](#applicationxmlmediatype)()),
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/userusername/get/responses/Code400Response.md b/samples/client/petstore/java/docs/paths/userusername/get/responses/Code400Response.md deleted file mode 100644 index 6f3af2df6d2..00000000000 --- a/samples/client/petstore/java/docs/paths/userusername/get/responses/Code400Response.md +++ /dev/null @@ -1,32 +0,0 @@ -# Code400Response - -public class Code400Response - -A class that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code400Response.Code400Response1](#code400response1)
class that deserializes responses | - -## Code400Response1 -public static class Code400Response1
-extends ResponseDeserializer - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code400Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = MapUtils.makeMap(
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/userusername/get/responses/Code404Response.md b/samples/client/petstore/java/docs/paths/userusername/get/responses/Code404Response.md deleted file mode 100644 index ee00cd369a7..00000000000 --- a/samples/client/petstore/java/docs/paths/userusername/get/responses/Code404Response.md +++ /dev/null @@ -1,32 +0,0 @@ -# Code404Response - -public class Code404Response - -A class that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code404Response.Code404Response1](#code404response1)
class that deserializes responses | - -## Code404Response1 -public static class Code404Response1
-extends ResponseDeserializer - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code404Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = MapUtils.makeMap(
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/userusername/get/responses/UserusernameGetCode200Response.md b/samples/client/petstore/java/docs/paths/userusername/get/responses/UserusernameGetCode200Response.md new file mode 100644 index 00000000000..cb23ae18478 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/userusername/get/responses/UserusernameGetCode200Response.md @@ -0,0 +1,123 @@ +# UserusernameGetCode200Response + +public class UserusernameGetCode200Response + +A class that contains necessary nested response classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- SealedResponseBody, a sealed interface which contains all the contentType/schema types +- records which implement SealedResponseBody, the concrete response body types +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [UserusernameGetCode200Response.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [UserusernameGetCode200Response.ApplicationxmlMediaType](#applicationxmlmediatype)
record storing schema + encoding for a specific contentType | +| record | [UserusernameGetCode200Response.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| sealed interface | [UserusernameGetCode200Response.SealedResponseBody](#sealedresponsebody)
response body sealed interface | +| record | [UserusernameGetCode200Response.ApplicationxmlResponseBody](#applicationxmlresponsebody)
implements sealed interface to store response body | +| record | [UserusernameGetCode200Response.ApplicationjsonResponseBody](#applicationjsonresponsebody)
implements sealed interface to store response body | +| static class | [UserusernameGetCode200Response.UserusernameGetCode200Response1](#userusernamegetcode200response1)
class that deserializes responses | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationxmlMediaType](#applicationxmlmediatype), +[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + +## ApplicationxmlMediaType +public record ApplicationxmlMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationxmlSchema.ApplicationxmlSchema1](../../../../paths/userusername/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md#applicationxmlschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationxmlMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationxmlSchema.ApplicationxmlSchema1](../../../../paths/userusername/get/responses/code200response/content/applicationxml/ApplicationxmlSchema.md#applicationxmlschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/userusername/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../../paths/userusername/get/responses/code200response/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## SealedResponseBody +public sealed interface SealedResponseBody
+permits
+[ApplicationxmlResponseBody](#applicationxmlresponsebody), +[ApplicationjsonResponseBody](#applicationjsonresponsebody) + +sealed interface that stores response body + +## ApplicationxmlResponseBody +public record ApplicationxmlResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/xml" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationxmlResponseBody(ApplicationxmlSchema.[User1Boxed](../../../../components/schemas/User.md#user1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationxmlSchema.[User1Boxed](../../../../components/schemas/User.md#user1boxed) | body()
returns the body passed in in the constructor | +## ApplicationjsonResponseBody +public record ApplicationjsonResponseBody
+implements [SealedResponseBody](#sealedresponsebody) + +A record class to store response body for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonResponseBody(ApplicationjsonSchema.[User1Boxed](../../../../components/schemas/User.md#user1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApplicationjsonSchema.[User1Boxed](../../../../components/schemas/User.md#user1boxed) | body()
returns the body passed in in the constructor | + +## UserusernameGetCode200Response1 +public static class UserusernameGetCode200Response1
+extends ResponseDeserializer<[SealedResponseBody](#sealedresponsebody), Void, [SealedMediaType](#sealedmediatype)> + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernameGetCode200Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/xml", new [ApplicationxmlMediaType](#applicationxmlmediatype)()),
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse<[SealedResponseBody](#sealedresponsebody), Void> | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/userusername/get/responses/UserusernameGetCode400Response.md b/samples/client/petstore/java/docs/paths/userusername/get/responses/UserusernameGetCode400Response.md new file mode 100644 index 00000000000..9e94f8cf6cd --- /dev/null +++ b/samples/client/petstore/java/docs/paths/userusername/get/responses/UserusernameGetCode400Response.md @@ -0,0 +1,32 @@ +# UserusernameGetCode400Response + +public class UserusernameGetCode400Response + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [UserusernameGetCode400Response.UserusernameGetCode400Response1](#userusernamegetcode400response1)
class that deserializes responses | + +## UserusernameGetCode400Response1 +public static class UserusernameGetCode400Response1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernameGetCode400Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/userusername/get/responses/UserusernameGetCode404Response.md b/samples/client/petstore/java/docs/paths/userusername/get/responses/UserusernameGetCode404Response.md new file mode 100644 index 00000000000..8701478bc14 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/userusername/get/responses/UserusernameGetCode404Response.md @@ -0,0 +1,32 @@ +# UserusernameGetCode404Response + +public class UserusernameGetCode404Response + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [UserusernameGetCode404Response.UserusernameGetCode404Response1](#userusernamegetcode404response1)
class that deserializes responses | + +## UserusernameGetCode404Response1 +public static class UserusernameGetCode404Response1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernameGetCode404Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/userusername/put/PathParameters.md b/samples/client/petstore/java/docs/paths/userusername/put/PathParameters.md deleted file mode 100644 index bf2b807c3b8..00000000000 --- a/samples/client/petstore/java/docs/paths/userusername/put/PathParameters.md +++ /dev/null @@ -1,268 +0,0 @@ -# PathParameters -public class PathParameters
- -A class that contains necessary nested -- schema classes (which validate payloads), extends JsonSchema -- sealed interfaces which store validated payloads, java version of a sum type -- boxed classes which store validated payloads, sealed permits class implementations -- classes to store validated map payloads, extends FrozenMap -- classes to build inputs for map payloads - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | ---------------------- | -| sealed interface | [PathParameters.PathParameters1Boxed](#pathparameters1boxed)
sealed interface for validated payloads | -| record | [PathParameters.PathParameters1BoxedMap](#pathparameters1boxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.PathParameters1](#pathparameters1)
schema class | -| static class | [PathParameters.PathParametersMapBuilder](#pathparametersmapbuilder)
builder for Map payloads | -| static class | [PathParameters.PathParametersMap](#pathparametersmap)
output class for Map payloads | -| sealed interface | [PathParameters.AdditionalPropertiesBoxed](#additionalpropertiesboxed)
sealed interface for validated payloads | -| record | [PathParameters.AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid)
boxed class to store validated null payloads | -| record | [PathParameters.AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | -| record | [PathParameters.AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber)
boxed class to store validated Number payloads | -| record | [PathParameters.AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring)
boxed class to store validated String payloads | -| record | [PathParameters.AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist)
boxed class to store validated List payloads | -| record | [PathParameters.AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap)
boxed class to store validated Map payloads | -| static class | [PathParameters.AdditionalProperties](#additionalproperties)
schema class | - -## PathParameters1Boxed -public sealed interface PathParameters1Boxed
-permits
-[PathParameters1BoxedMap](#pathparameters1boxedmap) - -sealed interface that stores validated payloads using boxed classes - -## PathParameters1BoxedMap -public record PathParameters1BoxedMap
-implements [PathParameters1Boxed](#pathparameters1boxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParameters1BoxedMap([PathParametersMap](#pathparametersmap) data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## PathParameters1 -public static class PathParameters1
-extends JsonSchema - -A schema class that validates payloads - -### Code Sample -``` -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.paths.userusername.put.PathParameters; - -import java.util.Arrays; -import java.util.List; -import java.util.AbstractMap; - -static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); - -// Map validation -PathParameters.PathParametersMap validatedPayload = - PathParameters.PathParameters1.validate( - new PathParameters.PathParametersMapBuilder() - .username("a") - - .build(), - configuration -); -``` - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | ---------------------- | -| Set> | type = Set.of(Map.class) | -| Map> | properties = Map.ofEntries(
    new PropertyEntry("username", [Schema.Schema1.class](../../../components/parameters/pathusername/Schema.md#schema1))
)
| -| Set | required = Set.of(
    "username"
)
| -| Class | additionalProperties = [AdditionalProperties.class](#additionalproperties) | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap](#pathparametersmap) | validate([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1BoxedMap](#pathparameters1boxedmap) | validateAndBox([Map<?, ?>](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| [PathParameters1Boxed](#pathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | -| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | - -## PathParametersMap0Builder -public class PathParametersMap0Builder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Map | build()
Returns map input that should be used with Schema.validate | - -## PathParametersMapBuilder -public class PathParametersMapBuilder
-builder for `Map` - -A class that builds the Map input type - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| PathParametersMapBuilder()
Creates a builder that contains an empty map | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [PathParametersMap0Builder](#pathparametersmap0builder) | username(String value) | - -## PathParametersMap -public static class PathParametersMap
-extends FrozenMap - -A class to store validated Map payloads - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| static [PathParametersMap](#pathparametersmap) | of([Map](#pathparametersmapbuilder) arg, SchemaConfiguration configuration) | -| String | username()
| - -## AdditionalPropertiesBoxed -public sealed interface AdditionalPropertiesBoxed
-permits
-[AdditionalPropertiesBoxedVoid](#additionalpropertiesboxedvoid), -[AdditionalPropertiesBoxedBoolean](#additionalpropertiesboxedboolean), -[AdditionalPropertiesBoxedNumber](#additionalpropertiesboxednumber), -[AdditionalPropertiesBoxedString](#additionalpropertiesboxedstring), -[AdditionalPropertiesBoxedList](#additionalpropertiesboxedlist), -[AdditionalPropertiesBoxedMap](#additionalpropertiesboxedmap) - -sealed interface that stores validated payloads using boxed classes - -## AdditionalPropertiesBoxedVoid -public record AdditionalPropertiesBoxedVoid
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated null payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Void | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedBoolean -public record AdditionalPropertiesBoxedBoolean
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated boolean payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| boolean | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedNumber -public record AdditionalPropertiesBoxedNumber
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Number payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| Number | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedString -public record AdditionalPropertiesBoxedString
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated String payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedList -public record AdditionalPropertiesBoxedList
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated List payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenList<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalPropertiesBoxedMap -public record AdditionalPropertiesBoxedMap
-implements [AdditionalPropertiesBoxed](#additionalpropertiesboxed) - -record that stores validated Map payloads, sealed permits implementation - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| AdditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| FrozenMap<@Nullable Object> | data()
validated payload | -| @Nullable Object | getData()
validated payload | - -## AdditionalProperties -public static class AdditionalProperties
-extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 - -A schema class that validates payloads - -| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | -| ------------------------------------------------------------------ | -| validate | -| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/userusername/put/RequestBody.md b/samples/client/petstore/java/docs/paths/userusername/put/RequestBody.md deleted file mode 100644 index d5acae4f843..00000000000 --- a/samples/client/petstore/java/docs/paths/userusername/put/RequestBody.md +++ /dev/null @@ -1,90 +0,0 @@ -# RequestBody - -public class RequestBody - -A class that contains necessary nested request body classes -- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType -- records which implement SealedMediaType, the concrete media types -- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances -- SealedRequestBody, a sealed interface which contains all the contentType/schema input types -- records which implement SealedRequestBody, the concrete request body types - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| sealed interface | [RequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | -| record | [RequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | -| static class | [RequestBody.RequestBody1](#requestbody1)
class that serializes request bodies | -| sealed interface | [RequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | -| record | [RequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | - -## SealedMediaType -public sealed interface SealedMediaType
-permits
-[ApplicationjsonMediaType](#applicationjsonmediatype) - -sealed interface that stores schema and encoding info - - -## ApplicationjsonMediaType -public record ApplicationjsonMediaType
-implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/userusername/put/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> - -class storing schema info for a specific contentType - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonMediaType()
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/userusername/put/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | -| Void | encoding()
the encoding info | - -## RequestBody1 -public static class RequestBody1
- -a class that serializes SealedRequestBody request bodies - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| RequestBody1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| boolean | required = true
whether the request body is required | -| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | - -## SealedRequestBody -public sealed interface SealedRequestBody
-permits
-[ApplicationjsonRequestBody](#applicationjsonrequestbody) - -sealed interface that stores request contentType + validated schema data - -## ApplicationjsonRequestBody -public record ApplicationjsonRequestBody
-implements [SealedRequestBody](#sealedrequestbody),
-GenericRequestBody
- -A record class to store request body input for contentType="application/json" - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| ApplicationjsonRequestBody(ApplicationjsonSchema.[User1Boxed](../../../components/schemas/User.md#user1boxed) body)
Creates an instance | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| String | contentType()
always returns "application/json" | -| ApplicationjsonSchema.[User1Boxed](../../../components/schemas/User.md#user1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/userusername/put/Responses.md b/samples/client/petstore/java/docs/paths/userusername/put/Responses.md deleted file mode 100644 index 5841efd5c37..00000000000 --- a/samples/client/petstore/java/docs/paths/userusername/put/Responses.md +++ /dev/null @@ -1,10 +0,0 @@ -# Responses - -public class Responses - -A class that contains necessary responses classes - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | - diff --git a/samples/client/petstore/java/docs/paths/userusername/put/UserusernamePutPathParameters.md b/samples/client/petstore/java/docs/paths/userusername/put/UserusernamePutPathParameters.md new file mode 100644 index 00000000000..e9f0fb4260e --- /dev/null +++ b/samples/client/petstore/java/docs/paths/userusername/put/UserusernamePutPathParameters.md @@ -0,0 +1,268 @@ +# UserusernamePutPathParameters +public class UserusernamePutPathParameters
+ +A class that contains necessary nested +- schema classes (which validate payloads), extends JsonSchema +- sealed interfaces which store validated payloads, java version of a sum type +- boxed classes which store validated payloads, sealed permits class implementations +- classes to store validated map payloads, extends FrozenMap +- classes to build inputs for map payloads + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | ---------------------- | +| sealed interface | [UserusernamePutPathParameters.UserusernamePutPathParameters1Boxed](#userusernameputpathparameters1boxed)
sealed interface for validated payloads | +| record | [UserusernamePutPathParameters.UserusernamePutPathParameters1BoxedMap](#userusernameputpathparameters1boxedmap)
boxed class to store validated Map payloads | +| static class | [UserusernamePutPathParameters.UserusernamePutPathParameters1](#userusernameputpathparameters1)
schema class | +| static class | [UserusernamePutPathParameters.UserusernamePutPathParametersMapBuilder](#userusernameputpathparametersmapbuilder)
builder for Map payloads | +| static class | [UserusernamePutPathParameters.UserusernamePutPathParametersMap](#userusernameputpathparametersmap)
output class for Map payloads | +| sealed interface | [UserusernamePutPathParameters.UserusernamePutadditionalPropertiesBoxed](#userusernameputadditionalpropertiesboxed)
sealed interface for validated payloads | +| record | [UserusernamePutPathParameters.UserusernamePutadditionalPropertiesBoxedVoid](#userusernameputadditionalpropertiesboxedvoid)
boxed class to store validated null payloads | +| record | [UserusernamePutPathParameters.UserusernamePutadditionalPropertiesBoxedBoolean](#userusernameputadditionalpropertiesboxedboolean)
boxed class to store validated boolean payloads | +| record | [UserusernamePutPathParameters.UserusernamePutadditionalPropertiesBoxedNumber](#userusernameputadditionalpropertiesboxednumber)
boxed class to store validated Number payloads | +| record | [UserusernamePutPathParameters.UserusernamePutadditionalPropertiesBoxedString](#userusernameputadditionalpropertiesboxedstring)
boxed class to store validated String payloads | +| record | [UserusernamePutPathParameters.UserusernamePutadditionalPropertiesBoxedList](#userusernameputadditionalpropertiesboxedlist)
boxed class to store validated List payloads | +| record | [UserusernamePutPathParameters.UserusernamePutadditionalPropertiesBoxedMap](#userusernameputadditionalpropertiesboxedmap)
boxed class to store validated Map payloads | +| static class | [UserusernamePutPathParameters.UserusernamePutadditionalProperties](#userusernameputadditionalproperties)
schema class | + +## UserusernamePutPathParameters1Boxed +public sealed interface UserusernamePutPathParameters1Boxed
+permits
+[UserusernamePutPathParameters1BoxedMap](#userusernameputpathparameters1boxedmap) + +sealed interface that stores validated payloads using boxed classes + +## UserusernamePutPathParameters1BoxedMap +public record UserusernamePutPathParameters1BoxedMap
+implements [UserusernamePutPathParameters1Boxed](#userusernameputpathparameters1boxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernamePutPathParameters1BoxedMap([UserusernamePutPathParametersMap](#userusernameputpathparametersmap) data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserusernamePutPathParametersMap](#userusernameputpathparametersmap) | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserusernamePutPathParameters1 +public static class UserusernamePutPathParameters1
+extends JsonSchema + +A schema class that validates payloads + +### Code Sample +``` +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.paths.userusername.put.UserusernamePutPathParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.AbstractMap; + +static final SchemaConfiguration configuration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); + +// Map validation +UserusernamePutPathParameters.UserusernamePutPathParametersMap validatedPayload = + UserusernamePutPathParameters.UserusernamePutPathParameters1.validate( + new UserusernamePutPathParameters.UserusernamePutPathParametersMapBuilder() + .username("a") + + .build(), + configuration +); +``` + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | ---------------------- | +| Set> | type = Set.of(Map.class) | +| Map> | properties = Map.ofEntries(
    new PropertyEntry("username", [Schema.Schema1.class](../../../components/parameters/pathusername/Schema.md#schema1))
)
| +| Set | required = Set.of(
    "username"
)
| +| Class | additionalProperties = [UserusernamePutadditionalProperties.class](#userusernameputadditionalproperties) | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserusernamePutPathParametersMap](#userusernameputpathparametersmap) | validate([Map<?, ?>](#userusernameputpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [UserusernamePutPathParameters1BoxedMap](#userusernameputpathparameters1boxedmap) | validateAndBox([Map<?, ?>](#userusernameputpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| [UserusernamePutPathParameters1Boxed](#userusernameputpathparameters1boxed) | validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) | +| @Nullable Object | validate(@Nullable Object arg, SchemaConfiguration configuration) | + +## UserusernamePutPathParametersMap0Builder +public class UserusernamePutPathParametersMap0Builder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernamePutPathParametersMap0Builder(Map instance)
Creates a builder that contains the passed instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Map | build()
Returns map input that should be used with Schema.validate | + +## UserusernamePutPathParametersMapBuilder +public class UserusernamePutPathParametersMapBuilder
+builder for `Map` + +A class that builds the Map input type + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernamePutPathParametersMapBuilder()
Creates a builder that contains an empty map | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [UserusernamePutPathParametersMap0Builder](#userusernameputpathparametersmap0builder) | username(String value) | + +## UserusernamePutPathParametersMap +public static class UserusernamePutPathParametersMap
+extends FrozenMap + +A class to store validated Map payloads + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| static [UserusernamePutPathParametersMap](#userusernameputpathparametersmap) | of([Map](#userusernameputpathparametersmapbuilder) arg, SchemaConfiguration configuration) | +| String | username()
| + +## UserusernamePutadditionalPropertiesBoxed +public sealed interface UserusernamePutadditionalPropertiesBoxed
+permits
+[UserusernamePutadditionalPropertiesBoxedVoid](#userusernameputadditionalpropertiesboxedvoid), +[UserusernamePutadditionalPropertiesBoxedBoolean](#userusernameputadditionalpropertiesboxedboolean), +[UserusernamePutadditionalPropertiesBoxedNumber](#userusernameputadditionalpropertiesboxednumber), +[UserusernamePutadditionalPropertiesBoxedString](#userusernameputadditionalpropertiesboxedstring), +[UserusernamePutadditionalPropertiesBoxedList](#userusernameputadditionalpropertiesboxedlist), +[UserusernamePutadditionalPropertiesBoxedMap](#userusernameputadditionalpropertiesboxedmap) + +sealed interface that stores validated payloads using boxed classes + +## UserusernamePutadditionalPropertiesBoxedVoid +public record UserusernamePutadditionalPropertiesBoxedVoid
+implements [UserusernamePutadditionalPropertiesBoxed](#userusernameputadditionalpropertiesboxed) + +record that stores validated null payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernamePutadditionalPropertiesBoxedVoid(Void data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Void | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserusernamePutadditionalPropertiesBoxedBoolean +public record UserusernamePutadditionalPropertiesBoxedBoolean
+implements [UserusernamePutadditionalPropertiesBoxed](#userusernameputadditionalpropertiesboxed) + +record that stores validated boolean payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernamePutadditionalPropertiesBoxedBoolean(boolean data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| boolean | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserusernamePutadditionalPropertiesBoxedNumber +public record UserusernamePutadditionalPropertiesBoxedNumber
+implements [UserusernamePutadditionalPropertiesBoxed](#userusernameputadditionalpropertiesboxed) + +record that stores validated Number payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernamePutadditionalPropertiesBoxedNumber(Number data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| Number | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserusernamePutadditionalPropertiesBoxedString +public record UserusernamePutadditionalPropertiesBoxedString
+implements [UserusernamePutadditionalPropertiesBoxed](#userusernameputadditionalpropertiesboxed) + +record that stores validated String payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernamePutadditionalPropertiesBoxedString(String data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserusernamePutadditionalPropertiesBoxedList +public record UserusernamePutadditionalPropertiesBoxedList
+implements [UserusernamePutadditionalPropertiesBoxed](#userusernameputadditionalpropertiesboxed) + +record that stores validated List payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernamePutadditionalPropertiesBoxedList(FrozenList<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenList<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserusernamePutadditionalPropertiesBoxedMap +public record UserusernamePutadditionalPropertiesBoxedMap
+implements [UserusernamePutadditionalPropertiesBoxed](#userusernameputadditionalpropertiesboxed) + +record that stores validated Map payloads, sealed permits implementation + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernamePutadditionalPropertiesBoxedMap(FrozenMap<@Nullable Object> data)
Creates an instance, private visibility | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| FrozenMap<@Nullable Object> | data()
validated payload | +| @Nullable Object | getData()
validated payload | + +## UserusernamePutadditionalProperties +public static class UserusernamePutadditionalProperties
+extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 + +A schema class that validates payloads + +| Methods Inherited from class org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 | +| ------------------------------------------------------------------ | +| validate | +| validateAndBox | diff --git a/samples/client/petstore/java/docs/paths/userusername/put/UserusernamePutRequestBody.md b/samples/client/petstore/java/docs/paths/userusername/put/UserusernamePutRequestBody.md new file mode 100644 index 00000000000..c0854704243 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/userusername/put/UserusernamePutRequestBody.md @@ -0,0 +1,90 @@ +# UserusernamePutRequestBody + +public class UserusernamePutRequestBody + +A class that contains necessary nested request body classes +- SealedMediaType, a sealed interface which contains all the schema/encoding info for each contentType +- records which implement SealedMediaType, the concrete media types +- a class that extends RequestBodySerializer and is used to serialize input SealedRequestBody instances +- SealedRequestBody, a sealed interface which contains all the contentType/schema input types +- records which implement SealedRequestBody, the concrete request body types + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| sealed interface | [UserusernamePutRequestBody.SealedMediaType](#sealedmediatype)
media type sealed interface | +| record | [UserusernamePutRequestBody.ApplicationjsonMediaType](#applicationjsonmediatype)
record storing schema + encoding for a specific contentType | +| static class | [UserusernamePutRequestBody.UserusernamePutRequestBody1](#userusernameputrequestbody1)
class that serializes request bodies | +| sealed interface | [UserusernamePutRequestBody.SealedRequestBody](#sealedrequestbody)
request body sealed interface | +| record | [UserusernamePutRequestBody.ApplicationjsonRequestBody](#applicationjsonrequestbody)
implements sealed interface to store request body input | + +## SealedMediaType +public sealed interface SealedMediaType
+permits
+[ApplicationjsonMediaType](#applicationjsonmediatype) + +sealed interface that stores schema and encoding info + + +## ApplicationjsonMediaType +public record ApplicationjsonMediaType
+implements [SealedMediaType](#sealedmediatype), MediaType<[ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/userusername/put/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1), Void> + +class storing schema info for a specific contentType + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonMediaType()
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| [ApplicationjsonSchema.ApplicationjsonSchema1](../../../paths/userusername/put/requestbody/content/applicationjson/ApplicationjsonSchema.md#applicationjsonschema1) | schema()
the schema for this MediaType | +| Void | encoding()
the encoding info | + +## UserusernamePutRequestBody1 +public static class UserusernamePutRequestBody1
+ +a class that serializes SealedRequestBody request bodies + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernamePutRequestBody1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| boolean | required = true
whether the request body is required | +| Map | content = Map.ofEntries(
    new AbstractMap.SimpleEntry<>("application/json", new [ApplicationjsonMediaType](#applicationjsonmediatype)())
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| SerializedRequestBody | serialize([SealedRequestBody](#sealedrequestbody) requestBody)
called by endpoint when creating request body bytes | + +## SealedRequestBody +public sealed interface SealedRequestBody
+permits
+[ApplicationjsonRequestBody](#applicationjsonrequestbody) + +sealed interface that stores request contentType + validated schema data + +## ApplicationjsonRequestBody +public record ApplicationjsonRequestBody
+implements [SealedRequestBody](#sealedrequestbody),
+GenericRequestBody
+ +A record class to store request body input for contentType="application/json" + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| ApplicationjsonRequestBody(ApplicationjsonSchema.[User1Boxed](../../../components/schemas/User.md#user1boxed) body)
Creates an instance | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| String | contentType()
always returns "application/json" | +| ApplicationjsonSchema.[User1Boxed](../../../components/schemas/User.md#user1boxed) | body()
returns the body passed in in the constructor | diff --git a/samples/client/petstore/java/docs/paths/userusername/put/UserusernamePutResponses.md b/samples/client/petstore/java/docs/paths/userusername/put/UserusernamePutResponses.md new file mode 100644 index 00000000000..13a79a9fefe --- /dev/null +++ b/samples/client/petstore/java/docs/paths/userusername/put/UserusernamePutResponses.md @@ -0,0 +1,10 @@ +# UserusernamePutResponses + +public class UserusernamePutResponses + +A class that contains necessary responses classes + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | + diff --git a/samples/client/petstore/java/docs/paths/userusername/put/responses/Code400Response.md b/samples/client/petstore/java/docs/paths/userusername/put/responses/Code400Response.md deleted file mode 100644 index 6f3af2df6d2..00000000000 --- a/samples/client/petstore/java/docs/paths/userusername/put/responses/Code400Response.md +++ /dev/null @@ -1,32 +0,0 @@ -# Code400Response - -public class Code400Response - -A class that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code400Response.Code400Response1](#code400response1)
class that deserializes responses | - -## Code400Response1 -public static class Code400Response1
-extends ResponseDeserializer - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code400Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = MapUtils.makeMap(
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/userusername/put/responses/Code404Response.md b/samples/client/petstore/java/docs/paths/userusername/put/responses/Code404Response.md deleted file mode 100644 index ee00cd369a7..00000000000 --- a/samples/client/petstore/java/docs/paths/userusername/put/responses/Code404Response.md +++ /dev/null @@ -1,32 +0,0 @@ -# Code404Response - -public class Code404Response - -A class that contains necessary nested response classes -- a class that extends ResponseDeserializer and is used to deserialize responses - -## Nested Class Summary -| Modifier and Type | Class and Description | -| ----------------- | --------------------- | -| static class | [Code404Response.Code404Response1](#code404response1)
class that deserializes responses | - -## Code404Response1 -public static class Code404Response1
-extends ResponseDeserializer - -a class that deserializes responses - -### Constructor Summary -| Constructor and Description | -| --------------------------- | -| Code404Response1()
Creates an instance | - -### Field Summary -| Modifier and Type | Field and Description | -| ----------------- | --------------------- | -| Map | content = MapUtils.makeMap(
)
the contentType to schema info | - -### Method Summary -| Modifier and Type | Method and Description | -| ----------------- | ---------------------- | -| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/userusername/put/responses/UserusernamePutCode400Response.md b/samples/client/petstore/java/docs/paths/userusername/put/responses/UserusernamePutCode400Response.md new file mode 100644 index 00000000000..6512b98b518 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/userusername/put/responses/UserusernamePutCode400Response.md @@ -0,0 +1,32 @@ +# UserusernamePutCode400Response + +public class UserusernamePutCode400Response + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [UserusernamePutCode400Response.UserusernamePutCode400Response1](#userusernameputcode400response1)
class that deserializes responses | + +## UserusernamePutCode400Response1 +public static class UserusernamePutCode400Response1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernamePutCode400Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/docs/paths/userusername/put/responses/UserusernamePutCode404Response.md b/samples/client/petstore/java/docs/paths/userusername/put/responses/UserusernamePutCode404Response.md new file mode 100644 index 00000000000..7a175514d70 --- /dev/null +++ b/samples/client/petstore/java/docs/paths/userusername/put/responses/UserusernamePutCode404Response.md @@ -0,0 +1,32 @@ +# UserusernamePutCode404Response + +public class UserusernamePutCode404Response + +A class that contains necessary nested response classes +- a class that extends ResponseDeserializer and is used to deserialize responses + +## Nested Class Summary +| Modifier and Type | Class and Description | +| ----------------- | --------------------- | +| static class | [UserusernamePutCode404Response.UserusernamePutCode404Response1](#userusernameputcode404response1)
class that deserializes responses | + +## UserusernamePutCode404Response1 +public static class UserusernamePutCode404Response1
+extends ResponseDeserializer + +a class that deserializes responses + +### Constructor Summary +| Constructor and Description | +| --------------------------- | +| UserusernamePutCode404Response1()
Creates an instance | + +### Field Summary +| Modifier and Type | Field and Description | +| ----------------- | --------------------- | +| Map | content = MapUtils.makeMap(
)
the contentType to schema info | + +### Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| ApiResponse | deserialize(HttpResponse response, SchemaConfiguration configuration)
called by endpoint when deserialize responses | diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Anotherfakedummy.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Anotherfakedummy.java index b96500d8de6..b687c5fc891 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Anotherfakedummy.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Anotherfakedummy.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.anotherfakedummy.Patch; +import org.openapijsonschematools.client.paths.anotherfakedummy.AnotherfakedummyPatch; public class Anotherfakedummy extends ApiClient implements - Patch.PatchOperation + AnotherfakedummyPatch.PatchOperation { public Anotherfakedummy(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Commonparamsubdir.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Commonparamsubdir.java index f1717c68757..400521401ea 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Commonparamsubdir.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Commonparamsubdir.java @@ -3,14 +3,14 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.commonparamsubdir.Delete; -import org.openapijsonschematools.client.paths.commonparamsubdir.Get; -import org.openapijsonschematools.client.paths.commonparamsubdir.Post; +import org.openapijsonschematools.client.paths.commonparamsubdir.CommonparamsubdirDelete; +import org.openapijsonschematools.client.paths.commonparamsubdir.CommonparamsubdirGet; +import org.openapijsonschematools.client.paths.commonparamsubdir.CommonparamsubdirPost; public class Commonparamsubdir extends ApiClient implements - Delete.DeleteOperation, - Get.GetOperation, - Post.PostOperation + CommonparamsubdirDelete.DeleteOperation, + CommonparamsubdirGet.GetOperation, + CommonparamsubdirPost.PostOperation { public Commonparamsubdir(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fake.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fake.java index 2cadb3de28b..ac3c467aeb1 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fake.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fake.java @@ -3,16 +3,16 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fake.Delete; -import org.openapijsonschematools.client.paths.fake.Get; -import org.openapijsonschematools.client.paths.fake.Patch; -import org.openapijsonschematools.client.paths.fake.Post; +import org.openapijsonschematools.client.paths.fake.FakeDelete; +import org.openapijsonschematools.client.paths.fake.FakeGet; +import org.openapijsonschematools.client.paths.fake.FakePatch; +import org.openapijsonschematools.client.paths.fake.FakePost; public class Fake extends ApiClient implements - Delete.DeleteOperation, - Get.GetOperation, - Patch.PatchOperation, - Post.PostOperation + FakeDelete.DeleteOperation, + FakeGet.GetOperation, + FakePatch.PatchOperation, + FakePost.PostOperation { public Fake(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeadditionalpropertieswitharrayofenums.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeadditionalpropertieswitharrayofenums.java index 902986e4f1a..4bf9d268646 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeadditionalpropertieswitharrayofenums.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeadditionalpropertieswitharrayofenums.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.Get; +import org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.FakeadditionalpropertieswitharrayofenumsGet; public class Fakeadditionalpropertieswitharrayofenums extends ApiClient implements - Get.GetOperation + FakeadditionalpropertieswitharrayofenumsGet.GetOperation { public Fakeadditionalpropertieswitharrayofenums(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakebodywithfileschema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakebodywithfileschema.java index b29d43748eb..a89c0f20cb9 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakebodywithfileschema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakebodywithfileschema.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakebodywithfileschema.Put; +import org.openapijsonschematools.client.paths.fakebodywithfileschema.FakebodywithfileschemaPut; public class Fakebodywithfileschema extends ApiClient implements - Put.PutOperation + FakebodywithfileschemaPut.PutOperation { public Fakebodywithfileschema(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakebodywithqueryparams.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakebodywithqueryparams.java index 8ea41376bbe..6d592293a3d 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakebodywithqueryparams.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakebodywithqueryparams.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakebodywithqueryparams.Put; +import org.openapijsonschematools.client.paths.fakebodywithqueryparams.FakebodywithqueryparamsPut; public class Fakebodywithqueryparams extends ApiClient implements - Put.PutOperation + FakebodywithqueryparamsPut.PutOperation { public Fakebodywithqueryparams(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakecasesensitiveparams.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakecasesensitiveparams.java index 120a353ca22..efbc1ef7ff2 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakecasesensitiveparams.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakecasesensitiveparams.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakecasesensitiveparams.Put; +import org.openapijsonschematools.client.paths.fakecasesensitiveparams.FakecasesensitiveparamsPut; public class Fakecasesensitiveparams extends ApiClient implements - Put.PutOperation + FakecasesensitiveparamsPut.PutOperation { public Fakecasesensitiveparams(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeclassnametest.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeclassnametest.java index cfbadfcb722..53160a2beb8 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeclassnametest.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeclassnametest.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakeclassnametest.Patch; +import org.openapijsonschematools.client.paths.fakeclassnametest.FakeclassnametestPatch; public class Fakeclassnametest extends ApiClient implements - Patch.PatchOperation + FakeclassnametestPatch.PatchOperation { public Fakeclassnametest(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakedeletecoffeeid.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakedeletecoffeeid.java index db4535ddf34..5bd8e4f21a5 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakedeletecoffeeid.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakedeletecoffeeid.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakedeletecoffeeid.Delete; +import org.openapijsonschematools.client.paths.fakedeletecoffeeid.FakedeletecoffeeidDelete; public class Fakedeletecoffeeid extends ApiClient implements - Delete.DeleteOperation + FakedeletecoffeeidDelete.DeleteOperation { public Fakedeletecoffeeid(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakehealth.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakehealth.java index 58e692b13b4..391f0afd3a0 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakehealth.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakehealth.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakehealth.Get; +import org.openapijsonschematools.client.paths.fakehealth.FakehealthGet; public class Fakehealth extends ApiClient implements - Get.GetOperation + FakehealthGet.GetOperation { public Fakehealth(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeinlineadditionalproperties.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeinlineadditionalproperties.java index e528dc7fdf6..600ba72edd3 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeinlineadditionalproperties.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeinlineadditionalproperties.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.Post; +import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.FakeinlineadditionalpropertiesPost; public class Fakeinlineadditionalproperties extends ApiClient implements - Post.PostOperation + FakeinlineadditionalpropertiesPost.PostOperation { public Fakeinlineadditionalproperties(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeinlinecomposition.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeinlinecomposition.java index fb535e78d76..694beae690f 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeinlinecomposition.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeinlinecomposition.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakeinlinecomposition.Post; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.FakeinlinecompositionPost; public class Fakeinlinecomposition extends ApiClient implements - Post.PostOperation + FakeinlinecompositionPost.PostOperation { public Fakeinlinecomposition(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakejsonformdata.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakejsonformdata.java index 9417cc26264..aa70adcb670 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakejsonformdata.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakejsonformdata.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakejsonformdata.Get; +import org.openapijsonschematools.client.paths.fakejsonformdata.FakejsonformdataGet; public class Fakejsonformdata extends ApiClient implements - Get.GetOperation + FakejsonformdataGet.GetOperation { public Fakejsonformdata(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakejsonpatch.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakejsonpatch.java index 3c8c51c7950..373069d8e7e 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakejsonpatch.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakejsonpatch.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakejsonpatch.Patch; +import org.openapijsonschematools.client.paths.fakejsonpatch.FakejsonpatchPatch; public class Fakejsonpatch extends ApiClient implements - Patch.PatchOperation + FakejsonpatchPatch.PatchOperation { public Fakejsonpatch(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakejsonwithcharset.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakejsonwithcharset.java index e32bd66c62c..abf3406ac4d 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakejsonwithcharset.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakejsonwithcharset.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakejsonwithcharset.Post; +import org.openapijsonschematools.client.paths.fakejsonwithcharset.FakejsonwithcharsetPost; public class Fakejsonwithcharset extends ApiClient implements - Post.PostOperation + FakejsonwithcharsetPost.PostOperation { public Fakejsonwithcharset(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakemultiplerequestbodycontenttypes.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakemultiplerequestbodycontenttypes.java index a0a98250053..9e1ca236245 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakemultiplerequestbodycontenttypes.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakemultiplerequestbodycontenttypes.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.Post; +import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.FakemultiplerequestbodycontenttypesPost; public class Fakemultiplerequestbodycontenttypes extends ApiClient implements - Post.PostOperation + FakemultiplerequestbodycontenttypesPost.PostOperation { public Fakemultiplerequestbodycontenttypes(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakemultipleresponsebodies.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakemultipleresponsebodies.java index 6a85170bb25..91d15710637 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakemultipleresponsebodies.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakemultipleresponsebodies.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakemultipleresponsebodies.Get; +import org.openapijsonschematools.client.paths.fakemultipleresponsebodies.FakemultipleresponsebodiesGet; public class Fakemultipleresponsebodies extends ApiClient implements - Get.GetOperation + FakemultipleresponsebodiesGet.GetOperation { public Fakemultipleresponsebodies(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakemultiplesecurities.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakemultiplesecurities.java index f5d91eaff14..d7cc6cbbcc6 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakemultiplesecurities.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakemultiplesecurities.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakemultiplesecurities.Get; +import org.openapijsonschematools.client.paths.fakemultiplesecurities.FakemultiplesecuritiesGet; public class Fakemultiplesecurities extends ApiClient implements - Get.GetOperation + FakemultiplesecuritiesGet.GetOperation { public Fakemultiplesecurities(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeobjinquery.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeobjinquery.java index 054390b63be..793a01568fd 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeobjinquery.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeobjinquery.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakeobjinquery.Get; +import org.openapijsonschematools.client.paths.fakeobjinquery.FakeobjinqueryGet; public class Fakeobjinquery extends ApiClient implements - Get.GetOperation + FakeobjinqueryGet.GetOperation { public Fakeobjinquery(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeparametercollisions1ababselfab.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeparametercollisions1ababselfab.java index 3980e253303..8b399939b4c 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeparametercollisions1ababselfab.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeparametercollisions1ababselfab.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.Post; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.Fakeparametercollisions1ababselfabPost; public class Fakeparametercollisions1ababselfab extends ApiClient implements - Post.PostOperation + Fakeparametercollisions1ababselfabPost.PostOperation { public Fakeparametercollisions1ababselfab(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakepemcontenttype.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakepemcontenttype.java index 2fe9f5087b6..4ca9fe02e9e 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakepemcontenttype.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakepemcontenttype.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakepemcontenttype.Get; +import org.openapijsonschematools.client.paths.fakepemcontenttype.FakepemcontenttypeGet; public class Fakepemcontenttype extends ApiClient implements - Get.GetOperation + FakepemcontenttypeGet.GetOperation { public Fakepemcontenttype(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakepetiduploadimagewithrequiredfile.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakepetiduploadimagewithrequiredfile.java index d5be7e96039..bbd2557c597 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakepetiduploadimagewithrequiredfile.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakepetiduploadimagewithrequiredfile.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.Post; +import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.FakepetiduploadimagewithrequiredfilePost; public class Fakepetiduploadimagewithrequiredfile extends ApiClient implements - Post.PostOperation + FakepetiduploadimagewithrequiredfilePost.PostOperation { public Fakepetiduploadimagewithrequiredfile(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakequeryparamwithjsoncontenttype.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakequeryparamwithjsoncontenttype.java index fbb17e7d0c0..553ed3c4117 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakequeryparamwithjsoncontenttype.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakequeryparamwithjsoncontenttype.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.Get; +import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.FakequeryparamwithjsoncontenttypeGet; public class Fakequeryparamwithjsoncontenttype extends ApiClient implements - Get.GetOperation + FakequeryparamwithjsoncontenttypeGet.GetOperation { public Fakequeryparamwithjsoncontenttype(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeredirection.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeredirection.java index efe0033e513..828e7ba3327 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeredirection.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeredirection.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakeredirection.Get; +import org.openapijsonschematools.client.paths.fakeredirection.FakeredirectionGet; public class Fakeredirection extends ApiClient implements - Get.GetOperation + FakeredirectionGet.GetOperation { public Fakeredirection(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefobjinquery.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefobjinquery.java index b939a7c7b43..15bc931dce8 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefobjinquery.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefobjinquery.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakerefobjinquery.Get; +import org.openapijsonschematools.client.paths.fakerefobjinquery.FakerefobjinqueryGet; public class Fakerefobjinquery extends ApiClient implements - Get.GetOperation + FakerefobjinqueryGet.GetOperation { public Fakerefobjinquery(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsarraymodel.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsarraymodel.java index 15e1f153ba3..250a772fbc1 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsarraymodel.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsarraymodel.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakerefsarraymodel.Post; +import org.openapijsonschematools.client.paths.fakerefsarraymodel.FakerefsarraymodelPost; public class Fakerefsarraymodel extends ApiClient implements - Post.PostOperation + FakerefsarraymodelPost.PostOperation { public Fakerefsarraymodel(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsarrayofenums.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsarrayofenums.java index 211075237b6..988912d6318 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsarrayofenums.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsarrayofenums.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakerefsarrayofenums.Post; +import org.openapijsonschematools.client.paths.fakerefsarrayofenums.FakerefsarrayofenumsPost; public class Fakerefsarrayofenums extends ApiClient implements - Post.PostOperation + FakerefsarrayofenumsPost.PostOperation { public Fakerefsarrayofenums(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsboolean.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsboolean.java index 9f9d4604bf5..85159625e64 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsboolean.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsboolean.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakerefsboolean.Post; +import org.openapijsonschematools.client.paths.fakerefsboolean.FakerefsbooleanPost; public class Fakerefsboolean extends ApiClient implements - Post.PostOperation + FakerefsbooleanPost.PostOperation { public Fakerefsboolean(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefscomposedoneofnumberwithvalidations.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefscomposedoneofnumberwithvalidations.java index 7803c3943cc..a129e1082de 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefscomposedoneofnumberwithvalidations.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefscomposedoneofnumberwithvalidations.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.Post; +import org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.FakerefscomposedoneofnumberwithvalidationsPost; public class Fakerefscomposedoneofnumberwithvalidations extends ApiClient implements - Post.PostOperation + FakerefscomposedoneofnumberwithvalidationsPost.PostOperation { public Fakerefscomposedoneofnumberwithvalidations(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsenum.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsenum.java index 45d740d1e97..8ba08ff3be7 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsenum.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsenum.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakerefsenum.Post; +import org.openapijsonschematools.client.paths.fakerefsenum.FakerefsenumPost; public class Fakerefsenum extends ApiClient implements - Post.PostOperation + FakerefsenumPost.PostOperation { public Fakerefsenum(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsmammal.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsmammal.java index 5ba915d49ad..2ccab524251 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsmammal.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsmammal.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakerefsmammal.Post; +import org.openapijsonschematools.client.paths.fakerefsmammal.FakerefsmammalPost; public class Fakerefsmammal extends ApiClient implements - Post.PostOperation + FakerefsmammalPost.PostOperation { public Fakerefsmammal(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsnumber.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsnumber.java index 8be0ed82a67..f1427e288f3 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsnumber.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsnumber.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakerefsnumber.Post; +import org.openapijsonschematools.client.paths.fakerefsnumber.FakerefsnumberPost; public class Fakerefsnumber extends ApiClient implements - Post.PostOperation + FakerefsnumberPost.PostOperation { public Fakerefsnumber(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsobjectmodelwithrefprops.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsobjectmodelwithrefprops.java index 8efd99ec952..ed6b1aff9fc 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsobjectmodelwithrefprops.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsobjectmodelwithrefprops.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.Post; +import org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.FakerefsobjectmodelwithrefpropsPost; public class Fakerefsobjectmodelwithrefprops extends ApiClient implements - Post.PostOperation + FakerefsobjectmodelwithrefpropsPost.PostOperation { public Fakerefsobjectmodelwithrefprops(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsstring.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsstring.java index 0e1120f0490..bc6044ae3df 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsstring.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakerefsstring.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakerefsstring.Post; +import org.openapijsonschematools.client.paths.fakerefsstring.FakerefsstringPost; public class Fakerefsstring extends ApiClient implements - Post.PostOperation + FakerefsstringPost.PostOperation { public Fakerefsstring(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeresponsewithoutschema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeresponsewithoutschema.java index 2b3b017a001..6219862cf7d 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeresponsewithoutschema.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeresponsewithoutschema.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakeresponsewithoutschema.Get; +import org.openapijsonschematools.client.paths.fakeresponsewithoutschema.FakeresponsewithoutschemaGet; public class Fakeresponsewithoutschema extends ApiClient implements - Get.GetOperation + FakeresponsewithoutschemaGet.GetOperation { public Fakeresponsewithoutschema(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Faketestqueryparamters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Faketestqueryparamters.java index e304bfcefab..cc22cfe66be 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Faketestqueryparamters.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Faketestqueryparamters.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.faketestqueryparamters.Put; +import org.openapijsonschematools.client.paths.faketestqueryparamters.FaketestqueryparamtersPut; public class Faketestqueryparamters extends ApiClient implements - Put.PutOperation + FaketestqueryparamtersPut.PutOperation { public Faketestqueryparamters(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeuploaddownloadfile.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeuploaddownloadfile.java index 49440fbd9e2..87b8ed880ff 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeuploaddownloadfile.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeuploaddownloadfile.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.Post; +import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.FakeuploaddownloadfilePost; public class Fakeuploaddownloadfile extends ApiClient implements - Post.PostOperation + FakeuploaddownloadfilePost.PostOperation { public Fakeuploaddownloadfile(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeuploadfile.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeuploadfile.java index 460e055ed5a..8b8f6ce8678 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeuploadfile.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeuploadfile.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakeuploadfile.Post; +import org.openapijsonschematools.client.paths.fakeuploadfile.FakeuploadfilePost; public class Fakeuploadfile extends ApiClient implements - Post.PostOperation + FakeuploadfilePost.PostOperation { public Fakeuploadfile(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeuploadfiles.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeuploadfiles.java index e1fab8525f2..1a95591c6ac 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeuploadfiles.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakeuploadfiles.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakeuploadfiles.Post; +import org.openapijsonschematools.client.paths.fakeuploadfiles.FakeuploadfilesPost; public class Fakeuploadfiles extends ApiClient implements - Post.PostOperation + FakeuploadfilesPost.PostOperation { public Fakeuploadfiles(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakewildcardresponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakewildcardresponses.java index 2b78ed8990a..7abc3e972d0 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakewildcardresponses.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Fakewildcardresponses.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.fakewildcardresponses.Get; +import org.openapijsonschematools.client.paths.fakewildcardresponses.FakewildcardresponsesGet; public class Fakewildcardresponses extends ApiClient implements - Get.GetOperation + FakewildcardresponsesGet.GetOperation { public Fakewildcardresponses(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Foo.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Foo.java index 60f398da011..f17acf763b0 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Foo.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Foo.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.foo.Get; +import org.openapijsonschematools.client.paths.foo.FooGet; public class Foo extends ApiClient implements - Get.GetOperation + FooGet.GetOperation { public Foo(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Pet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Pet.java index e64187644af..47a158d79f1 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Pet.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Pet.java @@ -3,12 +3,12 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.pet.Post; -import org.openapijsonschematools.client.paths.pet.Put; +import org.openapijsonschematools.client.paths.pet.PetPost; +import org.openapijsonschematools.client.paths.pet.PetPut; public class Pet extends ApiClient implements - Post.PostOperation, - Put.PutOperation + PetPost.PostOperation, + PetPut.PutOperation { public Pet(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Petfindbystatus.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Petfindbystatus.java index 26340368d45..0c4c1996263 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Petfindbystatus.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Petfindbystatus.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.petfindbystatus.Get; +import org.openapijsonschematools.client.paths.petfindbystatus.PetfindbystatusGet; public class Petfindbystatus extends ApiClient implements - Get.GetOperation + PetfindbystatusGet.GetOperation { public Petfindbystatus(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Petfindbytags.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Petfindbytags.java index 1acb4910d89..10c9d0081b3 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Petfindbytags.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Petfindbytags.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.petfindbytags.Get; +import org.openapijsonschematools.client.paths.petfindbytags.PetfindbytagsGet; public class Petfindbytags extends ApiClient implements - Get.GetOperation + PetfindbytagsGet.GetOperation { public Petfindbytags(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Petpetid.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Petpetid.java index eddc15f7999..a1fb089c3d3 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Petpetid.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Petpetid.java @@ -3,14 +3,14 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.petpetid.Delete; -import org.openapijsonschematools.client.paths.petpetid.Get; -import org.openapijsonschematools.client.paths.petpetid.Post; +import org.openapijsonschematools.client.paths.petpetid.PetpetidDelete; +import org.openapijsonschematools.client.paths.petpetid.PetpetidGet; +import org.openapijsonschematools.client.paths.petpetid.PetpetidPost; public class Petpetid extends ApiClient implements - Delete.DeleteOperation, - Get.GetOperation, - Post.PostOperation + PetpetidDelete.DeleteOperation, + PetpetidGet.GetOperation, + PetpetidPost.PostOperation { public Petpetid(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Petpetiduploadimage.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Petpetiduploadimage.java index fcc5f547542..2e66215c65e 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Petpetiduploadimage.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Petpetiduploadimage.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.petpetiduploadimage.Post; +import org.openapijsonschematools.client.paths.petpetiduploadimage.PetpetiduploadimagePost; public class Petpetiduploadimage extends ApiClient implements - Post.PostOperation + PetpetiduploadimagePost.PostOperation { public Petpetiduploadimage(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Solidus.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Solidus.java index d4a5ba55c59..cf5e430d52a 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Solidus.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Solidus.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.solidus.Get; +import org.openapijsonschematools.client.paths.solidus.SolidusGet; public class Solidus extends ApiClient implements - Get.GetOperation + SolidusGet.GetOperation { public Solidus(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Storeinventory.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Storeinventory.java index 427a6023a0d..bcab950278d 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Storeinventory.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Storeinventory.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.storeinventory.Get; +import org.openapijsonschematools.client.paths.storeinventory.StoreinventoryGet; public class Storeinventory extends ApiClient implements - Get.GetOperation + StoreinventoryGet.GetOperation { public Storeinventory(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Storeorder.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Storeorder.java index f96c91e28be..e7e03c2bffa 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Storeorder.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Storeorder.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.storeorder.Post; +import org.openapijsonschematools.client.paths.storeorder.StoreorderPost; public class Storeorder extends ApiClient implements - Post.PostOperation + StoreorderPost.PostOperation { public Storeorder(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Storeorderorderid.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Storeorderorderid.java index 2ae9840bfb3..4a6c78c4428 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Storeorderorderid.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Storeorderorderid.java @@ -3,12 +3,12 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.storeorderorderid.Delete; -import org.openapijsonschematools.client.paths.storeorderorderid.Get; +import org.openapijsonschematools.client.paths.storeorderorderid.StoreorderorderidDelete; +import org.openapijsonschematools.client.paths.storeorderorderid.StoreorderorderidGet; public class Storeorderorderid extends ApiClient implements - Delete.DeleteOperation, - Get.GetOperation + StoreorderorderidDelete.DeleteOperation, + StoreorderorderidGet.GetOperation { public Storeorderorderid(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/User.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/User.java index dc6340be833..d5797033de0 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/User.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/User.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.user.Post; +import org.openapijsonschematools.client.paths.user.UserPost; public class User extends ApiClient implements - Post.PostOperation + UserPost.PostOperation { public User(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Usercreatewitharray.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Usercreatewitharray.java index 10a36f1bcf2..ad5b8a37613 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Usercreatewitharray.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Usercreatewitharray.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.usercreatewitharray.Post; +import org.openapijsonschematools.client.paths.usercreatewitharray.UsercreatewitharrayPost; public class Usercreatewitharray extends ApiClient implements - Post.PostOperation + UsercreatewitharrayPost.PostOperation { public Usercreatewitharray(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Usercreatewithlist.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Usercreatewithlist.java index 49c1c2d4462..e110f8de79b 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Usercreatewithlist.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Usercreatewithlist.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.usercreatewithlist.Post; +import org.openapijsonschematools.client.paths.usercreatewithlist.UsercreatewithlistPost; public class Usercreatewithlist extends ApiClient implements - Post.PostOperation + UsercreatewithlistPost.PostOperation { public Usercreatewithlist(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Userlogin.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Userlogin.java index c078435825e..5059623c6d1 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Userlogin.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Userlogin.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.userlogin.Get; +import org.openapijsonschematools.client.paths.userlogin.UserloginGet; public class Userlogin extends ApiClient implements - Get.GetOperation + UserloginGet.GetOperation { public Userlogin(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Userlogout.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Userlogout.java index 5b58353ec75..00de9ce4f8d 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Userlogout.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Userlogout.java @@ -3,10 +3,10 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.userlogout.Get; +import org.openapijsonschematools.client.paths.userlogout.UserlogoutGet; public class Userlogout extends ApiClient implements - Get.GetOperation + UserlogoutGet.GetOperation { public Userlogout(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Userusername.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Userusername.java index 2b967538231..9fc5cde71ca 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Userusername.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/paths/Userusername.java @@ -3,14 +3,14 @@ import org.openapijsonschematools.client.apiclient.ApiClient; import org.openapijsonschematools.client.configurations.ApiConfiguration; import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.paths.userusername.Delete; -import org.openapijsonschematools.client.paths.userusername.Get; -import org.openapijsonschematools.client.paths.userusername.Put; +import org.openapijsonschematools.client.paths.userusername.UserusernameDelete; +import org.openapijsonschematools.client.paths.userusername.UserusernameGet; +import org.openapijsonschematools.client.paths.userusername.UserusernamePut; public class Userusername extends ApiClient implements - Delete.DeleteOperation, - Get.GetOperation, - Put.PutOperation + UserusernameDelete.DeleteOperation, + UserusernameGet.GetOperation, + UserusernamePut.PutOperation { public Userusername(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/tags/Anotherfake.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/tags/Anotherfake.java new file mode 100644 index 00000000000..844875c8f4b --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/tags/Anotherfake.java @@ -0,0 +1,14 @@ +package org.openapijsonschematools.client.apis.tags; + +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.paths.anotherfakedummy.AnotherfakedummyPatch; + +public class Anotherfake extends ApiClient implements + AnotherfakedummyPatch.Model123TestSpecialTagsOperation +{ + public Anotherfake(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } +} \ No newline at end of file diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/tags/Default.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/tags/Default.java new file mode 100644 index 00000000000..b55a09a58f4 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/tags/Default.java @@ -0,0 +1,14 @@ +package org.openapijsonschematools.client.apis.tags; + +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.paths.foo.FooGet; + +public class Default extends ApiClient implements + FooGet.FooGetOperation +{ + public Default(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } +} \ No newline at end of file diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/tags/Fake.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/tags/Fake.java new file mode 100644 index 00000000000..2694e40d4c0 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/tags/Fake.java @@ -0,0 +1,98 @@ +package org.openapijsonschematools.client.apis.tags; + +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.paths.fakejsonpatch.FakejsonpatchPatch; +import org.openapijsonschematools.client.paths.fakerefsarrayofenums.FakerefsarrayofenumsPost; +import org.openapijsonschematools.client.paths.commonparamsubdir.CommonparamsubdirDelete; +import org.openapijsonschematools.client.paths.commonparamsubdir.CommonparamsubdirGet; +import org.openapijsonschematools.client.paths.commonparamsubdir.CommonparamsubdirPost; +import org.openapijsonschematools.client.paths.fakecasesensitiveparams.FakecasesensitiveparamsPut; +import org.openapijsonschematools.client.paths.fakewildcardresponses.FakewildcardresponsesGet; +import org.openapijsonschematools.client.paths.fakebodywithqueryparams.FakebodywithqueryparamsPut; +import org.openapijsonschematools.client.paths.fakejsonwithcharset.FakejsonwithcharsetPost; +import org.openapijsonschematools.client.paths.fakerefsarraymodel.FakerefsarraymodelPost; +import org.openapijsonschematools.client.paths.fakehealth.FakehealthGet; +import org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.FakerefscomposedoneofnumberwithvalidationsPost; +import org.openapijsonschematools.client.paths.fakerefobjinquery.FakerefobjinqueryGet; +import org.openapijsonschematools.client.paths.fakebodywithfileschema.FakebodywithfileschemaPut; +import org.openapijsonschematools.client.paths.fakerefsenum.FakerefsenumPost; +import org.openapijsonschematools.client.paths.fakeredirection.FakeredirectionGet; +import org.openapijsonschematools.client.paths.fakeuploadfile.FakeuploadfilePost; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.FakeinlinecompositionPost; +import org.openapijsonschematools.client.paths.fake.FakeDelete; +import org.openapijsonschematools.client.paths.fake.FakeGet; +import org.openapijsonschematools.client.paths.fake.FakePatch; +import org.openapijsonschematools.client.paths.fake.FakePost; +import org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.FakerefsobjectmodelwithrefpropsPost; +import org.openapijsonschematools.client.paths.fakepemcontenttype.FakepemcontenttypeGet; +import org.openapijsonschematools.client.paths.fakerefsnumber.FakerefsnumberPost; +import org.openapijsonschematools.client.paths.fakerefsstring.FakerefsstringPost; +import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.FakeinlineadditionalpropertiesPost; +import org.openapijsonschematools.client.paths.fakerefsmammal.FakerefsmammalPost; +import org.openapijsonschematools.client.paths.solidus.SolidusGet; +import org.openapijsonschematools.client.paths.fakerefsboolean.FakerefsbooleanPost; +import org.openapijsonschematools.client.paths.fakejsonformdata.FakejsonformdataGet; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.Fakeparametercollisions1ababselfabPost; +import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.FakequeryparamwithjsoncontenttypeGet; +import org.openapijsonschematools.client.paths.fakeobjinquery.FakeobjinqueryGet; +import org.openapijsonschematools.client.paths.fakemultiplesecurities.FakemultiplesecuritiesGet; +import org.openapijsonschematools.client.paths.faketestqueryparamters.FaketestqueryparamtersPut; +import org.openapijsonschematools.client.paths.fakemultipleresponsebodies.FakemultipleresponsebodiesGet; +import org.openapijsonschematools.client.paths.fakeresponsewithoutschema.FakeresponsewithoutschemaGet; +import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.FakemultiplerequestbodycontenttypesPost; +import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.FakeuploaddownloadfilePost; +import org.openapijsonschematools.client.paths.fakeuploadfiles.FakeuploadfilesPost; +import org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.FakeadditionalpropertieswitharrayofenumsGet; +import org.openapijsonschematools.client.paths.fakedeletecoffeeid.FakedeletecoffeeidDelete; + +public class Fake extends ApiClient implements + FakejsonpatchPatch.JsonPatchOperation, + FakerefsarrayofenumsPost.ArrayOfEnumsOperation, + CommonparamsubdirDelete.DeleteCommonParamOperation, + CommonparamsubdirGet.GetCommonParamOperation, + CommonparamsubdirPost.PostCommonParamOperation, + FakecasesensitiveparamsPut.CaseSensitiveParamsOperation, + FakewildcardresponsesGet.WildCardResponsesOperation, + FakebodywithqueryparamsPut.BodyWithQueryParamsOperation, + FakejsonwithcharsetPost.JsonWithCharsetOperation, + FakerefsarraymodelPost.ArrayModelOperation, + FakehealthGet.FakeHealthGetOperation, + FakerefscomposedoneofnumberwithvalidationsPost.ComposedOneOfDifferentTypesOperation, + FakerefobjinqueryGet.RefObjectInQueryOperation, + FakebodywithfileschemaPut.BodyWithFileSchemaOperation, + FakerefsenumPost.StringEnumOperation, + FakeredirectionGet.RedirectionOperation, + FakeuploadfilePost.UploadFileOperation, + FakeinlinecompositionPost.InlineCompositionOperation, + FakeDelete.GroupParametersOperation, + FakeGet.EnumParametersOperation, + FakePatch.ClientModelOperation, + FakePost.EndpointParametersOperation, + FakerefsobjectmodelwithrefpropsPost.ObjectModelWithRefPropsOperation, + FakepemcontenttypeGet.PemContentTypeOperation, + FakerefsnumberPost.NumberWithValidationsOperation, + FakerefsstringPost.ModelStringOperation, + FakeinlineadditionalpropertiesPost.InlineAdditionalPropertiesOperation, + FakerefsmammalPost.MammalOperation, + SolidusGet.SlashRouteOperation, + FakerefsbooleanPost.ModelBooleanOperation, + FakejsonformdataGet.JsonFormDataOperation, + Fakeparametercollisions1ababselfabPost.ParameterCollisionsOperation, + FakequeryparamwithjsoncontenttypeGet.QueryParamWithJsonContentTypeOperation, + FakeobjinqueryGet.ObjectInQueryOperation, + FakemultiplesecuritiesGet.MultipleSecuritiesOperation, + FaketestqueryparamtersPut.QueryParameterCollectionFormatOperation, + FakemultipleresponsebodiesGet.MultipleResponseBodiesOperation, + FakeresponsewithoutschemaGet.ResponseWithoutSchemaOperation, + FakemultiplerequestbodycontenttypesPost.MultipleRequestBodyContentTypesOperation, + FakeuploaddownloadfilePost.UploadDownloadFileOperation, + FakeuploadfilesPost.UploadFilesOperation, + FakeadditionalpropertieswitharrayofenumsGet.AdditionalPropertiesWithArrayOfEnumsOperation, + FakedeletecoffeeidDelete.DeleteCoffeeOperation +{ + public Fake(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } +} \ No newline at end of file diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/tags/Fakeclassnametags123.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/tags/Fakeclassnametags123.java new file mode 100644 index 00000000000..2a727a57e08 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/tags/Fakeclassnametags123.java @@ -0,0 +1,14 @@ +package org.openapijsonschematools.client.apis.tags; + +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.paths.fakeclassnametest.FakeclassnametestPatch; + +public class Fakeclassnametags123 extends ApiClient implements + FakeclassnametestPatch.ClassnameOperation +{ + public Fakeclassnametags123(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } +} \ No newline at end of file diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/tags/Pet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/tags/Pet.java new file mode 100644 index 00000000000..5c0c6e39569 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/tags/Pet.java @@ -0,0 +1,30 @@ +package org.openapijsonschematools.client.apis.tags; + +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.FakepetiduploadimagewithrequiredfilePost; +import org.openapijsonschematools.client.paths.pet.PetPost; +import org.openapijsonschematools.client.paths.pet.PetPut; +import org.openapijsonschematools.client.paths.petfindbytags.PetfindbytagsGet; +import org.openapijsonschematools.client.paths.petfindbystatus.PetfindbystatusGet; +import org.openapijsonschematools.client.paths.petpetiduploadimage.PetpetiduploadimagePost; +import org.openapijsonschematools.client.paths.petpetid.PetpetidDelete; +import org.openapijsonschematools.client.paths.petpetid.PetpetidGet; +import org.openapijsonschematools.client.paths.petpetid.PetpetidPost; + +public class Pet extends ApiClient implements + FakepetiduploadimagewithrequiredfilePost.UploadFileWithRequiredFileOperation, + PetPost.AddPetOperation, + PetPut.UpdatePetOperation, + PetfindbytagsGet.FindPetsByTagsOperation, + PetfindbystatusGet.FindPetsByStatusOperation, + PetpetiduploadimagePost.UploadImageOperation, + PetpetidDelete.DeletePetOperation, + PetpetidGet.GetPetByIdOperation, + PetpetidPost.UpdatePetWithFormOperation +{ + public Pet(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } +} \ No newline at end of file diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/tags/Store.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/tags/Store.java new file mode 100644 index 00000000000..04d51443ec5 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/tags/Store.java @@ -0,0 +1,20 @@ +package org.openapijsonschematools.client.apis.tags; + +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.paths.storeinventory.StoreinventoryGet; +import org.openapijsonschematools.client.paths.storeorderorderid.StoreorderorderidDelete; +import org.openapijsonschematools.client.paths.storeorderorderid.StoreorderorderidGet; +import org.openapijsonschematools.client.paths.storeorder.StoreorderPost; + +public class Store extends ApiClient implements + StoreinventoryGet.GetInventoryOperation, + StoreorderorderidDelete.DeleteOrderOperation, + StoreorderorderidGet.GetOrderByIdOperation, + StoreorderPost.PlaceOrderOperation +{ + public Store(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } +} \ No newline at end of file diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/tags/User.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/tags/User.java new file mode 100644 index 00000000000..f8c47d501e1 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/apis/tags/User.java @@ -0,0 +1,28 @@ +package org.openapijsonschematools.client.apis.tags; + +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.paths.userlogout.UserlogoutGet; +import org.openapijsonschematools.client.paths.usercreatewitharray.UsercreatewitharrayPost; +import org.openapijsonschematools.client.paths.user.UserPost; +import org.openapijsonschematools.client.paths.userlogin.UserloginGet; +import org.openapijsonschematools.client.paths.userusername.UserusernameDelete; +import org.openapijsonschematools.client.paths.userusername.UserusernameGet; +import org.openapijsonschematools.client.paths.userusername.UserusernamePut; +import org.openapijsonschematools.client.paths.usercreatewithlist.UsercreatewithlistPost; + +public class User extends ApiClient implements + UserlogoutGet.LogoutUserOperation, + UsercreatewitharrayPost.CreateUsersWithArrayInputOperation, + UserPost.CreateUserOperation, + UserloginGet.LoginUserOperation, + UserusernameDelete.DeleteUserOperation, + UserusernameGet.GetUserByNameOperation, + UserusernamePut.UpdateUserOperation, + UsercreatewithlistPost.CreateUsersWithListInputOperation +{ + public User(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } +} \ No newline at end of file diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/AnotherfakedummyPatch.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/AnotherfakedummyPatch.java new file mode 100644 index 00000000000..3351c5abf40 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/AnotherfakedummyPatch.java @@ -0,0 +1,183 @@ +package org.openapijsonschematools.client.paths.anotherfakedummy; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.anotherfakedummy.patch.AnotherfakedummyPatchRequestBody; +import org.openapijsonschematools.client.paths.anotherfakedummy.patch.AnotherfakedummyPatchResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Anotherfakedummy; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class AnotherfakedummyPatch { + private static class PatchProvider { + private static final String method = "patch"; + + public static AnotherfakedummyPatchResponses.EndpointResponse patch( + PatchRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + SerializedRequestBody serializedRequestBody = new AnotherfakedummyPatchRequestBody.AnotherfakedummyPatchRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Anotherfakedummy.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new AnotherfakedummyPatchResponses.AnotherfakedummyPatchResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PatchOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default AnotherfakedummyPatchResponses.EndpointResponse patch(PatchRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PatchProvider.patch(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface Model123TestSpecialTagsOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default AnotherfakedummyPatchResponses.EndpointResponse model123TestSpecialTags(PatchRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PatchProvider.patch(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Patch extends ApiClient implements PatchOperation { + public Patch(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PatchRequest { + public AnotherfakedummyPatchRequestBody.SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + + public PatchRequest( + AnotherfakedummyPatchRequestBody.SealedRequestBody requestBody, + RootServerInfo.@Nullable ServerIndex serverIndex, + @Nullable Duration timeout + ) { + this.requestBody = requestBody; + this.serverIndex = serverIndex; + this.timeout = timeout; + } + } + + public static class PatchNullableRequest { + public AnotherfakedummyPatchRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + PatchNullableRequest getInstance(); + T getBuilderAfterServerIndex(PatchNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PatchNullableRequest getInstance(); + T getBuilderAfterTimeout(PatchNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForRequestBody { + PatchNullableRequest getInstance(); + T getBuilderAfterRequestBody(PatchNullableRequest instance); + default T requestBody(AnotherfakedummyPatchRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public static class Patch0RequestBuilder implements SetterForServerIndex, SetterForTimeout { + private final PatchNullableRequest instance; + + public Patch0RequestBuilder(PatchNullableRequest instance) { + this.instance = instance; + } + + public PatchRequest build() { + var requestBody = instance.requestBody; + if (requestBody == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new PatchRequest( + requestBody, + instance.serverIndex, + instance.timeout + ); + } + + public PatchNullableRequest getInstance() { + return instance; + } + + public Patch0RequestBuilder getBuilderAfterServerIndex(PatchNullableRequest instance) { + return this; + } + + public Patch0RequestBuilder getBuilderAfterTimeout(PatchNullableRequest instance) { + return this; + } + } + public static class PatchRequestBuilder implements SetterForRequestBody { + private final PatchNullableRequest instance; + + public PatchRequestBuilder() { + this.instance = new PatchNullableRequest(); + } + + public PatchNullableRequest getInstance() { + return instance; + } + + public Patch0RequestBuilder getBuilderAfterRequestBody(PatchNullableRequest instance) { + return new Patch0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/Patch.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/Patch.java deleted file mode 100644 index b6dd1d97b37..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/Patch.java +++ /dev/null @@ -1,174 +0,0 @@ -package org.openapijsonschematools.client.paths.anotherfakedummy; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.anotherfakedummy.patch.RequestBody; -import org.openapijsonschematools.client.paths.anotherfakedummy.patch.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Anotherfakedummy; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Patch { - private static class PatchProvider { - private static final String method = "patch"; - - public static Responses.EndpointResponse patch( - PatchRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - SerializedRequestBody serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Anotherfakedummy.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PatchOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse patch(PatchRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PatchProvider.patch(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Patch1 extends ApiClient implements PatchOperation { - public Patch1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PatchRequest { - public RequestBody.SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - - public PatchRequest( - RequestBody.SealedRequestBody requestBody, - RootServerInfo.@Nullable ServerIndex serverIndex, - @Nullable Duration timeout - ) { - this.requestBody = requestBody; - this.serverIndex = serverIndex; - this.timeout = timeout; - } - } - - public static class PatchNullableRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - PatchNullableRequest getInstance(); - T getBuilderAfterServerIndex(PatchNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PatchNullableRequest getInstance(); - T getBuilderAfterTimeout(PatchNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForRequestBody { - PatchNullableRequest getInstance(); - T getBuilderAfterRequestBody(PatchNullableRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public static class Patch0RequestBuilder implements SetterForServerIndex, SetterForTimeout { - private final PatchNullableRequest instance; - - public Patch0RequestBuilder(PatchNullableRequest instance) { - this.instance = instance; - } - - public PatchRequest build() { - var requestBody = instance.requestBody; - if (requestBody == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new PatchRequest( - requestBody, - instance.serverIndex, - instance.timeout - ); - } - - public PatchNullableRequest getInstance() { - return instance; - } - - public Patch0RequestBuilder getBuilderAfterServerIndex(PatchNullableRequest instance) { - return this; - } - - public Patch0RequestBuilder getBuilderAfterTimeout(PatchNullableRequest instance) { - return this; - } - } - public static class PatchRequestBuilder implements SetterForRequestBody { - private final PatchNullableRequest instance; - - public PatchRequestBuilder() { - this.instance = new PatchNullableRequest(); - } - - public PatchNullableRequest getInstance() { - return instance; - } - - public Patch0RequestBuilder getBuilderAfterRequestBody(PatchNullableRequest instance) { - return new Patch0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/AnotherfakedummyPatchRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/AnotherfakedummyPatchRequestBody.java new file mode 100644 index 00000000000..38254a8d0e3 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/AnotherfakedummyPatchRequestBody.java @@ -0,0 +1,11 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.anotherfakedummy.patch; + +import org.openapijsonschematools.client.components.requestbodies.Client; + +public class AnotherfakedummyPatchRequestBody extends Client { + public static class AnotherfakedummyPatchRequestBody1 extends Client1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/AnotherfakedummyPatchResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/AnotherfakedummyPatchResponses.java new file mode 100644 index 00000000000..a5f6eda3357 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/AnotherfakedummyPatchResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.anotherfakedummy.patch; + +import org.openapijsonschematools.client.paths.anotherfakedummy.patch.responses.AnotherfakedummyPatchCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class AnotherfakedummyPatchResponses { + public sealed interface EndpointResponse permits EndpointAnotherfakedummyPatchCode200Response {} + + public record EndpointAnotherfakedummyPatchCode200Response( + HttpResponse response, + AnotherfakedummyPatchCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusAnotherfakedummyPatchCode200ResponseDeserializer {} + + public static final class StatusAnotherfakedummyPatchCode200ResponseDeserializer extends AnotherfakedummyPatchCode200Response.AnotherfakedummyPatchCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class AnotherfakedummyPatchResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public AnotherfakedummyPatchResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusAnotherfakedummyPatchCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusAnotherfakedummyPatchCode200ResponseDeserializer castDeserializer = (StatusAnotherfakedummyPatchCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointAnotherfakedummyPatchCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/RequestBody.java deleted file mode 100644 index 00c7e68653c..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/RequestBody.java +++ /dev/null @@ -1,11 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.anotherfakedummy.patch; - -import org.openapijsonschematools.client.components.requestbodies.Client; - -public class RequestBody extends Client { - public static class RequestBody1 extends Client1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/Responses.java deleted file mode 100644 index ee80dad1860..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.anotherfakedummy.patch; - -import org.openapijsonschematools.client.paths.anotherfakedummy.patch.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/responses/AnotherfakedummyPatchCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/responses/AnotherfakedummyPatchCode200Response.java new file mode 100644 index 00000000000..41c15430532 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/responses/AnotherfakedummyPatchCode200Response.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.anotherfakedummy.patch.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.anotherfakedummy.patch.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class AnotherfakedummyPatchCode200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.Client1Boxed body) implements SealedResponseBody { } + + public static class AnotherfakedummyPatchCode200Response1 extends ResponseDeserializer { + public AnotherfakedummyPatchCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/responses/Code200Response.java deleted file mode 100644 index b01a73ce335..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/anotherfakedummy/patch/responses/Code200Response.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.anotherfakedummy.patch.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.anotherfakedummy.patch.responses.code200response.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.Client1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/CommonparamsubdirDelete.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/CommonparamsubdirDelete.java new file mode 100644 index 00000000000..f4584e4a80a --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/CommonparamsubdirDelete.java @@ -0,0 +1,205 @@ +package org.openapijsonschematools.client.paths.commonparamsubdir; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.commonparamsubdir.delete.CommonparamsubdirDeleteHeaderParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.commonparamsubdir.delete.CommonparamsubdirDeletePathParameters; +import org.openapijsonschematools.client.paths.commonparamsubdir.delete.Parameters; +import org.openapijsonschematools.client.paths.commonparamsubdir.delete.CommonparamsubdirDeleteResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.paths.Commonparamsubdir; + +import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class CommonparamsubdirDelete { + private static class DeleteProvider { + private static final String method = "delete"; + + public static CommonparamsubdirDeleteResponses.EndpointResponse delete( + DeleteRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + + if (request.headerParameters != null) { + var headersSerializer = new Parameters.HeaderParametersSerializer(); + Map> serializedHeaders = headersSerializer.serialize(request.headerParameters); + headers.putAll(serializedHeaders); + } + + var pathSerializer = new Parameters.PathParametersSerializer(); + String updatedPath = pathSerializer.serialize(request.pathParameters, Commonparamsubdir.path); + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + updatedPath; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new CommonparamsubdirDeleteResponses.CommonparamsubdirDeleteResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface DeleteOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default CommonparamsubdirDeleteResponses.EndpointResponse delete(DeleteRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return DeleteProvider.delete(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface DeleteCommonParamOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default CommonparamsubdirDeleteResponses.EndpointResponse deleteCommonParam(DeleteRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return DeleteProvider.delete(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Delete extends ApiClient implements DeleteOperation { + public Delete(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class DeleteRequest { + public CommonparamsubdirDeletePathParameters.CommonparamsubdirDeletePathParametersMap pathParameters; + public CommonparamsubdirDeleteHeaderParameters.@Nullable CommonparamsubdirDeleteHeaderParametersMap headerParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + + public DeleteRequest( + CommonparamsubdirDeletePathParameters.CommonparamsubdirDeletePathParametersMap pathParameters, + CommonparamsubdirDeleteHeaderParameters.@Nullable CommonparamsubdirDeleteHeaderParametersMap headerParameters, + RootServerInfo.@Nullable ServerIndex serverIndex, + @Nullable Duration timeout + ) { + this.pathParameters = pathParameters; + this.headerParameters = headerParameters; + this.serverIndex = serverIndex; + this.timeout = timeout; + } + } + + public static class DeleteNullableRequest { + public CommonparamsubdirDeletePathParameters.@Nullable CommonparamsubdirDeletePathParametersMap pathParameters; + public CommonparamsubdirDeleteHeaderParameters.@Nullable CommonparamsubdirDeleteHeaderParametersMap headerParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForHeaderParameters { + DeleteNullableRequest getInstance(); + T getBuilderAfterHeaderParameters(DeleteNullableRequest instance); + default T headerParameters(CommonparamsubdirDeleteHeaderParameters.CommonparamsubdirDeleteHeaderParametersMap headerParameters) { + var instance = getInstance(); + instance.headerParameters = headerParameters; + return getBuilderAfterHeaderParameters(instance); + } + } + + public interface SetterForServerIndex { + DeleteNullableRequest getInstance(); + T getBuilderAfterServerIndex(DeleteNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + DeleteNullableRequest getInstance(); + T getBuilderAfterTimeout(DeleteNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForPathParameters { + DeleteNullableRequest getInstance(); + T getBuilderAfterPathParameters(DeleteNullableRequest instance); + default T pathParameters(CommonparamsubdirDeletePathParameters.CommonparamsubdirDeletePathParametersMap pathParameters) { + var instance = getInstance(); + instance.pathParameters = pathParameters; + return getBuilderAfterPathParameters(instance); + } + } + + public static class Delete0RequestBuilder implements SetterForHeaderParameters, SetterForServerIndex, SetterForTimeout { + private final DeleteNullableRequest instance; + + public Delete0RequestBuilder(DeleteNullableRequest instance) { + this.instance = instance; + } + + public DeleteRequest build() { + var pathParameters = instance.pathParameters; + if (pathParameters == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new DeleteRequest( + pathParameters, + instance.headerParameters, + instance.serverIndex, + instance.timeout + ); + } + + public DeleteNullableRequest getInstance() { + return instance; + } + + public Delete0RequestBuilder getBuilderAfterHeaderParameters(DeleteNullableRequest instance) { + return this; + } + + public Delete0RequestBuilder getBuilderAfterServerIndex(DeleteNullableRequest instance) { + return this; + } + + public Delete0RequestBuilder getBuilderAfterTimeout(DeleteNullableRequest instance) { + return this; + } + } + public static class DeleteRequestBuilder implements SetterForPathParameters { + private final DeleteNullableRequest instance; + + public DeleteRequestBuilder() { + this.instance = new DeleteNullableRequest(); + } + + public DeleteNullableRequest getInstance() { + return instance; + } + + public Delete0RequestBuilder getBuilderAfterPathParameters(DeleteNullableRequest instance) { + return new Delete0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/CommonparamsubdirGet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/CommonparamsubdirGet.java new file mode 100644 index 00000000000..4e9df51675f --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/CommonparamsubdirGet.java @@ -0,0 +1,206 @@ +package org.openapijsonschematools.client.paths.commonparamsubdir; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.commonparamsubdir.get.CommonparamsubdirGetQueryParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.commonparamsubdir.get.CommonparamsubdirGetPathParameters; +import org.openapijsonschematools.client.paths.commonparamsubdir.get.Parameters; +import org.openapijsonschematools.client.paths.commonparamsubdir.get.CommonparamsubdirGetResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.paths.Commonparamsubdir; + +import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class CommonparamsubdirGet { + private static class GetProvider { + private static final String method = "get"; + + public static CommonparamsubdirGetResponses.EndpointResponse get( + GetRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + + var pathSerializer = new Parameters.PathParametersSerializer(); + String updatedPath = pathSerializer.serialize(request.pathParameters, Commonparamsubdir.path); + + var querySerializer = new Parameters.QueryParametersSerializer(); + @Nullable Map queryMap = null; + if (request.queryParameters != null) { + queryMap = querySerializer.getQueryMap(request.queryParameters); + } + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + updatedPath; + if (queryMap != null) { + url = url + querySerializer.serialize(queryMap); + } + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new CommonparamsubdirGetResponses.CommonparamsubdirGetResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface GetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default CommonparamsubdirGetResponses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface GetCommonParamOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default CommonparamsubdirGetResponses.EndpointResponse getCommonParam(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Get extends ApiClient implements GetOperation { + public Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class GetRequest { + public CommonparamsubdirGetPathParameters.CommonparamsubdirGetPathParametersMap pathParameters; + public CommonparamsubdirGetQueryParameters.@Nullable CommonparamsubdirGetQueryParametersMap queryParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + + public GetRequest( + CommonparamsubdirGetPathParameters.CommonparamsubdirGetPathParametersMap pathParameters, + CommonparamsubdirGetQueryParameters.@Nullable CommonparamsubdirGetQueryParametersMap queryParameters, + RootServerInfo.@Nullable ServerIndex serverIndex, + @Nullable Duration timeout + ) { + this.pathParameters = pathParameters; + this.queryParameters = queryParameters; + this.serverIndex = serverIndex; + this.timeout = timeout; + } + } + + public static class GetNullableRequest { + public CommonparamsubdirGetPathParameters.@Nullable CommonparamsubdirGetPathParametersMap pathParameters; + public CommonparamsubdirGetQueryParameters.@Nullable CommonparamsubdirGetQueryParametersMap queryParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForQueryParameters { + GetNullableRequest getInstance(); + T getBuilderAfterQueryParameters(GetNullableRequest instance); + default T queryParameters(CommonparamsubdirGetQueryParameters.CommonparamsubdirGetQueryParametersMap queryParameters) { + var instance = getInstance(); + instance.queryParameters = queryParameters; + return getBuilderAfterQueryParameters(instance); + } + } + + public interface SetterForServerIndex { + GetNullableRequest getInstance(); + T getBuilderAfterServerIndex(GetNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + GetNullableRequest getInstance(); + T getBuilderAfterTimeout(GetNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForPathParameters { + GetNullableRequest getInstance(); + T getBuilderAfterPathParameters(GetNullableRequest instance); + default T pathParameters(CommonparamsubdirGetPathParameters.CommonparamsubdirGetPathParametersMap pathParameters) { + var instance = getInstance(); + instance.pathParameters = pathParameters; + return getBuilderAfterPathParameters(instance); + } + } + + public static class Get0RequestBuilder implements SetterForQueryParameters, SetterForServerIndex, SetterForTimeout { + private final GetNullableRequest instance; + + public Get0RequestBuilder(GetNullableRequest instance) { + this.instance = instance; + } + + public GetRequest build() { + var pathParameters = instance.pathParameters; + if (pathParameters == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new GetRequest( + pathParameters, + instance.queryParameters, + instance.serverIndex, + instance.timeout + ); + } + + public GetNullableRequest getInstance() { + return instance; + } + + public Get0RequestBuilder getBuilderAfterQueryParameters(GetNullableRequest instance) { + return this; + } + + public Get0RequestBuilder getBuilderAfterServerIndex(GetNullableRequest instance) { + return this; + } + + public Get0RequestBuilder getBuilderAfterTimeout(GetNullableRequest instance) { + return this; + } + } + public static class GetRequestBuilder implements SetterForPathParameters { + private final GetNullableRequest instance; + + public GetRequestBuilder() { + this.instance = new GetNullableRequest(); + } + + public GetNullableRequest getInstance() { + return instance; + } + + public Get0RequestBuilder getBuilderAfterPathParameters(GetNullableRequest instance) { + return new Get0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/CommonparamsubdirPost.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/CommonparamsubdirPost.java new file mode 100644 index 00000000000..c1f09488efb --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/CommonparamsubdirPost.java @@ -0,0 +1,205 @@ +package org.openapijsonschematools.client.paths.commonparamsubdir; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.commonparamsubdir.post.CommonparamsubdirPostHeaderParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.commonparamsubdir.post.CommonparamsubdirPostPathParameters; +import org.openapijsonschematools.client.paths.commonparamsubdir.post.Parameters; +import org.openapijsonschematools.client.paths.commonparamsubdir.post.CommonparamsubdirPostResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.paths.Commonparamsubdir; + +import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class CommonparamsubdirPost { + private static class PostProvider { + private static final String method = "post"; + + public static CommonparamsubdirPostResponses.EndpointResponse post( + PostRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + + if (request.headerParameters != null) { + var headersSerializer = new Parameters.HeaderParametersSerializer(); + Map> serializedHeaders = headersSerializer.serialize(request.headerParameters); + headers.putAll(serializedHeaders); + } + + var pathSerializer = new Parameters.PathParametersSerializer(); + String updatedPath = pathSerializer.serialize(request.pathParameters, Commonparamsubdir.path); + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + updatedPath; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new CommonparamsubdirPostResponses.CommonparamsubdirPostResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PostOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default CommonparamsubdirPostResponses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface PostCommonParamOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default CommonparamsubdirPostResponses.EndpointResponse postCommonParam(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Post extends ApiClient implements PostOperation { + public Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PostRequest { + public CommonparamsubdirPostPathParameters.CommonparamsubdirPostPathParametersMap pathParameters; + public CommonparamsubdirPostHeaderParameters.@Nullable CommonparamsubdirPostHeaderParametersMap headerParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + + public PostRequest( + CommonparamsubdirPostPathParameters.CommonparamsubdirPostPathParametersMap pathParameters, + CommonparamsubdirPostHeaderParameters.@Nullable CommonparamsubdirPostHeaderParametersMap headerParameters, + RootServerInfo.@Nullable ServerIndex serverIndex, + @Nullable Duration timeout + ) { + this.pathParameters = pathParameters; + this.headerParameters = headerParameters; + this.serverIndex = serverIndex; + this.timeout = timeout; + } + } + + public static class PostNullableRequest { + public CommonparamsubdirPostPathParameters.@Nullable CommonparamsubdirPostPathParametersMap pathParameters; + public CommonparamsubdirPostHeaderParameters.@Nullable CommonparamsubdirPostHeaderParametersMap headerParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForHeaderParameters { + PostNullableRequest getInstance(); + T getBuilderAfterHeaderParameters(PostNullableRequest instance); + default T headerParameters(CommonparamsubdirPostHeaderParameters.CommonparamsubdirPostHeaderParametersMap headerParameters) { + var instance = getInstance(); + instance.headerParameters = headerParameters; + return getBuilderAfterHeaderParameters(instance); + } + } + + public interface SetterForServerIndex { + PostNullableRequest getInstance(); + T getBuilderAfterServerIndex(PostNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PostNullableRequest getInstance(); + T getBuilderAfterTimeout(PostNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForPathParameters { + PostNullableRequest getInstance(); + T getBuilderAfterPathParameters(PostNullableRequest instance); + default T pathParameters(CommonparamsubdirPostPathParameters.CommonparamsubdirPostPathParametersMap pathParameters) { + var instance = getInstance(); + instance.pathParameters = pathParameters; + return getBuilderAfterPathParameters(instance); + } + } + + public static class Post0RequestBuilder implements SetterForHeaderParameters, SetterForServerIndex, SetterForTimeout { + private final PostNullableRequest instance; + + public Post0RequestBuilder(PostNullableRequest instance) { + this.instance = instance; + } + + public PostRequest build() { + var pathParameters = instance.pathParameters; + if (pathParameters == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new PostRequest( + pathParameters, + instance.headerParameters, + instance.serverIndex, + instance.timeout + ); + } + + public PostNullableRequest getInstance() { + return instance; + } + + public Post0RequestBuilder getBuilderAfterHeaderParameters(PostNullableRequest instance) { + return this; + } + + public Post0RequestBuilder getBuilderAfterServerIndex(PostNullableRequest instance) { + return this; + } + + public Post0RequestBuilder getBuilderAfterTimeout(PostNullableRequest instance) { + return this; + } + } + public static class PostRequestBuilder implements SetterForPathParameters { + private final PostNullableRequest instance; + + public PostRequestBuilder() { + this.instance = new PostNullableRequest(); + } + + public PostNullableRequest getInstance() { + return instance; + } + + public Post0RequestBuilder getBuilderAfterPathParameters(PostNullableRequest instance) { + return new Post0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/Delete.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/Delete.java deleted file mode 100644 index 475bc216c9f..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/Delete.java +++ /dev/null @@ -1,196 +0,0 @@ -package org.openapijsonschematools.client.paths.commonparamsubdir; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.commonparamsubdir.delete.HeaderParameters; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.commonparamsubdir.delete.PathParameters; -import org.openapijsonschematools.client.paths.commonparamsubdir.delete.Parameters; -import org.openapijsonschematools.client.paths.commonparamsubdir.delete.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.paths.Commonparamsubdir; - -import java.io.IOException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Delete { - private static class DeleteProvider { - private static final String method = "delete"; - - public static Responses.EndpointResponse delete( - DeleteRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - - if (request.headerParameters != null) { - var headersSerializer = new Parameters.HeaderParametersSerializer(); - Map> serializedHeaders = headersSerializer.serialize(request.headerParameters); - headers.putAll(serializedHeaders); - } - - var pathSerializer = new Parameters.PathParametersSerializer(); - String updatedPath = pathSerializer.serialize(request.pathParameters, Commonparamsubdir.path); - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + updatedPath; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface DeleteOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse delete(DeleteRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return DeleteProvider.delete(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Delete1 extends ApiClient implements DeleteOperation { - public Delete1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class DeleteRequest { - public PathParameters.PathParametersMap pathParameters; - public HeaderParameters.@Nullable HeaderParametersMap headerParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - - public DeleteRequest( - PathParameters.PathParametersMap pathParameters, - HeaderParameters.@Nullable HeaderParametersMap headerParameters, - RootServerInfo.@Nullable ServerIndex serverIndex, - @Nullable Duration timeout - ) { - this.pathParameters = pathParameters; - this.headerParameters = headerParameters; - this.serverIndex = serverIndex; - this.timeout = timeout; - } - } - - public static class DeleteNullableRequest { - public PathParameters.@Nullable PathParametersMap pathParameters; - public HeaderParameters.@Nullable HeaderParametersMap headerParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForHeaderParameters { - DeleteNullableRequest getInstance(); - T getBuilderAfterHeaderParameters(DeleteNullableRequest instance); - default T headerParameters(HeaderParameters.HeaderParametersMap headerParameters) { - var instance = getInstance(); - instance.headerParameters = headerParameters; - return getBuilderAfterHeaderParameters(instance); - } - } - - public interface SetterForServerIndex { - DeleteNullableRequest getInstance(); - T getBuilderAfterServerIndex(DeleteNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - DeleteNullableRequest getInstance(); - T getBuilderAfterTimeout(DeleteNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForPathParameters { - DeleteNullableRequest getInstance(); - T getBuilderAfterPathParameters(DeleteNullableRequest instance); - default T pathParameters(PathParameters.PathParametersMap pathParameters) { - var instance = getInstance(); - instance.pathParameters = pathParameters; - return getBuilderAfterPathParameters(instance); - } - } - - public static class Delete0RequestBuilder implements SetterForHeaderParameters, SetterForServerIndex, SetterForTimeout { - private final DeleteNullableRequest instance; - - public Delete0RequestBuilder(DeleteNullableRequest instance) { - this.instance = instance; - } - - public DeleteRequest build() { - var pathParameters = instance.pathParameters; - if (pathParameters == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new DeleteRequest( - pathParameters, - instance.headerParameters, - instance.serverIndex, - instance.timeout - ); - } - - public DeleteNullableRequest getInstance() { - return instance; - } - - public Delete0RequestBuilder getBuilderAfterHeaderParameters(DeleteNullableRequest instance) { - return this; - } - - public Delete0RequestBuilder getBuilderAfterServerIndex(DeleteNullableRequest instance) { - return this; - } - - public Delete0RequestBuilder getBuilderAfterTimeout(DeleteNullableRequest instance) { - return this; - } - } - public static class DeleteRequestBuilder implements SetterForPathParameters { - private final DeleteNullableRequest instance; - - public DeleteRequestBuilder() { - this.instance = new DeleteNullableRequest(); - } - - public DeleteNullableRequest getInstance() { - return instance; - } - - public Delete0RequestBuilder getBuilderAfterPathParameters(DeleteNullableRequest instance) { - return new Delete0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/Get.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/Get.java deleted file mode 100644 index 84e1e36efe5..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/Get.java +++ /dev/null @@ -1,197 +0,0 @@ -package org.openapijsonschematools.client.paths.commonparamsubdir; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.commonparamsubdir.get.QueryParameters; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.commonparamsubdir.get.PathParameters; -import org.openapijsonschematools.client.paths.commonparamsubdir.get.Parameters; -import org.openapijsonschematools.client.paths.commonparamsubdir.get.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.paths.Commonparamsubdir; - -import java.io.IOException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Get { - private static class GetProvider { - private static final String method = "get"; - - public static Responses.EndpointResponse get( - GetRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - - var pathSerializer = new Parameters.PathParametersSerializer(); - String updatedPath = pathSerializer.serialize(request.pathParameters, Commonparamsubdir.path); - - var querySerializer = new Parameters.QueryParametersSerializer(); - @Nullable Map queryMap = null; - if (request.queryParameters != null) { - queryMap = querySerializer.getQueryMap(request.queryParameters); - } - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + updatedPath; - if (queryMap != null) { - url = url + querySerializer.serialize(queryMap); - } - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface GetOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Get1 extends ApiClient implements GetOperation { - public Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class GetRequest { - public PathParameters.PathParametersMap pathParameters; - public QueryParameters.@Nullable QueryParametersMap queryParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - - public GetRequest( - PathParameters.PathParametersMap pathParameters, - QueryParameters.@Nullable QueryParametersMap queryParameters, - RootServerInfo.@Nullable ServerIndex serverIndex, - @Nullable Duration timeout - ) { - this.pathParameters = pathParameters; - this.queryParameters = queryParameters; - this.serverIndex = serverIndex; - this.timeout = timeout; - } - } - - public static class GetNullableRequest { - public PathParameters.@Nullable PathParametersMap pathParameters; - public QueryParameters.@Nullable QueryParametersMap queryParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForQueryParameters { - GetNullableRequest getInstance(); - T getBuilderAfterQueryParameters(GetNullableRequest instance); - default T queryParameters(QueryParameters.QueryParametersMap queryParameters) { - var instance = getInstance(); - instance.queryParameters = queryParameters; - return getBuilderAfterQueryParameters(instance); - } - } - - public interface SetterForServerIndex { - GetNullableRequest getInstance(); - T getBuilderAfterServerIndex(GetNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - GetNullableRequest getInstance(); - T getBuilderAfterTimeout(GetNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForPathParameters { - GetNullableRequest getInstance(); - T getBuilderAfterPathParameters(GetNullableRequest instance); - default T pathParameters(PathParameters.PathParametersMap pathParameters) { - var instance = getInstance(); - instance.pathParameters = pathParameters; - return getBuilderAfterPathParameters(instance); - } - } - - public static class Get0RequestBuilder implements SetterForQueryParameters, SetterForServerIndex, SetterForTimeout { - private final GetNullableRequest instance; - - public Get0RequestBuilder(GetNullableRequest instance) { - this.instance = instance; - } - - public GetRequest build() { - var pathParameters = instance.pathParameters; - if (pathParameters == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new GetRequest( - pathParameters, - instance.queryParameters, - instance.serverIndex, - instance.timeout - ); - } - - public GetNullableRequest getInstance() { - return instance; - } - - public Get0RequestBuilder getBuilderAfterQueryParameters(GetNullableRequest instance) { - return this; - } - - public Get0RequestBuilder getBuilderAfterServerIndex(GetNullableRequest instance) { - return this; - } - - public Get0RequestBuilder getBuilderAfterTimeout(GetNullableRequest instance) { - return this; - } - } - public static class GetRequestBuilder implements SetterForPathParameters { - private final GetNullableRequest instance; - - public GetRequestBuilder() { - this.instance = new GetNullableRequest(); - } - - public GetNullableRequest getInstance() { - return instance; - } - - public Get0RequestBuilder getBuilderAfterPathParameters(GetNullableRequest instance) { - return new Get0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/Post.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/Post.java deleted file mode 100644 index 113973108cf..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/Post.java +++ /dev/null @@ -1,196 +0,0 @@ -package org.openapijsonschematools.client.paths.commonparamsubdir; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.commonparamsubdir.post.HeaderParameters; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.commonparamsubdir.post.PathParameters; -import org.openapijsonschematools.client.paths.commonparamsubdir.post.Parameters; -import org.openapijsonschematools.client.paths.commonparamsubdir.post.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.paths.Commonparamsubdir; - -import java.io.IOException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Post { - private static class PostProvider { - private static final String method = "post"; - - public static Responses.EndpointResponse post( - PostRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - - if (request.headerParameters != null) { - var headersSerializer = new Parameters.HeaderParametersSerializer(); - Map> serializedHeaders = headersSerializer.serialize(request.headerParameters); - headers.putAll(serializedHeaders); - } - - var pathSerializer = new Parameters.PathParametersSerializer(); - String updatedPath = pathSerializer.serialize(request.pathParameters, Commonparamsubdir.path); - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + updatedPath; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PostOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Post1 extends ApiClient implements PostOperation { - public Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PostRequest { - public PathParameters.PathParametersMap pathParameters; - public HeaderParameters.@Nullable HeaderParametersMap headerParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - - public PostRequest( - PathParameters.PathParametersMap pathParameters, - HeaderParameters.@Nullable HeaderParametersMap headerParameters, - RootServerInfo.@Nullable ServerIndex serverIndex, - @Nullable Duration timeout - ) { - this.pathParameters = pathParameters; - this.headerParameters = headerParameters; - this.serverIndex = serverIndex; - this.timeout = timeout; - } - } - - public static class PostNullableRequest { - public PathParameters.@Nullable PathParametersMap pathParameters; - public HeaderParameters.@Nullable HeaderParametersMap headerParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForHeaderParameters { - PostNullableRequest getInstance(); - T getBuilderAfterHeaderParameters(PostNullableRequest instance); - default T headerParameters(HeaderParameters.HeaderParametersMap headerParameters) { - var instance = getInstance(); - instance.headerParameters = headerParameters; - return getBuilderAfterHeaderParameters(instance); - } - } - - public interface SetterForServerIndex { - PostNullableRequest getInstance(); - T getBuilderAfterServerIndex(PostNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PostNullableRequest getInstance(); - T getBuilderAfterTimeout(PostNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForPathParameters { - PostNullableRequest getInstance(); - T getBuilderAfterPathParameters(PostNullableRequest instance); - default T pathParameters(PathParameters.PathParametersMap pathParameters) { - var instance = getInstance(); - instance.pathParameters = pathParameters; - return getBuilderAfterPathParameters(instance); - } - } - - public static class Post0RequestBuilder implements SetterForHeaderParameters, SetterForServerIndex, SetterForTimeout { - private final PostNullableRequest instance; - - public Post0RequestBuilder(PostNullableRequest instance) { - this.instance = instance; - } - - public PostRequest build() { - var pathParameters = instance.pathParameters; - if (pathParameters == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new PostRequest( - pathParameters, - instance.headerParameters, - instance.serverIndex, - instance.timeout - ); - } - - public PostNullableRequest getInstance() { - return instance; - } - - public Post0RequestBuilder getBuilderAfterHeaderParameters(PostNullableRequest instance) { - return this; - } - - public Post0RequestBuilder getBuilderAfterServerIndex(PostNullableRequest instance) { - return this; - } - - public Post0RequestBuilder getBuilderAfterTimeout(PostNullableRequest instance) { - return this; - } - } - public static class PostRequestBuilder implements SetterForPathParameters { - private final PostNullableRequest instance; - - public PostRequestBuilder() { - this.instance = new PostNullableRequest(); - } - - public PostNullableRequest getInstance() { - return instance; - } - - public Post0RequestBuilder getBuilderAfterPathParameters(PostNullableRequest instance) { - return new Post0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/CommonparamsubdirDeleteHeaderParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/CommonparamsubdirDeleteHeaderParameters.java new file mode 100644 index 00000000000..2d2a4ce8dbd --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/CommonparamsubdirDeleteHeaderParameters.java @@ -0,0 +1,191 @@ +package org.openapijsonschematools.client.paths.commonparamsubdir.delete; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.commonparamsubdir.delete.parameters.parameter0.Schema0; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class CommonparamsubdirDeleteHeaderParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class CommonparamsubdirDeleteadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable CommonparamsubdirDeleteadditionalProperties instance = null; + public static CommonparamsubdirDeleteadditionalProperties getInstance() { + if (instance == null) { + instance = new CommonparamsubdirDeleteadditionalProperties(); + } + return instance; + } + } + + + public static class CommonparamsubdirDeleteHeaderParametersMap extends FrozenMap { + protected CommonparamsubdirDeleteHeaderParametersMap(FrozenMap m) { + super(m); + } + public static final Set requiredKeys = Set.of(); + public static final Set optionalKeys = Set.of( + "someHeader" + ); + public static CommonparamsubdirDeleteHeaderParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return CommonparamsubdirDeleteHeaderParameters1.getInstance().validate(arg, configuration); + } + + public String someHeader() throws UnsetPropertyException { + return getOrThrow("someHeader"); + } + } + + public interface SetterForCommonparamsubdirDeletesomeHeader { + Map getInstance(); + T getBuilderAfterCommonparamsubdirDeletesomeHeader(Map instance); + + default T someHeader(String value) { + var instance = getInstance(); + instance.put("someHeader", value); + return getBuilderAfterCommonparamsubdirDeletesomeHeader(instance); + } + } + + public static class CommonparamsubdirDeleteHeaderParametersMapBuilder implements GenericBuilder>, SetterForCommonparamsubdirDeletesomeHeader { + private final Map instance; + private static final Set knownKeys = Set.of( + "someHeader" + ); + public Set getKnownKeys() { + return knownKeys; + } + public CommonparamsubdirDeleteHeaderParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map build() { + return instance; + } + public Map getInstance() { + return instance; + } + public CommonparamsubdirDeleteHeaderParametersMapBuilder getBuilderAfterCommonparamsubdirDeletesomeHeader(Map instance) { + return this; + } + } + + + public sealed interface CommonparamsubdirDeleteHeaderParameters1Boxed permits CommonparamsubdirDeleteHeaderParameters1BoxedMap { + @Nullable Object getData(); + } + + public record CommonparamsubdirDeleteHeaderParameters1BoxedMap(CommonparamsubdirDeleteHeaderParametersMap data) implements CommonparamsubdirDeleteHeaderParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class CommonparamsubdirDeleteHeaderParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable CommonparamsubdirDeleteHeaderParameters1 instance = null; + + protected CommonparamsubdirDeleteHeaderParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("someHeader", Schema0.Schema01.class) + )) + .additionalProperties(CommonparamsubdirDeleteadditionalProperties.class) + ); + } + + public static CommonparamsubdirDeleteHeaderParameters1 getInstance() { + if (instance == null) { + instance = new CommonparamsubdirDeleteHeaderParameters1(); + } + return instance; + } + + public CommonparamsubdirDeleteHeaderParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof String)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (String) propertyInstance); + } + FrozenMap castProperties = new FrozenMap<>(properties); + return new CommonparamsubdirDeleteHeaderParametersMap(castProperties); + } + + public CommonparamsubdirDeleteHeaderParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public CommonparamsubdirDeleteHeaderParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new CommonparamsubdirDeleteHeaderParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public CommonparamsubdirDeleteHeaderParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/CommonparamsubdirDeletePathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/CommonparamsubdirDeletePathParameters.java new file mode 100644 index 00000000000..69980626b94 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/CommonparamsubdirDeletePathParameters.java @@ -0,0 +1,211 @@ +package org.openapijsonschematools.client.paths.commonparamsubdir.delete; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.commonparamsubdir.delete.parameters.parameter1.Schema1; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class CommonparamsubdirDeletePathParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class CommonparamsubdirDeleteadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable CommonparamsubdirDeleteadditionalProperties instance = null; + public static CommonparamsubdirDeleteadditionalProperties getInstance() { + if (instance == null) { + instance = new CommonparamsubdirDeleteadditionalProperties(); + } + return instance; + } + } + + + public static class CommonparamsubdirDeletePathParametersMap extends FrozenMap { + protected CommonparamsubdirDeletePathParametersMap(FrozenMap m) { + super(m); + } + public static final Set requiredKeys = Set.of( + "subDir" + ); + public static final Set optionalKeys = Set.of(); + public static CommonparamsubdirDeletePathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return CommonparamsubdirDeletePathParameters1.getInstance().validate(arg, configuration); + } + + public String subDir() { + try { + return getOrThrow("version"); + } catch (UnsetPropertyException e) { + throw new RuntimeException(e); + } + } + } + + public interface SetterForCommonparamsubdirDeletesubDir { + Map getInstance(); + T getBuilderAfterCommonparamsubdirDeletesubDir(Map instance); + + default T subDir(String value) { + var instance = getInstance(); + instance.put("subDir", value); + return getBuilderAfterCommonparamsubdirDeletesubDir(instance); + } + + default T subDir(Schema1.StringSchemaEnums1 value) { + var instance = getInstance(); + instance.put("subDir", value.value()); + return getBuilderAfterCommonparamsubdirDeletesubDir(instance); + } + } + + public static class CommonparamsubdirDeletePathParametersMap0Builder implements GenericBuilder> { + private final Map instance; + private static final Set knownKeys = Set.of( + "subDir" + ); + public Set getKnownKeys() { + return knownKeys; + } + public CommonparamsubdirDeletePathParametersMap0Builder(Map instance) { + this.instance = instance; + } + public Map build() { + return instance; + } + } + + public static class CommonparamsubdirDeletePathParametersMapBuilder implements SetterForCommonparamsubdirDeletesubDir { + private final Map instance; + public CommonparamsubdirDeletePathParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map getInstance() { + return instance; + } + public CommonparamsubdirDeletePathParametersMap0Builder getBuilderAfterCommonparamsubdirDeletesubDir(Map instance) { + return new CommonparamsubdirDeletePathParametersMap0Builder(instance); + } + } + + + public sealed interface CommonparamsubdirDeletePathParameters1Boxed permits CommonparamsubdirDeletePathParameters1BoxedMap { + @Nullable Object getData(); + } + + public record CommonparamsubdirDeletePathParameters1BoxedMap(CommonparamsubdirDeletePathParametersMap data) implements CommonparamsubdirDeletePathParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class CommonparamsubdirDeletePathParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable CommonparamsubdirDeletePathParameters1 instance = null; + + protected CommonparamsubdirDeletePathParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("subDir", Schema1.Schema11.class) + )) + .required(Set.of( + "subDir" + )) + .additionalProperties(CommonparamsubdirDeleteadditionalProperties.class) + ); + } + + public static CommonparamsubdirDeletePathParameters1 getInstance() { + if (instance == null) { + instance = new CommonparamsubdirDeletePathParameters1(); + } + return instance; + } + + public CommonparamsubdirDeletePathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof String)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (String) propertyInstance); + } + FrozenMap castProperties = new FrozenMap<>(properties); + return new CommonparamsubdirDeletePathParametersMap(castProperties); + } + + public CommonparamsubdirDeletePathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public CommonparamsubdirDeletePathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new CommonparamsubdirDeletePathParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public CommonparamsubdirDeletePathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/CommonparamsubdirDeleteResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/CommonparamsubdirDeleteResponses.java new file mode 100644 index 00000000000..f5f9155ead2 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/CommonparamsubdirDeleteResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.commonparamsubdir.delete; + +import org.openapijsonschematools.client.paths.commonparamsubdir.delete.responses.CommonparamsubdirDeleteCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class CommonparamsubdirDeleteResponses { + public sealed interface EndpointResponse permits EndpointCommonparamsubdirDeleteCode200Response {} + + public record EndpointCommonparamsubdirDeleteCode200Response( + HttpResponse response, + Void body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusCommonparamsubdirDeleteCode200ResponseDeserializer {} + + public static final class StatusCommonparamsubdirDeleteCode200ResponseDeserializer extends CommonparamsubdirDeleteCode200Response.CommonparamsubdirDeleteCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class CommonparamsubdirDeleteResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public CommonparamsubdirDeleteResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusCommonparamsubdirDeleteCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusCommonparamsubdirDeleteCode200ResponseDeserializer castDeserializer = (StatusCommonparamsubdirDeleteCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointCommonparamsubdirDeleteCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/HeaderParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/HeaderParameters.java deleted file mode 100644 index 42d92915420..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/HeaderParameters.java +++ /dev/null @@ -1,191 +0,0 @@ -package org.openapijsonschematools.client.paths.commonparamsubdir.delete; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.commonparamsubdir.delete.parameters.parameter0.Schema0; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class HeaderParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class HeaderParametersMap extends FrozenMap { - protected HeaderParametersMap(FrozenMap m) { - super(m); - } - public static final Set requiredKeys = Set.of(); - public static final Set optionalKeys = Set.of( - "someHeader" - ); - public static HeaderParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return HeaderParameters1.getInstance().validate(arg, configuration); - } - - public String someHeader() throws UnsetPropertyException { - return getOrThrow("someHeader"); - } - } - - public interface SetterForSomeHeader { - Map getInstance(); - T getBuilderAfterSomeHeader(Map instance); - - default T someHeader(String value) { - var instance = getInstance(); - instance.put("someHeader", value); - return getBuilderAfterSomeHeader(instance); - } - } - - public static class HeaderParametersMapBuilder implements GenericBuilder>, SetterForSomeHeader { - private final Map instance; - private static final Set knownKeys = Set.of( - "someHeader" - ); - public Set getKnownKeys() { - return knownKeys; - } - public HeaderParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map build() { - return instance; - } - public Map getInstance() { - return instance; - } - public HeaderParametersMapBuilder getBuilderAfterSomeHeader(Map instance) { - return this; - } - } - - - public sealed interface HeaderParameters1Boxed permits HeaderParameters1BoxedMap { - @Nullable Object getData(); - } - - public record HeaderParameters1BoxedMap(HeaderParametersMap data) implements HeaderParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class HeaderParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable HeaderParameters1 instance = null; - - protected HeaderParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("someHeader", Schema0.Schema01.class) - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static HeaderParameters1 getInstance() { - if (instance == null) { - instance = new HeaderParameters1(); - } - return instance; - } - - public HeaderParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - if (!(propertyInstance instanceof String)) { - throw new RuntimeException("Invalid instantiated value"); - } - properties.put(propertyName, (String) propertyInstance); - } - FrozenMap castProperties = new FrozenMap<>(properties); - return new HeaderParametersMap(castProperties); - } - - public HeaderParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public HeaderParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new HeaderParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public HeaderParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/PathParameters.java deleted file mode 100644 index 7424543e6c2..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/PathParameters.java +++ /dev/null @@ -1,211 +0,0 @@ -package org.openapijsonschematools.client.paths.commonparamsubdir.delete; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.commonparamsubdir.delete.parameters.parameter1.Schema1; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class PathParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class PathParametersMap extends FrozenMap { - protected PathParametersMap(FrozenMap m) { - super(m); - } - public static final Set requiredKeys = Set.of( - "subDir" - ); - public static final Set optionalKeys = Set.of(); - public static PathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return PathParameters1.getInstance().validate(arg, configuration); - } - - public String subDir() { - try { - return getOrThrow("version"); - } catch (UnsetPropertyException e) { - throw new RuntimeException(e); - } - } - } - - public interface SetterForSubDir { - Map getInstance(); - T getBuilderAfterSubDir(Map instance); - - default T subDir(String value) { - var instance = getInstance(); - instance.put("subDir", value); - return getBuilderAfterSubDir(instance); - } - - default T subDir(Schema1.StringSchemaEnums1 value) { - var instance = getInstance(); - instance.put("subDir", value.value()); - return getBuilderAfterSubDir(instance); - } - } - - public static class PathParametersMap0Builder implements GenericBuilder> { - private final Map instance; - private static final Set knownKeys = Set.of( - "subDir" - ); - public Set getKnownKeys() { - return knownKeys; - } - public PathParametersMap0Builder(Map instance) { - this.instance = instance; - } - public Map build() { - return instance; - } - } - - public static class PathParametersMapBuilder implements SetterForSubDir { - private final Map instance; - public PathParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map getInstance() { - return instance; - } - public PathParametersMap0Builder getBuilderAfterSubDir(Map instance) { - return new PathParametersMap0Builder(instance); - } - } - - - public sealed interface PathParameters1Boxed permits PathParameters1BoxedMap { - @Nullable Object getData(); - } - - public record PathParameters1BoxedMap(PathParametersMap data) implements PathParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable PathParameters1 instance = null; - - protected PathParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("subDir", Schema1.Schema11.class) - )) - .required(Set.of( - "subDir" - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static PathParameters1 getInstance() { - if (instance == null) { - instance = new PathParameters1(); - } - return instance; - } - - public PathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - if (!(propertyInstance instanceof String)) { - throw new RuntimeException("Invalid instantiated value"); - } - properties.put(propertyName, (String) propertyInstance); - } - FrozenMap castProperties = new FrozenMap<>(properties); - return new PathParametersMap(castProperties); - } - - public PathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new PathParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/Responses.java deleted file mode 100644 index 3a0905419c6..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.commonparamsubdir.delete; - -import org.openapijsonschematools.client.paths.commonparamsubdir.delete.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/responses/Code200Response.java deleted file mode 100644 index d91fc8bb9f7..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/responses/Code200Response.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.openapijsonschematools.client.paths.commonparamsubdir.delete.responses; - -import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; - -public class Code200Response extends SuccessDescriptionOnly { - public static class Code200Response1 extends SuccessDescriptionOnly1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/responses/CommonparamsubdirDeleteCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/responses/CommonparamsubdirDeleteCode200Response.java new file mode 100644 index 00000000000..ed6bcceb216 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/delete/responses/CommonparamsubdirDeleteCode200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.commonparamsubdir.delete.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class CommonparamsubdirDeleteCode200Response extends SuccessDescriptionOnly { + public static class CommonparamsubdirDeleteCode200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/CommonparamsubdirGetPathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/CommonparamsubdirGetPathParameters.java new file mode 100644 index 00000000000..cffa50b94f4 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/CommonparamsubdirGetPathParameters.java @@ -0,0 +1,211 @@ +package org.openapijsonschematools.client.paths.commonparamsubdir.get; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.commonparamsubdir.parameters.routeparameter0.RouteParamSchema0; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class CommonparamsubdirGetPathParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class CommonparamsubdirGetadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable CommonparamsubdirGetadditionalProperties instance = null; + public static CommonparamsubdirGetadditionalProperties getInstance() { + if (instance == null) { + instance = new CommonparamsubdirGetadditionalProperties(); + } + return instance; + } + } + + + public static class CommonparamsubdirGetPathParametersMap extends FrozenMap { + protected CommonparamsubdirGetPathParametersMap(FrozenMap m) { + super(m); + } + public static final Set requiredKeys = Set.of( + "subDir" + ); + public static final Set optionalKeys = Set.of(); + public static CommonparamsubdirGetPathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return CommonparamsubdirGetPathParameters1.getInstance().validate(arg, configuration); + } + + public String subDir() { + try { + return getOrThrow("version"); + } catch (UnsetPropertyException e) { + throw new RuntimeException(e); + } + } + } + + public interface SetterForCommonparamsubdirGetsubDir { + Map getInstance(); + T getBuilderAfterCommonparamsubdirGetsubDir(Map instance); + + default T subDir(String value) { + var instance = getInstance(); + instance.put("subDir", value); + return getBuilderAfterCommonparamsubdirGetsubDir(instance); + } + + default T subDir(RouteParamSchema0.StringRouteParamSchemaEnums0 value) { + var instance = getInstance(); + instance.put("subDir", value.value()); + return getBuilderAfterCommonparamsubdirGetsubDir(instance); + } + } + + public static class CommonparamsubdirGetPathParametersMap0Builder implements GenericBuilder> { + private final Map instance; + private static final Set knownKeys = Set.of( + "subDir" + ); + public Set getKnownKeys() { + return knownKeys; + } + public CommonparamsubdirGetPathParametersMap0Builder(Map instance) { + this.instance = instance; + } + public Map build() { + return instance; + } + } + + public static class CommonparamsubdirGetPathParametersMapBuilder implements SetterForCommonparamsubdirGetsubDir { + private final Map instance; + public CommonparamsubdirGetPathParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map getInstance() { + return instance; + } + public CommonparamsubdirGetPathParametersMap0Builder getBuilderAfterCommonparamsubdirGetsubDir(Map instance) { + return new CommonparamsubdirGetPathParametersMap0Builder(instance); + } + } + + + public sealed interface CommonparamsubdirGetPathParameters1Boxed permits CommonparamsubdirGetPathParameters1BoxedMap { + @Nullable Object getData(); + } + + public record CommonparamsubdirGetPathParameters1BoxedMap(CommonparamsubdirGetPathParametersMap data) implements CommonparamsubdirGetPathParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class CommonparamsubdirGetPathParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable CommonparamsubdirGetPathParameters1 instance = null; + + protected CommonparamsubdirGetPathParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("subDir", RouteParamSchema0.RouteParamSchema01.class) + )) + .required(Set.of( + "subDir" + )) + .additionalProperties(CommonparamsubdirGetadditionalProperties.class) + ); + } + + public static CommonparamsubdirGetPathParameters1 getInstance() { + if (instance == null) { + instance = new CommonparamsubdirGetPathParameters1(); + } + return instance; + } + + public CommonparamsubdirGetPathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof String)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (String) propertyInstance); + } + FrozenMap castProperties = new FrozenMap<>(properties); + return new CommonparamsubdirGetPathParametersMap(castProperties); + } + + public CommonparamsubdirGetPathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public CommonparamsubdirGetPathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new CommonparamsubdirGetPathParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public CommonparamsubdirGetPathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/CommonparamsubdirGetQueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/CommonparamsubdirGetQueryParameters.java new file mode 100644 index 00000000000..0bcf340194d --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/CommonparamsubdirGetQueryParameters.java @@ -0,0 +1,191 @@ +package org.openapijsonschematools.client.paths.commonparamsubdir.get; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.commonparamsubdir.get.parameters.parameter0.Schema0; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class CommonparamsubdirGetQueryParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class CommonparamsubdirGetadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable CommonparamsubdirGetadditionalProperties instance = null; + public static CommonparamsubdirGetadditionalProperties getInstance() { + if (instance == null) { + instance = new CommonparamsubdirGetadditionalProperties(); + } + return instance; + } + } + + + public static class CommonparamsubdirGetQueryParametersMap extends FrozenMap { + protected CommonparamsubdirGetQueryParametersMap(FrozenMap m) { + super(m); + } + public static final Set requiredKeys = Set.of(); + public static final Set optionalKeys = Set.of( + "searchStr" + ); + public static CommonparamsubdirGetQueryParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return CommonparamsubdirGetQueryParameters1.getInstance().validate(arg, configuration); + } + + public String searchStr() throws UnsetPropertyException { + return getOrThrow("searchStr"); + } + } + + public interface SetterForCommonparamsubdirGetsearchStr { + Map getInstance(); + T getBuilderAfterCommonparamsubdirGetsearchStr(Map instance); + + default T searchStr(String value) { + var instance = getInstance(); + instance.put("searchStr", value); + return getBuilderAfterCommonparamsubdirGetsearchStr(instance); + } + } + + public static class CommonparamsubdirGetQueryParametersMapBuilder implements GenericBuilder>, SetterForCommonparamsubdirGetsearchStr { + private final Map instance; + private static final Set knownKeys = Set.of( + "searchStr" + ); + public Set getKnownKeys() { + return knownKeys; + } + public CommonparamsubdirGetQueryParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map build() { + return instance; + } + public Map getInstance() { + return instance; + } + public CommonparamsubdirGetQueryParametersMapBuilder getBuilderAfterCommonparamsubdirGetsearchStr(Map instance) { + return this; + } + } + + + public sealed interface CommonparamsubdirGetQueryParameters1Boxed permits CommonparamsubdirGetQueryParameters1BoxedMap { + @Nullable Object getData(); + } + + public record CommonparamsubdirGetQueryParameters1BoxedMap(CommonparamsubdirGetQueryParametersMap data) implements CommonparamsubdirGetQueryParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class CommonparamsubdirGetQueryParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable CommonparamsubdirGetQueryParameters1 instance = null; + + protected CommonparamsubdirGetQueryParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("searchStr", Schema0.Schema01.class) + )) + .additionalProperties(CommonparamsubdirGetadditionalProperties.class) + ); + } + + public static CommonparamsubdirGetQueryParameters1 getInstance() { + if (instance == null) { + instance = new CommonparamsubdirGetQueryParameters1(); + } + return instance; + } + + public CommonparamsubdirGetQueryParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof String)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (String) propertyInstance); + } + FrozenMap castProperties = new FrozenMap<>(properties); + return new CommonparamsubdirGetQueryParametersMap(castProperties); + } + + public CommonparamsubdirGetQueryParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public CommonparamsubdirGetQueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new CommonparamsubdirGetQueryParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public CommonparamsubdirGetQueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/CommonparamsubdirGetResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/CommonparamsubdirGetResponses.java new file mode 100644 index 00000000000..ec3fa0f14d3 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/CommonparamsubdirGetResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.commonparamsubdir.get; + +import org.openapijsonschematools.client.paths.commonparamsubdir.get.responses.CommonparamsubdirGetCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class CommonparamsubdirGetResponses { + public sealed interface EndpointResponse permits EndpointCommonparamsubdirGetCode200Response {} + + public record EndpointCommonparamsubdirGetCode200Response( + HttpResponse response, + Void body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusCommonparamsubdirGetCode200ResponseDeserializer {} + + public static final class StatusCommonparamsubdirGetCode200ResponseDeserializer extends CommonparamsubdirGetCode200Response.CommonparamsubdirGetCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class CommonparamsubdirGetResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public CommonparamsubdirGetResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusCommonparamsubdirGetCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusCommonparamsubdirGetCode200ResponseDeserializer castDeserializer = (StatusCommonparamsubdirGetCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointCommonparamsubdirGetCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/PathParameters.java deleted file mode 100644 index 905f41a23ef..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/PathParameters.java +++ /dev/null @@ -1,211 +0,0 @@ -package org.openapijsonschematools.client.paths.commonparamsubdir.get; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.commonparamsubdir.parameters.routeparameter0.RouteParamSchema0; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class PathParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class PathParametersMap extends FrozenMap { - protected PathParametersMap(FrozenMap m) { - super(m); - } - public static final Set requiredKeys = Set.of( - "subDir" - ); - public static final Set optionalKeys = Set.of(); - public static PathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return PathParameters1.getInstance().validate(arg, configuration); - } - - public String subDir() { - try { - return getOrThrow("version"); - } catch (UnsetPropertyException e) { - throw new RuntimeException(e); - } - } - } - - public interface SetterForSubDir { - Map getInstance(); - T getBuilderAfterSubDir(Map instance); - - default T subDir(String value) { - var instance = getInstance(); - instance.put("subDir", value); - return getBuilderAfterSubDir(instance); - } - - default T subDir(RouteParamSchema0.StringRouteParamSchemaEnums0 value) { - var instance = getInstance(); - instance.put("subDir", value.value()); - return getBuilderAfterSubDir(instance); - } - } - - public static class PathParametersMap0Builder implements GenericBuilder> { - private final Map instance; - private static final Set knownKeys = Set.of( - "subDir" - ); - public Set getKnownKeys() { - return knownKeys; - } - public PathParametersMap0Builder(Map instance) { - this.instance = instance; - } - public Map build() { - return instance; - } - } - - public static class PathParametersMapBuilder implements SetterForSubDir { - private final Map instance; - public PathParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map getInstance() { - return instance; - } - public PathParametersMap0Builder getBuilderAfterSubDir(Map instance) { - return new PathParametersMap0Builder(instance); - } - } - - - public sealed interface PathParameters1Boxed permits PathParameters1BoxedMap { - @Nullable Object getData(); - } - - public record PathParameters1BoxedMap(PathParametersMap data) implements PathParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable PathParameters1 instance = null; - - protected PathParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("subDir", RouteParamSchema0.RouteParamSchema01.class) - )) - .required(Set.of( - "subDir" - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static PathParameters1 getInstance() { - if (instance == null) { - instance = new PathParameters1(); - } - return instance; - } - - public PathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - if (!(propertyInstance instanceof String)) { - throw new RuntimeException("Invalid instantiated value"); - } - properties.put(propertyName, (String) propertyInstance); - } - FrozenMap castProperties = new FrozenMap<>(properties); - return new PathParametersMap(castProperties); - } - - public PathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new PathParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/QueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/QueryParameters.java deleted file mode 100644 index 0fc34a2dfd4..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/QueryParameters.java +++ /dev/null @@ -1,191 +0,0 @@ -package org.openapijsonschematools.client.paths.commonparamsubdir.get; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.commonparamsubdir.get.parameters.parameter0.Schema0; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class QueryParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class QueryParametersMap extends FrozenMap { - protected QueryParametersMap(FrozenMap m) { - super(m); - } - public static final Set requiredKeys = Set.of(); - public static final Set optionalKeys = Set.of( - "searchStr" - ); - public static QueryParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return QueryParameters1.getInstance().validate(arg, configuration); - } - - public String searchStr() throws UnsetPropertyException { - return getOrThrow("searchStr"); - } - } - - public interface SetterForSearchStr { - Map getInstance(); - T getBuilderAfterSearchStr(Map instance); - - default T searchStr(String value) { - var instance = getInstance(); - instance.put("searchStr", value); - return getBuilderAfterSearchStr(instance); - } - } - - public static class QueryParametersMapBuilder implements GenericBuilder>, SetterForSearchStr { - private final Map instance; - private static final Set knownKeys = Set.of( - "searchStr" - ); - public Set getKnownKeys() { - return knownKeys; - } - public QueryParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map build() { - return instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMapBuilder getBuilderAfterSearchStr(Map instance) { - return this; - } - } - - - public sealed interface QueryParameters1Boxed permits QueryParameters1BoxedMap { - @Nullable Object getData(); - } - - public record QueryParameters1BoxedMap(QueryParametersMap data) implements QueryParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable QueryParameters1 instance = null; - - protected QueryParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("searchStr", Schema0.Schema01.class) - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static QueryParameters1 getInstance() { - if (instance == null) { - instance = new QueryParameters1(); - } - return instance; - } - - public QueryParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - if (!(propertyInstance instanceof String)) { - throw new RuntimeException("Invalid instantiated value"); - } - properties.put(propertyName, (String) propertyInstance); - } - FrozenMap castProperties = new FrozenMap<>(properties); - return new QueryParametersMap(castProperties); - } - - public QueryParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public QueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new QueryParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public QueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/Responses.java deleted file mode 100644 index a491608f72f..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.commonparamsubdir.get; - -import org.openapijsonschematools.client.paths.commonparamsubdir.get.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/responses/Code200Response.java deleted file mode 100644 index 92947e99863..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/responses/Code200Response.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.openapijsonschematools.client.paths.commonparamsubdir.get.responses; - -import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; - -public class Code200Response extends SuccessDescriptionOnly { - public static class Code200Response1 extends SuccessDescriptionOnly1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/responses/CommonparamsubdirGetCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/responses/CommonparamsubdirGetCode200Response.java new file mode 100644 index 00000000000..87e8201489f --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/get/responses/CommonparamsubdirGetCode200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.commonparamsubdir.get.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class CommonparamsubdirGetCode200Response extends SuccessDescriptionOnly { + public static class CommonparamsubdirGetCode200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/CommonparamsubdirPostHeaderParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/CommonparamsubdirPostHeaderParameters.java new file mode 100644 index 00000000000..96b42d5dccc --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/CommonparamsubdirPostHeaderParameters.java @@ -0,0 +1,191 @@ +package org.openapijsonschematools.client.paths.commonparamsubdir.post; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.commonparamsubdir.post.parameters.parameter0.Schema0; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class CommonparamsubdirPostHeaderParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class CommonparamsubdirPostadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable CommonparamsubdirPostadditionalProperties instance = null; + public static CommonparamsubdirPostadditionalProperties getInstance() { + if (instance == null) { + instance = new CommonparamsubdirPostadditionalProperties(); + } + return instance; + } + } + + + public static class CommonparamsubdirPostHeaderParametersMap extends FrozenMap { + protected CommonparamsubdirPostHeaderParametersMap(FrozenMap m) { + super(m); + } + public static final Set requiredKeys = Set.of(); + public static final Set optionalKeys = Set.of( + "someHeader" + ); + public static CommonparamsubdirPostHeaderParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return CommonparamsubdirPostHeaderParameters1.getInstance().validate(arg, configuration); + } + + public String someHeader() throws UnsetPropertyException { + return getOrThrow("someHeader"); + } + } + + public interface SetterForCommonparamsubdirPostsomeHeader { + Map getInstance(); + T getBuilderAfterCommonparamsubdirPostsomeHeader(Map instance); + + default T someHeader(String value) { + var instance = getInstance(); + instance.put("someHeader", value); + return getBuilderAfterCommonparamsubdirPostsomeHeader(instance); + } + } + + public static class CommonparamsubdirPostHeaderParametersMapBuilder implements GenericBuilder>, SetterForCommonparamsubdirPostsomeHeader { + private final Map instance; + private static final Set knownKeys = Set.of( + "someHeader" + ); + public Set getKnownKeys() { + return knownKeys; + } + public CommonparamsubdirPostHeaderParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map build() { + return instance; + } + public Map getInstance() { + return instance; + } + public CommonparamsubdirPostHeaderParametersMapBuilder getBuilderAfterCommonparamsubdirPostsomeHeader(Map instance) { + return this; + } + } + + + public sealed interface CommonparamsubdirPostHeaderParameters1Boxed permits CommonparamsubdirPostHeaderParameters1BoxedMap { + @Nullable Object getData(); + } + + public record CommonparamsubdirPostHeaderParameters1BoxedMap(CommonparamsubdirPostHeaderParametersMap data) implements CommonparamsubdirPostHeaderParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class CommonparamsubdirPostHeaderParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable CommonparamsubdirPostHeaderParameters1 instance = null; + + protected CommonparamsubdirPostHeaderParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("someHeader", Schema0.Schema01.class) + )) + .additionalProperties(CommonparamsubdirPostadditionalProperties.class) + ); + } + + public static CommonparamsubdirPostHeaderParameters1 getInstance() { + if (instance == null) { + instance = new CommonparamsubdirPostHeaderParameters1(); + } + return instance; + } + + public CommonparamsubdirPostHeaderParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof String)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (String) propertyInstance); + } + FrozenMap castProperties = new FrozenMap<>(properties); + return new CommonparamsubdirPostHeaderParametersMap(castProperties); + } + + public CommonparamsubdirPostHeaderParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public CommonparamsubdirPostHeaderParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new CommonparamsubdirPostHeaderParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public CommonparamsubdirPostHeaderParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/CommonparamsubdirPostPathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/CommonparamsubdirPostPathParameters.java new file mode 100644 index 00000000000..d3f0a6c1d9f --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/CommonparamsubdirPostPathParameters.java @@ -0,0 +1,211 @@ +package org.openapijsonschematools.client.paths.commonparamsubdir.post; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.commonparamsubdir.parameters.routeparameter0.RouteParamSchema0; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class CommonparamsubdirPostPathParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class CommonparamsubdirPostadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable CommonparamsubdirPostadditionalProperties instance = null; + public static CommonparamsubdirPostadditionalProperties getInstance() { + if (instance == null) { + instance = new CommonparamsubdirPostadditionalProperties(); + } + return instance; + } + } + + + public static class CommonparamsubdirPostPathParametersMap extends FrozenMap { + protected CommonparamsubdirPostPathParametersMap(FrozenMap m) { + super(m); + } + public static final Set requiredKeys = Set.of( + "subDir" + ); + public static final Set optionalKeys = Set.of(); + public static CommonparamsubdirPostPathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return CommonparamsubdirPostPathParameters1.getInstance().validate(arg, configuration); + } + + public String subDir() { + try { + return getOrThrow("version"); + } catch (UnsetPropertyException e) { + throw new RuntimeException(e); + } + } + } + + public interface SetterForCommonparamsubdirPostsubDir { + Map getInstance(); + T getBuilderAfterCommonparamsubdirPostsubDir(Map instance); + + default T subDir(String value) { + var instance = getInstance(); + instance.put("subDir", value); + return getBuilderAfterCommonparamsubdirPostsubDir(instance); + } + + default T subDir(RouteParamSchema0.StringRouteParamSchemaEnums0 value) { + var instance = getInstance(); + instance.put("subDir", value.value()); + return getBuilderAfterCommonparamsubdirPostsubDir(instance); + } + } + + public static class CommonparamsubdirPostPathParametersMap0Builder implements GenericBuilder> { + private final Map instance; + private static final Set knownKeys = Set.of( + "subDir" + ); + public Set getKnownKeys() { + return knownKeys; + } + public CommonparamsubdirPostPathParametersMap0Builder(Map instance) { + this.instance = instance; + } + public Map build() { + return instance; + } + } + + public static class CommonparamsubdirPostPathParametersMapBuilder implements SetterForCommonparamsubdirPostsubDir { + private final Map instance; + public CommonparamsubdirPostPathParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map getInstance() { + return instance; + } + public CommonparamsubdirPostPathParametersMap0Builder getBuilderAfterCommonparamsubdirPostsubDir(Map instance) { + return new CommonparamsubdirPostPathParametersMap0Builder(instance); + } + } + + + public sealed interface CommonparamsubdirPostPathParameters1Boxed permits CommonparamsubdirPostPathParameters1BoxedMap { + @Nullable Object getData(); + } + + public record CommonparamsubdirPostPathParameters1BoxedMap(CommonparamsubdirPostPathParametersMap data) implements CommonparamsubdirPostPathParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class CommonparamsubdirPostPathParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable CommonparamsubdirPostPathParameters1 instance = null; + + protected CommonparamsubdirPostPathParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("subDir", RouteParamSchema0.RouteParamSchema01.class) + )) + .required(Set.of( + "subDir" + )) + .additionalProperties(CommonparamsubdirPostadditionalProperties.class) + ); + } + + public static CommonparamsubdirPostPathParameters1 getInstance() { + if (instance == null) { + instance = new CommonparamsubdirPostPathParameters1(); + } + return instance; + } + + public CommonparamsubdirPostPathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof String)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (String) propertyInstance); + } + FrozenMap castProperties = new FrozenMap<>(properties); + return new CommonparamsubdirPostPathParametersMap(castProperties); + } + + public CommonparamsubdirPostPathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public CommonparamsubdirPostPathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new CommonparamsubdirPostPathParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public CommonparamsubdirPostPathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/CommonparamsubdirPostResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/CommonparamsubdirPostResponses.java new file mode 100644 index 00000000000..b0290f6651b --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/CommonparamsubdirPostResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.commonparamsubdir.post; + +import org.openapijsonschematools.client.paths.commonparamsubdir.post.responses.CommonparamsubdirPostCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class CommonparamsubdirPostResponses { + public sealed interface EndpointResponse permits EndpointCommonparamsubdirPostCode200Response {} + + public record EndpointCommonparamsubdirPostCode200Response( + HttpResponse response, + Void body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusCommonparamsubdirPostCode200ResponseDeserializer {} + + public static final class StatusCommonparamsubdirPostCode200ResponseDeserializer extends CommonparamsubdirPostCode200Response.CommonparamsubdirPostCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class CommonparamsubdirPostResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public CommonparamsubdirPostResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusCommonparamsubdirPostCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusCommonparamsubdirPostCode200ResponseDeserializer castDeserializer = (StatusCommonparamsubdirPostCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointCommonparamsubdirPostCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/HeaderParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/HeaderParameters.java deleted file mode 100644 index ff22d5ef1be..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/HeaderParameters.java +++ /dev/null @@ -1,191 +0,0 @@ -package org.openapijsonschematools.client.paths.commonparamsubdir.post; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.commonparamsubdir.post.parameters.parameter0.Schema0; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class HeaderParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class HeaderParametersMap extends FrozenMap { - protected HeaderParametersMap(FrozenMap m) { - super(m); - } - public static final Set requiredKeys = Set.of(); - public static final Set optionalKeys = Set.of( - "someHeader" - ); - public static HeaderParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return HeaderParameters1.getInstance().validate(arg, configuration); - } - - public String someHeader() throws UnsetPropertyException { - return getOrThrow("someHeader"); - } - } - - public interface SetterForSomeHeader { - Map getInstance(); - T getBuilderAfterSomeHeader(Map instance); - - default T someHeader(String value) { - var instance = getInstance(); - instance.put("someHeader", value); - return getBuilderAfterSomeHeader(instance); - } - } - - public static class HeaderParametersMapBuilder implements GenericBuilder>, SetterForSomeHeader { - private final Map instance; - private static final Set knownKeys = Set.of( - "someHeader" - ); - public Set getKnownKeys() { - return knownKeys; - } - public HeaderParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map build() { - return instance; - } - public Map getInstance() { - return instance; - } - public HeaderParametersMapBuilder getBuilderAfterSomeHeader(Map instance) { - return this; - } - } - - - public sealed interface HeaderParameters1Boxed permits HeaderParameters1BoxedMap { - @Nullable Object getData(); - } - - public record HeaderParameters1BoxedMap(HeaderParametersMap data) implements HeaderParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class HeaderParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable HeaderParameters1 instance = null; - - protected HeaderParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("someHeader", Schema0.Schema01.class) - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static HeaderParameters1 getInstance() { - if (instance == null) { - instance = new HeaderParameters1(); - } - return instance; - } - - public HeaderParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - if (!(propertyInstance instanceof String)) { - throw new RuntimeException("Invalid instantiated value"); - } - properties.put(propertyName, (String) propertyInstance); - } - FrozenMap castProperties = new FrozenMap<>(properties); - return new HeaderParametersMap(castProperties); - } - - public HeaderParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public HeaderParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new HeaderParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public HeaderParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/PathParameters.java deleted file mode 100644 index 10dd3c3509c..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/PathParameters.java +++ /dev/null @@ -1,211 +0,0 @@ -package org.openapijsonschematools.client.paths.commonparamsubdir.post; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.commonparamsubdir.parameters.routeparameter0.RouteParamSchema0; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class PathParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class PathParametersMap extends FrozenMap { - protected PathParametersMap(FrozenMap m) { - super(m); - } - public static final Set requiredKeys = Set.of( - "subDir" - ); - public static final Set optionalKeys = Set.of(); - public static PathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return PathParameters1.getInstance().validate(arg, configuration); - } - - public String subDir() { - try { - return getOrThrow("version"); - } catch (UnsetPropertyException e) { - throw new RuntimeException(e); - } - } - } - - public interface SetterForSubDir { - Map getInstance(); - T getBuilderAfterSubDir(Map instance); - - default T subDir(String value) { - var instance = getInstance(); - instance.put("subDir", value); - return getBuilderAfterSubDir(instance); - } - - default T subDir(RouteParamSchema0.StringRouteParamSchemaEnums0 value) { - var instance = getInstance(); - instance.put("subDir", value.value()); - return getBuilderAfterSubDir(instance); - } - } - - public static class PathParametersMap0Builder implements GenericBuilder> { - private final Map instance; - private static final Set knownKeys = Set.of( - "subDir" - ); - public Set getKnownKeys() { - return knownKeys; - } - public PathParametersMap0Builder(Map instance) { - this.instance = instance; - } - public Map build() { - return instance; - } - } - - public static class PathParametersMapBuilder implements SetterForSubDir { - private final Map instance; - public PathParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map getInstance() { - return instance; - } - public PathParametersMap0Builder getBuilderAfterSubDir(Map instance) { - return new PathParametersMap0Builder(instance); - } - } - - - public sealed interface PathParameters1Boxed permits PathParameters1BoxedMap { - @Nullable Object getData(); - } - - public record PathParameters1BoxedMap(PathParametersMap data) implements PathParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable PathParameters1 instance = null; - - protected PathParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("subDir", RouteParamSchema0.RouteParamSchema01.class) - )) - .required(Set.of( - "subDir" - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static PathParameters1 getInstance() { - if (instance == null) { - instance = new PathParameters1(); - } - return instance; - } - - public PathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - if (!(propertyInstance instanceof String)) { - throw new RuntimeException("Invalid instantiated value"); - } - properties.put(propertyName, (String) propertyInstance); - } - FrozenMap castProperties = new FrozenMap<>(properties); - return new PathParametersMap(castProperties); - } - - public PathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new PathParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/Responses.java deleted file mode 100644 index 12bcf6c08de..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.commonparamsubdir.post; - -import org.openapijsonschematools.client.paths.commonparamsubdir.post.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/responses/Code200Response.java deleted file mode 100644 index 81cdc60a4cd..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/responses/Code200Response.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.openapijsonschematools.client.paths.commonparamsubdir.post.responses; - -import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; - -public class Code200Response extends SuccessDescriptionOnly { - public static class Code200Response1 extends SuccessDescriptionOnly1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/responses/CommonparamsubdirPostCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/responses/CommonparamsubdirPostCode200Response.java new file mode 100644 index 00000000000..85eac21263a --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/commonparamsubdir/post/responses/CommonparamsubdirPostCode200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.commonparamsubdir.post.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class CommonparamsubdirPostCode200Response extends SuccessDescriptionOnly { + public static class CommonparamsubdirPostCode200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/Delete.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/Delete.java deleted file mode 100644 index 64e2a73038f..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/Delete.java +++ /dev/null @@ -1,261 +0,0 @@ -package org.openapijsonschematools.client.paths.fake; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fake.delete.FakeDeleteSecurityInfo; -import org.openapijsonschematools.client.paths.fake.delete.HeaderParameters; -import org.openapijsonschematools.client.paths.fake.delete.QueryParameters; -import org.openapijsonschematools.client.paths.fake.delete.Parameters; -import org.openapijsonschematools.client.paths.fake.delete.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.paths.Fake; -import org.openapijsonschematools.client.securityrequirementobjects.SecurityRequirementObject; -import org.openapijsonschematools.client.securityrequirementobjects.AuthApplier; - -import java.io.IOException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Delete { - private static class DeleteProvider extends AuthApplier { - private static final String method = "delete"; - - public static Responses.EndpointResponse delete( - DeleteRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - - var headersSerializer = new Parameters.HeaderParametersSerializer(); - Map> serializedHeaders = headersSerializer.serialize(request.headerParameters); - headers.putAll(serializedHeaders); - - var querySerializer = new Parameters.QueryParametersSerializer(); - @Nullable Map queryMap = querySerializer.getQueryMap(request.queryParameters); - String host = apiConfiguration.getServer(request.serverIndex).url(); - SecurityRequirementObject securityRequirementObject = apiConfiguration.getSecurityRequirementObject(request.securityIndex); - updateParamsForAuth( - securityRequirementObject, - headers, - Fake.path, - method, - bodyPublisher, - queryMap, - apiConfiguration - ); - - String url = host + Fake.path; - if (queryMap != null) { - url = url + querySerializer.serialize(queryMap); - } - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface DeleteOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse delete(DeleteRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return DeleteProvider.delete(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Delete1 extends ApiClient implements DeleteOperation { - public Delete1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class DeleteRequest { - public HeaderParameters.HeaderParametersMap headerParameters; - public QueryParameters.QueryParametersMap queryParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public FakeDeleteSecurityInfo.@Nullable SecurityIndex securityIndex; - public @Nullable Duration timeout; - - public DeleteRequest( - HeaderParameters.HeaderParametersMap headerParameters, - QueryParameters.QueryParametersMap queryParameters, - RootServerInfo.@Nullable ServerIndex serverIndex, - FakeDeleteSecurityInfo.@Nullable SecurityIndex securityIndex, - @Nullable Duration timeout - ) { - this.headerParameters = headerParameters; - this.queryParameters = queryParameters; - this.serverIndex = serverIndex; - this.securityIndex = securityIndex; - this.timeout = timeout; - } - } - - public static class DeleteNullableRequest { - public HeaderParameters.@Nullable HeaderParametersMap headerParameters; - public QueryParameters.@Nullable QueryParametersMap queryParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public FakeDeleteSecurityInfo.@Nullable SecurityIndex securityIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - DeleteNullableRequest getInstance(); - T getBuilderAfterServerIndex(DeleteNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForSecurityIndex { - DeleteNullableRequest getInstance(); - T getBuilderAfterSecurityIndex(DeleteNullableRequest instance); - default T securityIndex(FakeDeleteSecurityInfo.SecurityIndex securityIndex) { - var instance = getInstance(); - instance.securityIndex = securityIndex; - return getBuilderAfterSecurityIndex(instance); - } - } - - public interface SetterForTimeout { - DeleteNullableRequest getInstance(); - T getBuilderAfterTimeout(DeleteNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForHeaderParameters { - DeleteNullableRequest getInstance(); - T getBuilderAfterHeaderParameters(DeleteNullableRequest instance); - default T headerParameters(HeaderParameters.HeaderParametersMap headerParameters) { - var instance = getInstance(); - instance.headerParameters = headerParameters; - return getBuilderAfterHeaderParameters(instance); - } - } - - public interface SetterForQueryParameters { - DeleteNullableRequest getInstance(); - T getBuilderAfterQueryParameters(DeleteNullableRequest instance); - default T queryParameters(QueryParameters.QueryParametersMap queryParameters) { - var instance = getInstance(); - instance.queryParameters = queryParameters; - return getBuilderAfterQueryParameters(instance); - } - } - - public static class Delete00RequestBuilder implements SetterForServerIndex, SetterForSecurityIndex, SetterForTimeout { - private final DeleteNullableRequest instance; - - public Delete00RequestBuilder(DeleteNullableRequest instance) { - this.instance = instance; - } - - public DeleteRequest build() { - var headerParameters = instance.headerParameters; - if (headerParameters == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - var queryParameters = instance.queryParameters; - if (queryParameters == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new DeleteRequest( - headerParameters, - queryParameters, - instance.serverIndex, - instance.securityIndex, - instance.timeout - ); - } - - public DeleteNullableRequest getInstance() { - return instance; - } - - public Delete00RequestBuilder getBuilderAfterServerIndex(DeleteNullableRequest instance) { - return this; - } - - public Delete00RequestBuilder getBuilderAfterSecurityIndex(DeleteNullableRequest instance) { - return this; - } - - public Delete00RequestBuilder getBuilderAfterTimeout(DeleteNullableRequest instance) { - return this; - } - } - public static class Delete01RequestBuilder implements SetterForQueryParameters { - private final DeleteNullableRequest instance; - - public Delete01RequestBuilder(DeleteNullableRequest instance) { - this.instance = instance; - } - - public DeleteNullableRequest getInstance() { - return instance; - } - - public Delete00RequestBuilder getBuilderAfterQueryParameters(DeleteNullableRequest instance) { - return new Delete00RequestBuilder(instance); - } - } - public static class Delete10RequestBuilder implements SetterForHeaderParameters { - private final DeleteNullableRequest instance; - - public Delete10RequestBuilder(DeleteNullableRequest instance) { - this.instance = instance; - } - - public DeleteNullableRequest getInstance() { - return instance; - } - - public Delete00RequestBuilder getBuilderAfterHeaderParameters(DeleteNullableRequest instance) { - return new Delete00RequestBuilder(instance); - } - } - public static class DeleteRequestBuilder implements SetterForHeaderParameters, SetterForQueryParameters { - private final DeleteNullableRequest instance; - - public DeleteRequestBuilder() { - this.instance = new DeleteNullableRequest(); - } - - public DeleteNullableRequest getInstance() { - return instance; - } - - public Delete01RequestBuilder getBuilderAfterHeaderParameters(DeleteNullableRequest instance) { - return new Delete01RequestBuilder(instance); - } - - public Delete10RequestBuilder getBuilderAfterQueryParameters(DeleteNullableRequest instance) { - return new Delete10RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/FakeDelete.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/FakeDelete.java new file mode 100644 index 00000000000..61fb91038b5 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/FakeDelete.java @@ -0,0 +1,270 @@ +package org.openapijsonschematools.client.paths.fake; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fake.delete.FakeDeleteSecurityInfo; +import org.openapijsonschematools.client.paths.fake.delete.FakeDeleteHeaderParameters; +import org.openapijsonschematools.client.paths.fake.delete.FakeDeleteQueryParameters; +import org.openapijsonschematools.client.paths.fake.delete.Parameters; +import org.openapijsonschematools.client.paths.fake.delete.FakeDeleteResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.paths.Fake; +import org.openapijsonschematools.client.securityrequirementobjects.SecurityRequirementObject; +import org.openapijsonschematools.client.securityrequirementobjects.AuthApplier; + +import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakeDelete { + private static class DeleteProvider extends AuthApplier { + private static final String method = "delete"; + + public static FakeDeleteResponses.EndpointResponse delete( + DeleteRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + + var headersSerializer = new Parameters.HeaderParametersSerializer(); + Map> serializedHeaders = headersSerializer.serialize(request.headerParameters); + headers.putAll(serializedHeaders); + + var querySerializer = new Parameters.QueryParametersSerializer(); + @Nullable Map queryMap = querySerializer.getQueryMap(request.queryParameters); + String host = apiConfiguration.getServer(request.serverIndex).url(); + SecurityRequirementObject securityRequirementObject = apiConfiguration.getSecurityRequirementObject(request.securityIndex); + updateParamsForAuth( + securityRequirementObject, + headers, + Fake.path, + method, + bodyPublisher, + queryMap, + apiConfiguration + ); + + String url = host + Fake.path; + if (queryMap != null) { + url = url + querySerializer.serialize(queryMap); + } + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakeDeleteResponses.FakeDeleteResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface DeleteOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakeDeleteResponses.EndpointResponse delete(DeleteRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return DeleteProvider.delete(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface GroupParametersOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakeDeleteResponses.EndpointResponse groupParameters(DeleteRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return DeleteProvider.delete(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Delete extends ApiClient implements DeleteOperation { + public Delete(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class DeleteRequest { + public FakeDeleteHeaderParameters.FakeDeleteHeaderParametersMap headerParameters; + public FakeDeleteQueryParameters.FakeDeleteQueryParametersMap queryParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public FakeDeleteSecurityInfo.@Nullable SecurityIndex securityIndex; + public @Nullable Duration timeout; + + public DeleteRequest( + FakeDeleteHeaderParameters.FakeDeleteHeaderParametersMap headerParameters, + FakeDeleteQueryParameters.FakeDeleteQueryParametersMap queryParameters, + RootServerInfo.@Nullable ServerIndex serverIndex, + FakeDeleteSecurityInfo.@Nullable SecurityIndex securityIndex, + @Nullable Duration timeout + ) { + this.headerParameters = headerParameters; + this.queryParameters = queryParameters; + this.serverIndex = serverIndex; + this.securityIndex = securityIndex; + this.timeout = timeout; + } + } + + public static class DeleteNullableRequest { + public FakeDeleteHeaderParameters.@Nullable FakeDeleteHeaderParametersMap headerParameters; + public FakeDeleteQueryParameters.@Nullable FakeDeleteQueryParametersMap queryParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public FakeDeleteSecurityInfo.@Nullable SecurityIndex securityIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + DeleteNullableRequest getInstance(); + T getBuilderAfterServerIndex(DeleteNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForSecurityIndex { + DeleteNullableRequest getInstance(); + T getBuilderAfterSecurityIndex(DeleteNullableRequest instance); + default T securityIndex(FakeDeleteSecurityInfo.SecurityIndex securityIndex) { + var instance = getInstance(); + instance.securityIndex = securityIndex; + return getBuilderAfterSecurityIndex(instance); + } + } + + public interface SetterForTimeout { + DeleteNullableRequest getInstance(); + T getBuilderAfterTimeout(DeleteNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForHeaderParameters { + DeleteNullableRequest getInstance(); + T getBuilderAfterHeaderParameters(DeleteNullableRequest instance); + default T headerParameters(FakeDeleteHeaderParameters.FakeDeleteHeaderParametersMap headerParameters) { + var instance = getInstance(); + instance.headerParameters = headerParameters; + return getBuilderAfterHeaderParameters(instance); + } + } + + public interface SetterForQueryParameters { + DeleteNullableRequest getInstance(); + T getBuilderAfterQueryParameters(DeleteNullableRequest instance); + default T queryParameters(FakeDeleteQueryParameters.FakeDeleteQueryParametersMap queryParameters) { + var instance = getInstance(); + instance.queryParameters = queryParameters; + return getBuilderAfterQueryParameters(instance); + } + } + + public static class Delete00RequestBuilder implements SetterForServerIndex, SetterForSecurityIndex, SetterForTimeout { + private final DeleteNullableRequest instance; + + public Delete00RequestBuilder(DeleteNullableRequest instance) { + this.instance = instance; + } + + public DeleteRequest build() { + var headerParameters = instance.headerParameters; + if (headerParameters == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + var queryParameters = instance.queryParameters; + if (queryParameters == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new DeleteRequest( + headerParameters, + queryParameters, + instance.serverIndex, + instance.securityIndex, + instance.timeout + ); + } + + public DeleteNullableRequest getInstance() { + return instance; + } + + public Delete00RequestBuilder getBuilderAfterServerIndex(DeleteNullableRequest instance) { + return this; + } + + public Delete00RequestBuilder getBuilderAfterSecurityIndex(DeleteNullableRequest instance) { + return this; + } + + public Delete00RequestBuilder getBuilderAfterTimeout(DeleteNullableRequest instance) { + return this; + } + } + public static class Delete01RequestBuilder implements SetterForQueryParameters { + private final DeleteNullableRequest instance; + + public Delete01RequestBuilder(DeleteNullableRequest instance) { + this.instance = instance; + } + + public DeleteNullableRequest getInstance() { + return instance; + } + + public Delete00RequestBuilder getBuilderAfterQueryParameters(DeleteNullableRequest instance) { + return new Delete00RequestBuilder(instance); + } + } + public static class Delete10RequestBuilder implements SetterForHeaderParameters { + private final DeleteNullableRequest instance; + + public Delete10RequestBuilder(DeleteNullableRequest instance) { + this.instance = instance; + } + + public DeleteNullableRequest getInstance() { + return instance; + } + + public Delete00RequestBuilder getBuilderAfterHeaderParameters(DeleteNullableRequest instance) { + return new Delete00RequestBuilder(instance); + } + } + public static class DeleteRequestBuilder implements SetterForHeaderParameters, SetterForQueryParameters { + private final DeleteNullableRequest instance; + + public DeleteRequestBuilder() { + this.instance = new DeleteNullableRequest(); + } + + public DeleteNullableRequest getInstance() { + return instance; + } + + public Delete01RequestBuilder getBuilderAfterHeaderParameters(DeleteNullableRequest instance) { + return new Delete01RequestBuilder(instance); + } + + public Delete10RequestBuilder getBuilderAfterQueryParameters(DeleteNullableRequest instance) { + return new Delete10RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/FakeGet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/FakeGet.java new file mode 100644 index 00000000000..64738201ed4 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/FakeGet.java @@ -0,0 +1,198 @@ +package org.openapijsonschematools.client.paths.fake; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.fake.get.FakeGetRequestBody; +import org.openapijsonschematools.client.paths.fake.get.FakeGetHeaderParameters; +import org.openapijsonschematools.client.paths.fake.get.FakeGetQueryParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fake.get.Parameters; +import org.openapijsonschematools.client.paths.fake.get.FakeGetResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Fake; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakeGet { + private static class GetProvider { + private static final String method = "get"; + + public static FakeGetResponses.EndpointResponse get( + GetRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + @Nullable SerializedRequestBody serializedRequestBody; + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + if (request.requestBody != null) { + serializedRequestBody = new FakeGetRequestBody.FakeGetRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + bodyPublisher = serializedRequestBody.bodyPublisher; + } + + if (request.headerParameters != null) { + var headersSerializer = new Parameters.HeaderParametersSerializer(); + Map> serializedHeaders = headersSerializer.serialize(request.headerParameters); + headers.putAll(serializedHeaders); + } + + var querySerializer = new Parameters.QueryParametersSerializer(); + @Nullable Map queryMap = null; + if (request.queryParameters != null) { + queryMap = querySerializer.getQueryMap(request.queryParameters); + } + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fake.path; + if (queryMap != null) { + url = url + querySerializer.serialize(queryMap); + } + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakeGetResponses.FakeGetResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface GetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakeGetResponses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface EnumParametersOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakeGetResponses.EndpointResponse enumParameters(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Get extends ApiClient implements GetOperation { + public Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class GetRequest { + public FakeGetRequestBody.@Nullable SealedRequestBody requestBody; + public FakeGetHeaderParameters.@Nullable FakeGetHeaderParametersMap headerParameters; + public FakeGetQueryParameters.@Nullable FakeGetQueryParametersMap queryParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForRequestBody { + GetRequest getInstance(); + T getBuilderAfterRequestBody(GetRequest instance); + default T requestBody(FakeGetRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public interface SetterForHeaderParameters { + GetRequest getInstance(); + T getBuilderAfterHeaderParameters(GetRequest instance); + default T headerParameters(FakeGetHeaderParameters.FakeGetHeaderParametersMap headerParameters) { + var instance = getInstance(); + instance.headerParameters = headerParameters; + return getBuilderAfterHeaderParameters(instance); + } + } + + public interface SetterForQueryParameters { + GetRequest getInstance(); + T getBuilderAfterQueryParameters(GetRequest instance); + default T queryParameters(FakeGetQueryParameters.FakeGetQueryParametersMap queryParameters) { + var instance = getInstance(); + instance.queryParameters = queryParameters; + return getBuilderAfterQueryParameters(instance); + } + } + + public interface SetterForServerIndex { + GetRequest getInstance(); + T getBuilderAfterServerIndex(GetRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + GetRequest getInstance(); + T getBuilderAfterTimeout(GetRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class GetRequestBuilder implements SetterForRequestBody, SetterForHeaderParameters, SetterForQueryParameters, SetterForServerIndex, SetterForTimeout { + private final GetRequest instance; + + public GetRequestBuilder() { + this.instance = new GetRequest(); + } + + public GetRequest build() { + return instance; + } + + public GetRequest getInstance() { + return instance; + } + + public GetRequestBuilder getBuilderAfterRequestBody(GetRequest instance) { + return this; + } + + public GetRequestBuilder getBuilderAfterHeaderParameters(GetRequest instance) { + return this; + } + + public GetRequestBuilder getBuilderAfterQueryParameters(GetRequest instance) { + return this; + } + + public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { + return this; + } + + public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/FakePatch.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/FakePatch.java new file mode 100644 index 00000000000..e723af46b95 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/FakePatch.java @@ -0,0 +1,183 @@ +package org.openapijsonschematools.client.paths.fake; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fake.patch.FakePatchRequestBody; +import org.openapijsonschematools.client.paths.fake.patch.FakePatchResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Fake; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakePatch { + private static class PatchProvider { + private static final String method = "patch"; + + public static FakePatchResponses.EndpointResponse patch( + PatchRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + SerializedRequestBody serializedRequestBody = new FakePatchRequestBody.FakePatchRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fake.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakePatchResponses.FakePatchResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PatchOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakePatchResponses.EndpointResponse patch(PatchRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PatchProvider.patch(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface ClientModelOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakePatchResponses.EndpointResponse clientModel(PatchRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PatchProvider.patch(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Patch extends ApiClient implements PatchOperation { + public Patch(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PatchRequest { + public FakePatchRequestBody.SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + + public PatchRequest( + FakePatchRequestBody.SealedRequestBody requestBody, + RootServerInfo.@Nullable ServerIndex serverIndex, + @Nullable Duration timeout + ) { + this.requestBody = requestBody; + this.serverIndex = serverIndex; + this.timeout = timeout; + } + } + + public static class PatchNullableRequest { + public FakePatchRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + PatchNullableRequest getInstance(); + T getBuilderAfterServerIndex(PatchNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PatchNullableRequest getInstance(); + T getBuilderAfterTimeout(PatchNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForRequestBody { + PatchNullableRequest getInstance(); + T getBuilderAfterRequestBody(PatchNullableRequest instance); + default T requestBody(FakePatchRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public static class Patch0RequestBuilder implements SetterForServerIndex, SetterForTimeout { + private final PatchNullableRequest instance; + + public Patch0RequestBuilder(PatchNullableRequest instance) { + this.instance = instance; + } + + public PatchRequest build() { + var requestBody = instance.requestBody; + if (requestBody == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new PatchRequest( + requestBody, + instance.serverIndex, + instance.timeout + ); + } + + public PatchNullableRequest getInstance() { + return instance; + } + + public Patch0RequestBuilder getBuilderAfterServerIndex(PatchNullableRequest instance) { + return this; + } + + public Patch0RequestBuilder getBuilderAfterTimeout(PatchNullableRequest instance) { + return this; + } + } + public static class PatchRequestBuilder implements SetterForRequestBody { + private final PatchNullableRequest instance; + + public PatchRequestBuilder() { + this.instance = new PatchNullableRequest(); + } + + public PatchNullableRequest getInstance() { + return instance; + } + + public Patch0RequestBuilder getBuilderAfterRequestBody(PatchNullableRequest instance) { + return new Patch0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/FakePost.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/FakePost.java new file mode 100644 index 00000000000..7772656bdfe --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/FakePost.java @@ -0,0 +1,180 @@ +package org.openapijsonschematools.client.paths.fake; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.fake.post.FakePostRequestBody; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fake.post.FakePostSecurityInfo; +import org.openapijsonschematools.client.paths.fake.post.FakePostResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Fake; +import org.openapijsonschematools.client.securityrequirementobjects.SecurityRequirementObject; +import org.openapijsonschematools.client.securityrequirementobjects.AuthApplier; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakePost { + private static class PostProvider extends AuthApplier { + private static final String method = "post"; + + public static FakePostResponses.EndpointResponse post( + PostRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + @Nullable SerializedRequestBody serializedRequestBody; + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + if (request.requestBody != null) { + serializedRequestBody = new FakePostRequestBody.FakePostRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + bodyPublisher = serializedRequestBody.bodyPublisher; + } + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + SecurityRequirementObject securityRequirementObject = apiConfiguration.getSecurityRequirementObject(request.securityIndex); + updateParamsForAuth( + securityRequirementObject, + headers, + Fake.path, + method, + bodyPublisher, + queryMap, + apiConfiguration + ); + + String url = host + Fake.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakePostResponses.FakePostResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PostOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakePostResponses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface EndpointParametersOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakePostResponses.EndpointResponse endpointParameters(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Post extends ApiClient implements PostOperation { + public Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PostRequest { + public FakePostRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public FakePostSecurityInfo.@Nullable SecurityIndex securityIndex; + public @Nullable Duration timeout; + } + + public interface SetterForRequestBody { + PostRequest getInstance(); + T getBuilderAfterRequestBody(PostRequest instance); + default T requestBody(FakePostRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public interface SetterForServerIndex { + PostRequest getInstance(); + T getBuilderAfterServerIndex(PostRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForSecurityIndex { + PostRequest getInstance(); + T getBuilderAfterSecurityIndex(PostRequest instance); + default T securityIndex(FakePostSecurityInfo.SecurityIndex securityIndex) { + var instance = getInstance(); + instance.securityIndex = securityIndex; + return getBuilderAfterSecurityIndex(instance); + } + } + + public interface SetterForTimeout { + PostRequest getInstance(); + T getBuilderAfterTimeout(PostRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class PostRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForSecurityIndex, SetterForTimeout { + private final PostRequest instance; + + public PostRequestBuilder() { + this.instance = new PostRequest(); + } + + public PostRequest build() { + return instance; + } + + public PostRequest getInstance() { + return instance; + } + + public PostRequestBuilder getBuilderAfterRequestBody(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterServerIndex(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterSecurityIndex(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterTimeout(PostRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/Get.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/Get.java deleted file mode 100644 index 94d40088458..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/Get.java +++ /dev/null @@ -1,189 +0,0 @@ -package org.openapijsonschematools.client.paths.fake; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.fake.get.RequestBody; -import org.openapijsonschematools.client.paths.fake.get.HeaderParameters; -import org.openapijsonschematools.client.paths.fake.get.QueryParameters; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fake.get.Parameters; -import org.openapijsonschematools.client.paths.fake.get.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Fake; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Get { - private static class GetProvider { - private static final String method = "get"; - - public static Responses.EndpointResponse get( - GetRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - @Nullable SerializedRequestBody serializedRequestBody; - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - if (request.requestBody != null) { - serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - bodyPublisher = serializedRequestBody.bodyPublisher; - } - - if (request.headerParameters != null) { - var headersSerializer = new Parameters.HeaderParametersSerializer(); - Map> serializedHeaders = headersSerializer.serialize(request.headerParameters); - headers.putAll(serializedHeaders); - } - - var querySerializer = new Parameters.QueryParametersSerializer(); - @Nullable Map queryMap = null; - if (request.queryParameters != null) { - queryMap = querySerializer.getQueryMap(request.queryParameters); - } - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fake.path; - if (queryMap != null) { - url = url + querySerializer.serialize(queryMap); - } - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface GetOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Get1 extends ApiClient implements GetOperation { - public Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class GetRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public HeaderParameters.@Nullable HeaderParametersMap headerParameters; - public QueryParameters.@Nullable QueryParametersMap queryParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForRequestBody { - GetRequest getInstance(); - T getBuilderAfterRequestBody(GetRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public interface SetterForHeaderParameters { - GetRequest getInstance(); - T getBuilderAfterHeaderParameters(GetRequest instance); - default T headerParameters(HeaderParameters.HeaderParametersMap headerParameters) { - var instance = getInstance(); - instance.headerParameters = headerParameters; - return getBuilderAfterHeaderParameters(instance); - } - } - - public interface SetterForQueryParameters { - GetRequest getInstance(); - T getBuilderAfterQueryParameters(GetRequest instance); - default T queryParameters(QueryParameters.QueryParametersMap queryParameters) { - var instance = getInstance(); - instance.queryParameters = queryParameters; - return getBuilderAfterQueryParameters(instance); - } - } - - public interface SetterForServerIndex { - GetRequest getInstance(); - T getBuilderAfterServerIndex(GetRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - GetRequest getInstance(); - T getBuilderAfterTimeout(GetRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class GetRequestBuilder implements SetterForRequestBody, SetterForHeaderParameters, SetterForQueryParameters, SetterForServerIndex, SetterForTimeout { - private final GetRequest instance; - - public GetRequestBuilder() { - this.instance = new GetRequest(); - } - - public GetRequest build() { - return instance; - } - - public GetRequest getInstance() { - return instance; - } - - public GetRequestBuilder getBuilderAfterRequestBody(GetRequest instance) { - return this; - } - - public GetRequestBuilder getBuilderAfterHeaderParameters(GetRequest instance) { - return this; - } - - public GetRequestBuilder getBuilderAfterQueryParameters(GetRequest instance) { - return this; - } - - public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { - return this; - } - - public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/Patch.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/Patch.java deleted file mode 100644 index 913a462909d..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/Patch.java +++ /dev/null @@ -1,174 +0,0 @@ -package org.openapijsonschematools.client.paths.fake; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fake.patch.RequestBody; -import org.openapijsonschematools.client.paths.fake.patch.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Fake; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Patch { - private static class PatchProvider { - private static final String method = "patch"; - - public static Responses.EndpointResponse patch( - PatchRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - SerializedRequestBody serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fake.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PatchOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse patch(PatchRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PatchProvider.patch(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Patch1 extends ApiClient implements PatchOperation { - public Patch1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PatchRequest { - public RequestBody.SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - - public PatchRequest( - RequestBody.SealedRequestBody requestBody, - RootServerInfo.@Nullable ServerIndex serverIndex, - @Nullable Duration timeout - ) { - this.requestBody = requestBody; - this.serverIndex = serverIndex; - this.timeout = timeout; - } - } - - public static class PatchNullableRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - PatchNullableRequest getInstance(); - T getBuilderAfterServerIndex(PatchNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PatchNullableRequest getInstance(); - T getBuilderAfterTimeout(PatchNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForRequestBody { - PatchNullableRequest getInstance(); - T getBuilderAfterRequestBody(PatchNullableRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public static class Patch0RequestBuilder implements SetterForServerIndex, SetterForTimeout { - private final PatchNullableRequest instance; - - public Patch0RequestBuilder(PatchNullableRequest instance) { - this.instance = instance; - } - - public PatchRequest build() { - var requestBody = instance.requestBody; - if (requestBody == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new PatchRequest( - requestBody, - instance.serverIndex, - instance.timeout - ); - } - - public PatchNullableRequest getInstance() { - return instance; - } - - public Patch0RequestBuilder getBuilderAfterServerIndex(PatchNullableRequest instance) { - return this; - } - - public Patch0RequestBuilder getBuilderAfterTimeout(PatchNullableRequest instance) { - return this; - } - } - public static class PatchRequestBuilder implements SetterForRequestBody { - private final PatchNullableRequest instance; - - public PatchRequestBuilder() { - this.instance = new PatchNullableRequest(); - } - - public PatchNullableRequest getInstance() { - return instance; - } - - public Patch0RequestBuilder getBuilderAfterRequestBody(PatchNullableRequest instance) { - return new Patch0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/Post.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/Post.java deleted file mode 100644 index 18da6442b7b..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/Post.java +++ /dev/null @@ -1,171 +0,0 @@ -package org.openapijsonschematools.client.paths.fake; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.fake.post.RequestBody; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fake.post.FakePostSecurityInfo; -import org.openapijsonschematools.client.paths.fake.post.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Fake; -import org.openapijsonschematools.client.securityrequirementobjects.SecurityRequirementObject; -import org.openapijsonschematools.client.securityrequirementobjects.AuthApplier; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Post { - private static class PostProvider extends AuthApplier { - private static final String method = "post"; - - public static Responses.EndpointResponse post( - PostRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - @Nullable SerializedRequestBody serializedRequestBody; - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - if (request.requestBody != null) { - serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - bodyPublisher = serializedRequestBody.bodyPublisher; - } - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - SecurityRequirementObject securityRequirementObject = apiConfiguration.getSecurityRequirementObject(request.securityIndex); - updateParamsForAuth( - securityRequirementObject, - headers, - Fake.path, - method, - bodyPublisher, - queryMap, - apiConfiguration - ); - - String url = host + Fake.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PostOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Post1 extends ApiClient implements PostOperation { - public Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PostRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public FakePostSecurityInfo.@Nullable SecurityIndex securityIndex; - public @Nullable Duration timeout; - } - - public interface SetterForRequestBody { - PostRequest getInstance(); - T getBuilderAfterRequestBody(PostRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public interface SetterForServerIndex { - PostRequest getInstance(); - T getBuilderAfterServerIndex(PostRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForSecurityIndex { - PostRequest getInstance(); - T getBuilderAfterSecurityIndex(PostRequest instance); - default T securityIndex(FakePostSecurityInfo.SecurityIndex securityIndex) { - var instance = getInstance(); - instance.securityIndex = securityIndex; - return getBuilderAfterSecurityIndex(instance); - } - } - - public interface SetterForTimeout { - PostRequest getInstance(); - T getBuilderAfterTimeout(PostRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class PostRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForSecurityIndex, SetterForTimeout { - private final PostRequest instance; - - public PostRequestBuilder() { - this.instance = new PostRequest(); - } - - public PostRequest build() { - return instance; - } - - public PostRequest getInstance() { - return instance; - } - - public PostRequestBuilder getBuilderAfterRequestBody(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterServerIndex(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterSecurityIndex(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterTimeout(PostRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/FakeDeleteHeaderParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/FakeDeleteHeaderParameters.java new file mode 100644 index 00000000000..64314223dd9 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/FakeDeleteHeaderParameters.java @@ -0,0 +1,246 @@ +package org.openapijsonschematools.client.paths.fake.delete; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.fake.delete.parameters.parameter1.Schema1; +import org.openapijsonschematools.client.paths.fake.delete.parameters.parameter4.Schema4; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class FakeDeleteHeaderParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class FakeDeleteadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable FakeDeleteadditionalProperties instance = null; + public static FakeDeleteadditionalProperties getInstance() { + if (instance == null) { + instance = new FakeDeleteadditionalProperties(); + } + return instance; + } + } + + + public static class FakeDeleteHeaderParametersMap extends FrozenMap<@Nullable Object> { + protected FakeDeleteHeaderParametersMap(FrozenMap<@Nullable Object> m) { + super(m); + } + public static final Set requiredKeys = Set.of( + "required_boolean_group" + ); + public static final Set optionalKeys = Set.of( + "boolean_group" + ); + public static FakeDeleteHeaderParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return FakeDeleteHeaderParameters1.getInstance().validate(arg, configuration); + } + + public String required_boolean_group() { + @Nullable Object value = get("required_boolean_group"); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for required_boolean_group"); + } + return (String) value; + } + + public String boolean_group() throws UnsetPropertyException { + String key = "boolean_group"; + throwIfKeyNotPresent(key); + @Nullable Object value = get(key); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for boolean_group"); + } + return (String) value; + } + } + + public interface SetterForFakeDeleterequiredBooleanGroup { + Map getInstance(); + T getBuilderAfterFakeDeleterequiredBooleanGroup(Map instance); + + default T required_boolean_group(String value) { + var instance = getInstance(); + instance.put("required_boolean_group", value); + return getBuilderAfterFakeDeleterequiredBooleanGroup(instance); + } + + default T required_boolean_group(Schema1.StringSchemaEnums1 value) { + var instance = getInstance(); + instance.put("required_boolean_group", value.value()); + return getBuilderAfterFakeDeleterequiredBooleanGroup(instance); + } + } + + public interface SetterForFakeDeletebooleanGroup { + Map getInstance(); + T getBuilderAfterFakeDeletebooleanGroup(Map instance); + + default T boolean_group(String value) { + var instance = getInstance(); + instance.put("boolean_group", value); + return getBuilderAfterFakeDeletebooleanGroup(instance); + } + + default T boolean_group(Schema4.StringSchemaEnums4 value) { + var instance = getInstance(); + instance.put("boolean_group", value.value()); + return getBuilderAfterFakeDeletebooleanGroup(instance); + } + } + + public static class FakeDeleteHeaderParametersMap0Builder implements GenericBuilder>, SetterForFakeDeletebooleanGroup { + private final Map instance; + private static final Set knownKeys = Set.of( + "required_boolean_group", + "boolean_group" + ); + public Set getKnownKeys() { + return knownKeys; + } + public FakeDeleteHeaderParametersMap0Builder(Map instance) { + this.instance = instance; + } + public Map build() { + return instance; + } + public Map getInstance() { + return instance; + } + public FakeDeleteHeaderParametersMap0Builder getBuilderAfterFakeDeletebooleanGroup(Map instance) { + return this; + } + } + + public static class FakeDeleteHeaderParametersMapBuilder implements SetterForFakeDeleterequiredBooleanGroup { + private final Map instance; + public FakeDeleteHeaderParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map getInstance() { + return instance; + } + public FakeDeleteHeaderParametersMap0Builder getBuilderAfterFakeDeleterequiredBooleanGroup(Map instance) { + return new FakeDeleteHeaderParametersMap0Builder(instance); + } + } + + + public sealed interface FakeDeleteHeaderParameters1Boxed permits FakeDeleteHeaderParameters1BoxedMap { + @Nullable Object getData(); + } + + public record FakeDeleteHeaderParameters1BoxedMap(FakeDeleteHeaderParametersMap data) implements FakeDeleteHeaderParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class FakeDeleteHeaderParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable FakeDeleteHeaderParameters1 instance = null; + + protected FakeDeleteHeaderParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("required_boolean_group", Schema1.Schema11.class), + new PropertyEntry("boolean_group", Schema4.Schema41.class) + )) + .required(Set.of( + "required_boolean_group" + )) + .additionalProperties(FakeDeleteadditionalProperties.class) + ); + } + + public static FakeDeleteHeaderParameters1 getInstance() { + if (instance == null) { + instance = new FakeDeleteHeaderParameters1(); + } + return instance; + } + + public FakeDeleteHeaderParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + properties.put(propertyName, propertyInstance); + } + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); + return new FakeDeleteHeaderParametersMap(castProperties); + } + + public FakeDeleteHeaderParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public FakeDeleteHeaderParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new FakeDeleteHeaderParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public FakeDeleteHeaderParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/FakeDeleteQueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/FakeDeleteQueryParameters.java new file mode 100644 index 00000000000..23fd96460a5 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/FakeDeleteQueryParameters.java @@ -0,0 +1,351 @@ +package org.openapijsonschematools.client.paths.fake.delete; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.fake.delete.parameters.parameter0.Schema0; +import org.openapijsonschematools.client.paths.fake.delete.parameters.parameter2.Schema2; +import org.openapijsonschematools.client.paths.fake.delete.parameters.parameter3.Schema3; +import org.openapijsonschematools.client.paths.fake.delete.parameters.parameter5.Schema5; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class FakeDeleteQueryParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class FakeDeleteadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable FakeDeleteadditionalProperties instance = null; + public static FakeDeleteadditionalProperties getInstance() { + if (instance == null) { + instance = new FakeDeleteadditionalProperties(); + } + return instance; + } + } + + + public static class FakeDeleteQueryParametersMap extends FrozenMap<@Nullable Object> { + protected FakeDeleteQueryParametersMap(FrozenMap<@Nullable Object> m) { + super(m); + } + public static final Set requiredKeys = Set.of( + "required_int64_group", + "required_string_group" + ); + public static final Set optionalKeys = Set.of( + "int64_group", + "string_group" + ); + public static FakeDeleteQueryParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return FakeDeleteQueryParameters1.getInstance().validate(arg, configuration); + } + + public Number required_int64_group() { + @Nullable Object value = get("required_int64_group"); + if (!(value instanceof Number)) { + throw new RuntimeException("Invalid value stored for required_int64_group"); + } + return (Number) value; + } + + public String required_string_group() { + @Nullable Object value = get("required_string_group"); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for required_string_group"); + } + return (String) value; + } + + public Number int64_group() throws UnsetPropertyException { + String key = "int64_group"; + throwIfKeyNotPresent(key); + @Nullable Object value = get(key); + if (!(value instanceof Number)) { + throw new RuntimeException("Invalid value stored for int64_group"); + } + return (Number) value; + } + + public String string_group() throws UnsetPropertyException { + String key = "string_group"; + throwIfKeyNotPresent(key); + @Nullable Object value = get(key); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for string_group"); + } + return (String) value; + } + } + + public interface SetterForFakeDeleterequiredInt64Group { + Map getInstance(); + T getBuilderAfterFakeDeleterequiredInt64Group(Map instance); + + default T required_int64_group(int value) { + var instance = getInstance(); + instance.put("required_int64_group", value); + return getBuilderAfterFakeDeleterequiredInt64Group(instance); + } + + default T required_int64_group(float value) { + var instance = getInstance(); + instance.put("required_int64_group", value); + return getBuilderAfterFakeDeleterequiredInt64Group(instance); + } + + default T required_int64_group(long value) { + var instance = getInstance(); + instance.put("required_int64_group", value); + return getBuilderAfterFakeDeleterequiredInt64Group(instance); + } + + default T required_int64_group(double value) { + var instance = getInstance(); + instance.put("required_int64_group", value); + return getBuilderAfterFakeDeleterequiredInt64Group(instance); + } + } + + public interface SetterForFakeDeleterequiredStringGroup { + Map getInstance(); + T getBuilderAfterFakeDeleterequiredStringGroup(Map instance); + + default T required_string_group(String value) { + var instance = getInstance(); + instance.put("required_string_group", value); + return getBuilderAfterFakeDeleterequiredStringGroup(instance); + } + } + + public interface SetterForFakeDeleteint64Group { + Map getInstance(); + T getBuilderAfterFakeDeleteint64Group(Map instance); + + default T int64_group(int value) { + var instance = getInstance(); + instance.put("int64_group", value); + return getBuilderAfterFakeDeleteint64Group(instance); + } + + default T int64_group(float value) { + var instance = getInstance(); + instance.put("int64_group", value); + return getBuilderAfterFakeDeleteint64Group(instance); + } + + default T int64_group(long value) { + var instance = getInstance(); + instance.put("int64_group", value); + return getBuilderAfterFakeDeleteint64Group(instance); + } + + default T int64_group(double value) { + var instance = getInstance(); + instance.put("int64_group", value); + return getBuilderAfterFakeDeleteint64Group(instance); + } + } + + public interface SetterForFakeDeletestringGroup { + Map getInstance(); + T getBuilderAfterFakeDeletestringGroup(Map instance); + + default T string_group(String value) { + var instance = getInstance(); + instance.put("string_group", value); + return getBuilderAfterFakeDeletestringGroup(instance); + } + } + + public static class FakeDeleteQueryParametersMap00Builder implements GenericBuilder>, SetterForFakeDeleteint64Group, SetterForFakeDeletestringGroup { + private final Map instance; + private static final Set knownKeys = Set.of( + "required_int64_group", + "required_string_group", + "int64_group", + "string_group" + ); + public Set getKnownKeys() { + return knownKeys; + } + public FakeDeleteQueryParametersMap00Builder(Map instance) { + this.instance = instance; + } + public Map build() { + return instance; + } + public Map getInstance() { + return instance; + } + public FakeDeleteQueryParametersMap00Builder getBuilderAfterFakeDeleteint64Group(Map instance) { + return this; + } + public FakeDeleteQueryParametersMap00Builder getBuilderAfterFakeDeletestringGroup(Map instance) { + return this; + } + } + + public static class FakeDeleteQueryParametersMap01Builder implements SetterForFakeDeleterequiredStringGroup { + private final Map instance; + public FakeDeleteQueryParametersMap01Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FakeDeleteQueryParametersMap00Builder getBuilderAfterFakeDeleterequiredStringGroup(Map instance) { + return new FakeDeleteQueryParametersMap00Builder(instance); + } + } + + public static class FakeDeleteQueryParametersMap10Builder implements SetterForFakeDeleterequiredInt64Group { + private final Map instance; + public FakeDeleteQueryParametersMap10Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FakeDeleteQueryParametersMap00Builder getBuilderAfterFakeDeleterequiredInt64Group(Map instance) { + return new FakeDeleteQueryParametersMap00Builder(instance); + } + } + + public static class FakeDeleteQueryParametersMapBuilder implements SetterForFakeDeleterequiredInt64Group, SetterForFakeDeleterequiredStringGroup { + private final Map instance; + public FakeDeleteQueryParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map getInstance() { + return instance; + } + public FakeDeleteQueryParametersMap01Builder getBuilderAfterFakeDeleterequiredInt64Group(Map instance) { + return new FakeDeleteQueryParametersMap01Builder(instance); + } + public FakeDeleteQueryParametersMap10Builder getBuilderAfterFakeDeleterequiredStringGroup(Map instance) { + return new FakeDeleteQueryParametersMap10Builder(instance); + } + } + + + public sealed interface FakeDeleteQueryParameters1Boxed permits FakeDeleteQueryParameters1BoxedMap { + @Nullable Object getData(); + } + + public record FakeDeleteQueryParameters1BoxedMap(FakeDeleteQueryParametersMap data) implements FakeDeleteQueryParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class FakeDeleteQueryParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable FakeDeleteQueryParameters1 instance = null; + + protected FakeDeleteQueryParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("required_string_group", Schema0.Schema01.class), + new PropertyEntry("int64_group", Schema5.Schema51.class), + new PropertyEntry("string_group", Schema3.Schema31.class), + new PropertyEntry("required_int64_group", Schema2.Schema21.class) + )) + .required(Set.of( + "required_int64_group", + "required_string_group" + )) + .additionalProperties(FakeDeleteadditionalProperties.class) + ); + } + + public static FakeDeleteQueryParameters1 getInstance() { + if (instance == null) { + instance = new FakeDeleteQueryParameters1(); + } + return instance; + } + + public FakeDeleteQueryParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + properties.put(propertyName, propertyInstance); + } + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); + return new FakeDeleteQueryParametersMap(castProperties); + } + + public FakeDeleteQueryParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public FakeDeleteQueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new FakeDeleteQueryParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public FakeDeleteQueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/FakeDeleteResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/FakeDeleteResponses.java new file mode 100644 index 00000000000..6482372de63 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/FakeDeleteResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fake.delete; + +import org.openapijsonschematools.client.paths.fake.delete.responses.FakeDeleteCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakeDeleteResponses { + public sealed interface EndpointResponse permits EndpointFakeDeleteCode200Response {} + + public record EndpointFakeDeleteCode200Response( + HttpResponse response, + Void body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakeDeleteCode200ResponseDeserializer {} + + public static final class StatusFakeDeleteCode200ResponseDeserializer extends FakeDeleteCode200Response.FakeDeleteCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakeDeleteResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakeDeleteResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakeDeleteCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakeDeleteCode200ResponseDeserializer castDeserializer = (StatusFakeDeleteCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakeDeleteCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/HeaderParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/HeaderParameters.java deleted file mode 100644 index 67d2c45dff6..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/HeaderParameters.java +++ /dev/null @@ -1,246 +0,0 @@ -package org.openapijsonschematools.client.paths.fake.delete; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.fake.delete.parameters.parameter1.Schema1; -import org.openapijsonschematools.client.paths.fake.delete.parameters.parameter4.Schema4; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class HeaderParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class HeaderParametersMap extends FrozenMap<@Nullable Object> { - protected HeaderParametersMap(FrozenMap<@Nullable Object> m) { - super(m); - } - public static final Set requiredKeys = Set.of( - "required_boolean_group" - ); - public static final Set optionalKeys = Set.of( - "boolean_group" - ); - public static HeaderParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return HeaderParameters1.getInstance().validate(arg, configuration); - } - - public String required_boolean_group() { - @Nullable Object value = get("required_boolean_group"); - if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for required_boolean_group"); - } - return (String) value; - } - - public String boolean_group() throws UnsetPropertyException { - String key = "boolean_group"; - throwIfKeyNotPresent(key); - @Nullable Object value = get(key); - if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for boolean_group"); - } - return (String) value; - } - } - - public interface SetterForRequiredBooleanGroup { - Map getInstance(); - T getBuilderAfterRequiredBooleanGroup(Map instance); - - default T required_boolean_group(String value) { - var instance = getInstance(); - instance.put("required_boolean_group", value); - return getBuilderAfterRequiredBooleanGroup(instance); - } - - default T required_boolean_group(Schema1.StringSchemaEnums1 value) { - var instance = getInstance(); - instance.put("required_boolean_group", value.value()); - return getBuilderAfterRequiredBooleanGroup(instance); - } - } - - public interface SetterForBooleanGroup { - Map getInstance(); - T getBuilderAfterBooleanGroup(Map instance); - - default T boolean_group(String value) { - var instance = getInstance(); - instance.put("boolean_group", value); - return getBuilderAfterBooleanGroup(instance); - } - - default T boolean_group(Schema4.StringSchemaEnums4 value) { - var instance = getInstance(); - instance.put("boolean_group", value.value()); - return getBuilderAfterBooleanGroup(instance); - } - } - - public static class HeaderParametersMap0Builder implements GenericBuilder>, SetterForBooleanGroup { - private final Map instance; - private static final Set knownKeys = Set.of( - "required_boolean_group", - "boolean_group" - ); - public Set getKnownKeys() { - return knownKeys; - } - public HeaderParametersMap0Builder(Map instance) { - this.instance = instance; - } - public Map build() { - return instance; - } - public Map getInstance() { - return instance; - } - public HeaderParametersMap0Builder getBuilderAfterBooleanGroup(Map instance) { - return this; - } - } - - public static class HeaderParametersMapBuilder implements SetterForRequiredBooleanGroup { - private final Map instance; - public HeaderParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map getInstance() { - return instance; - } - public HeaderParametersMap0Builder getBuilderAfterRequiredBooleanGroup(Map instance) { - return new HeaderParametersMap0Builder(instance); - } - } - - - public sealed interface HeaderParameters1Boxed permits HeaderParameters1BoxedMap { - @Nullable Object getData(); - } - - public record HeaderParameters1BoxedMap(HeaderParametersMap data) implements HeaderParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class HeaderParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable HeaderParameters1 instance = null; - - protected HeaderParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("required_boolean_group", Schema1.Schema11.class), - new PropertyEntry("boolean_group", Schema4.Schema41.class) - )) - .required(Set.of( - "required_boolean_group" - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static HeaderParameters1 getInstance() { - if (instance == null) { - instance = new HeaderParameters1(); - } - return instance; - } - - public HeaderParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, propertyInstance); - } - FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); - return new HeaderParametersMap(castProperties); - } - - public HeaderParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public HeaderParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new HeaderParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public HeaderParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/QueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/QueryParameters.java deleted file mode 100644 index 3df61763b6a..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/QueryParameters.java +++ /dev/null @@ -1,351 +0,0 @@ -package org.openapijsonschematools.client.paths.fake.delete; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.fake.delete.parameters.parameter0.Schema0; -import org.openapijsonschematools.client.paths.fake.delete.parameters.parameter2.Schema2; -import org.openapijsonschematools.client.paths.fake.delete.parameters.parameter3.Schema3; -import org.openapijsonschematools.client.paths.fake.delete.parameters.parameter5.Schema5; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class QueryParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class QueryParametersMap extends FrozenMap<@Nullable Object> { - protected QueryParametersMap(FrozenMap<@Nullable Object> m) { - super(m); - } - public static final Set requiredKeys = Set.of( - "required_int64_group", - "required_string_group" - ); - public static final Set optionalKeys = Set.of( - "int64_group", - "string_group" - ); - public static QueryParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return QueryParameters1.getInstance().validate(arg, configuration); - } - - public Number required_int64_group() { - @Nullable Object value = get("required_int64_group"); - if (!(value instanceof Number)) { - throw new RuntimeException("Invalid value stored for required_int64_group"); - } - return (Number) value; - } - - public String required_string_group() { - @Nullable Object value = get("required_string_group"); - if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for required_string_group"); - } - return (String) value; - } - - public Number int64_group() throws UnsetPropertyException { - String key = "int64_group"; - throwIfKeyNotPresent(key); - @Nullable Object value = get(key); - if (!(value instanceof Number)) { - throw new RuntimeException("Invalid value stored for int64_group"); - } - return (Number) value; - } - - public String string_group() throws UnsetPropertyException { - String key = "string_group"; - throwIfKeyNotPresent(key); - @Nullable Object value = get(key); - if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for string_group"); - } - return (String) value; - } - } - - public interface SetterForRequiredInt64Group { - Map getInstance(); - T getBuilderAfterRequiredInt64Group(Map instance); - - default T required_int64_group(int value) { - var instance = getInstance(); - instance.put("required_int64_group", value); - return getBuilderAfterRequiredInt64Group(instance); - } - - default T required_int64_group(float value) { - var instance = getInstance(); - instance.put("required_int64_group", value); - return getBuilderAfterRequiredInt64Group(instance); - } - - default T required_int64_group(long value) { - var instance = getInstance(); - instance.put("required_int64_group", value); - return getBuilderAfterRequiredInt64Group(instance); - } - - default T required_int64_group(double value) { - var instance = getInstance(); - instance.put("required_int64_group", value); - return getBuilderAfterRequiredInt64Group(instance); - } - } - - public interface SetterForRequiredStringGroup { - Map getInstance(); - T getBuilderAfterRequiredStringGroup(Map instance); - - default T required_string_group(String value) { - var instance = getInstance(); - instance.put("required_string_group", value); - return getBuilderAfterRequiredStringGroup(instance); - } - } - - public interface SetterForInt64Group { - Map getInstance(); - T getBuilderAfterInt64Group(Map instance); - - default T int64_group(int value) { - var instance = getInstance(); - instance.put("int64_group", value); - return getBuilderAfterInt64Group(instance); - } - - default T int64_group(float value) { - var instance = getInstance(); - instance.put("int64_group", value); - return getBuilderAfterInt64Group(instance); - } - - default T int64_group(long value) { - var instance = getInstance(); - instance.put("int64_group", value); - return getBuilderAfterInt64Group(instance); - } - - default T int64_group(double value) { - var instance = getInstance(); - instance.put("int64_group", value); - return getBuilderAfterInt64Group(instance); - } - } - - public interface SetterForStringGroup { - Map getInstance(); - T getBuilderAfterStringGroup(Map instance); - - default T string_group(String value) { - var instance = getInstance(); - instance.put("string_group", value); - return getBuilderAfterStringGroup(instance); - } - } - - public static class QueryParametersMap00Builder implements GenericBuilder>, SetterForInt64Group, SetterForStringGroup { - private final Map instance; - private static final Set knownKeys = Set.of( - "required_int64_group", - "required_string_group", - "int64_group", - "string_group" - ); - public Set getKnownKeys() { - return knownKeys; - } - public QueryParametersMap00Builder(Map instance) { - this.instance = instance; - } - public Map build() { - return instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap00Builder getBuilderAfterInt64Group(Map instance) { - return this; - } - public QueryParametersMap00Builder getBuilderAfterStringGroup(Map instance) { - return this; - } - } - - public static class QueryParametersMap01Builder implements SetterForRequiredStringGroup { - private final Map instance; - public QueryParametersMap01Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap00Builder getBuilderAfterRequiredStringGroup(Map instance) { - return new QueryParametersMap00Builder(instance); - } - } - - public static class QueryParametersMap10Builder implements SetterForRequiredInt64Group { - private final Map instance; - public QueryParametersMap10Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap00Builder getBuilderAfterRequiredInt64Group(Map instance) { - return new QueryParametersMap00Builder(instance); - } - } - - public static class QueryParametersMapBuilder implements SetterForRequiredInt64Group, SetterForRequiredStringGroup { - private final Map instance; - public QueryParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map getInstance() { - return instance; - } - public QueryParametersMap01Builder getBuilderAfterRequiredInt64Group(Map instance) { - return new QueryParametersMap01Builder(instance); - } - public QueryParametersMap10Builder getBuilderAfterRequiredStringGroup(Map instance) { - return new QueryParametersMap10Builder(instance); - } - } - - - public sealed interface QueryParameters1Boxed permits QueryParameters1BoxedMap { - @Nullable Object getData(); - } - - public record QueryParameters1BoxedMap(QueryParametersMap data) implements QueryParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable QueryParameters1 instance = null; - - protected QueryParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("required_string_group", Schema0.Schema01.class), - new PropertyEntry("int64_group", Schema5.Schema51.class), - new PropertyEntry("string_group", Schema3.Schema31.class), - new PropertyEntry("required_int64_group", Schema2.Schema21.class) - )) - .required(Set.of( - "required_int64_group", - "required_string_group" - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static QueryParameters1 getInstance() { - if (instance == null) { - instance = new QueryParameters1(); - } - return instance; - } - - public QueryParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, propertyInstance); - } - FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); - return new QueryParametersMap(castProperties); - } - - public QueryParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public QueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new QueryParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public QueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/Responses.java deleted file mode 100644 index 1ea719d635f..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fake.delete; - -import org.openapijsonschematools.client.paths.fake.delete.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/responses/Code200Response.java deleted file mode 100644 index 5094d251738..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/responses/Code200Response.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.openapijsonschematools.client.paths.fake.delete.responses; - -import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; - -public class Code200Response extends SuccessDescriptionOnly { - public static class Code200Response1 extends SuccessDescriptionOnly1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/responses/FakeDeleteCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/responses/FakeDeleteCode200Response.java new file mode 100644 index 00000000000..a9caf9729de --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/delete/responses/FakeDeleteCode200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.fake.delete.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class FakeDeleteCode200Response extends SuccessDescriptionOnly { + public static class FakeDeleteCode200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/FakeGetHeaderParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/FakeGetHeaderParameters.java new file mode 100644 index 00000000000..d68aaf404ce --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/FakeGetHeaderParameters.java @@ -0,0 +1,228 @@ +package org.openapijsonschematools.client.paths.fake.get; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.fake.get.parameters.parameter0.Schema0; +import org.openapijsonschematools.client.paths.fake.get.parameters.parameter1.Schema1; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class FakeGetHeaderParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class FakeGetadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable FakeGetadditionalProperties instance = null; + public static FakeGetadditionalProperties getInstance() { + if (instance == null) { + instance = new FakeGetadditionalProperties(); + } + return instance; + } + } + + + public static class FakeGetHeaderParametersMap extends FrozenMap<@Nullable Object> { + protected FakeGetHeaderParametersMap(FrozenMap<@Nullable Object> m) { + super(m); + } + public static final Set requiredKeys = Set.of(); + public static final Set optionalKeys = Set.of( + "enum_header_string", + "enum_header_string_array" + ); + public static FakeGetHeaderParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return FakeGetHeaderParameters1.getInstance().validate(arg, configuration); + } + + public String enum_header_string() throws UnsetPropertyException { + String key = "enum_header_string"; + throwIfKeyNotPresent(key); + @Nullable Object value = get(key); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for enum_header_string"); + } + return (String) value; + } + + public Schema0.SchemaList0 enum_header_string_array() throws UnsetPropertyException { + String key = "enum_header_string_array"; + throwIfKeyNotPresent(key); + @Nullable Object value = get(key); + if (!(value instanceof Schema0.SchemaList0)) { + throw new RuntimeException("Invalid value stored for enum_header_string_array"); + } + return (Schema0.SchemaList0) value; + } + } + + public interface SetterForFakeGetenumHeaderString { + Map getInstance(); + T getBuilderAfterFakeGetenumHeaderString(Map instance); + + default T enum_header_string(String value) { + var instance = getInstance(); + instance.put("enum_header_string", value); + return getBuilderAfterFakeGetenumHeaderString(instance); + } + + default T enum_header_string(Schema1.StringSchemaEnums1 value) { + var instance = getInstance(); + instance.put("enum_header_string", value.value()); + return getBuilderAfterFakeGetenumHeaderString(instance); + } + } + + public interface SetterForFakeGetenumHeaderStringArray { + Map getInstance(); + T getBuilderAfterFakeGetenumHeaderStringArray(Map instance); + + default T enum_header_string_array(List value) { + var instance = getInstance(); + instance.put("enum_header_string_array", value); + return getBuilderAfterFakeGetenumHeaderStringArray(instance); + } + } + + public static class FakeGetHeaderParametersMapBuilder implements GenericBuilder>, SetterForFakeGetenumHeaderString, SetterForFakeGetenumHeaderStringArray { + private final Map instance; + private static final Set knownKeys = Set.of( + "enum_header_string", + "enum_header_string_array" + ); + public Set getKnownKeys() { + return knownKeys; + } + public FakeGetHeaderParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map build() { + return instance; + } + public Map getInstance() { + return instance; + } + public FakeGetHeaderParametersMapBuilder getBuilderAfterFakeGetenumHeaderString(Map instance) { + return this; + } + public FakeGetHeaderParametersMapBuilder getBuilderAfterFakeGetenumHeaderStringArray(Map instance) { + return this; + } + } + + + public sealed interface FakeGetHeaderParameters1Boxed permits FakeGetHeaderParameters1BoxedMap { + @Nullable Object getData(); + } + + public record FakeGetHeaderParameters1BoxedMap(FakeGetHeaderParametersMap data) implements FakeGetHeaderParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class FakeGetHeaderParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable FakeGetHeaderParameters1 instance = null; + + protected FakeGetHeaderParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("enum_header_string", Schema1.Schema11.class), + new PropertyEntry("enum_header_string_array", Schema0.Schema01.class) + )) + .additionalProperties(FakeGetadditionalProperties.class) + ); + } + + public static FakeGetHeaderParameters1 getInstance() { + if (instance == null) { + instance = new FakeGetHeaderParameters1(); + } + return instance; + } + + public FakeGetHeaderParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + properties.put(propertyName, propertyInstance); + } + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); + return new FakeGetHeaderParametersMap(castProperties); + } + + public FakeGetHeaderParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public FakeGetHeaderParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new FakeGetHeaderParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public FakeGetHeaderParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/FakeGetQueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/FakeGetQueryParameters.java new file mode 100644 index 00000000000..99fba6a721f --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/FakeGetQueryParameters.java @@ -0,0 +1,344 @@ +package org.openapijsonschematools.client.paths.fake.get; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.fake.get.parameters.parameter2.Schema2; +import org.openapijsonschematools.client.paths.fake.get.parameters.parameter3.Schema3; +import org.openapijsonschematools.client.paths.fake.get.parameters.parameter4.Schema4; +import org.openapijsonschematools.client.paths.fake.get.parameters.parameter5.Schema5; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class FakeGetQueryParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class FakeGetadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable FakeGetadditionalProperties instance = null; + public static FakeGetadditionalProperties getInstance() { + if (instance == null) { + instance = new FakeGetadditionalProperties(); + } + return instance; + } + } + + + public static class FakeGetQueryParametersMap extends FrozenMap<@Nullable Object> { + protected FakeGetQueryParametersMap(FrozenMap<@Nullable Object> m) { + super(m); + } + public static final Set requiredKeys = Set.of(); + public static final Set optionalKeys = Set.of( + "enum_query_double", + "enum_query_string", + "enum_query_integer", + "enum_query_string_array" + ); + public static FakeGetQueryParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return FakeGetQueryParameters1.getInstance().validate(arg, configuration); + } + + public Number enum_query_double() throws UnsetPropertyException { + String key = "enum_query_double"; + throwIfKeyNotPresent(key); + @Nullable Object value = get(key); + if (!(value instanceof Number)) { + throw new RuntimeException("Invalid value stored for enum_query_double"); + } + return (Number) value; + } + + public String enum_query_string() throws UnsetPropertyException { + String key = "enum_query_string"; + throwIfKeyNotPresent(key); + @Nullable Object value = get(key); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for enum_query_string"); + } + return (String) value; + } + + public Number enum_query_integer() throws UnsetPropertyException { + String key = "enum_query_integer"; + throwIfKeyNotPresent(key); + @Nullable Object value = get(key); + if (!(value instanceof Number)) { + throw new RuntimeException("Invalid value stored for enum_query_integer"); + } + return (Number) value; + } + + public Schema2.SchemaList2 enum_query_string_array() throws UnsetPropertyException { + String key = "enum_query_string_array"; + throwIfKeyNotPresent(key); + @Nullable Object value = get(key); + if (!(value instanceof Schema2.SchemaList2)) { + throw new RuntimeException("Invalid value stored for enum_query_string_array"); + } + return (Schema2.SchemaList2) value; + } + } + + public interface SetterForFakeGetenumQueryDouble { + Map getInstance(); + T getBuilderAfterFakeGetenumQueryDouble(Map instance); + + default T enum_query_double(int value) { + var instance = getInstance(); + instance.put("enum_query_double", value); + return getBuilderAfterFakeGetenumQueryDouble(instance); + } + + default T enum_query_double(float value) { + var instance = getInstance(); + instance.put("enum_query_double", value); + return getBuilderAfterFakeGetenumQueryDouble(instance); + } + + default T enum_query_double(long value) { + var instance = getInstance(); + instance.put("enum_query_double", value); + return getBuilderAfterFakeGetenumQueryDouble(instance); + } + + default T enum_query_double(double value) { + var instance = getInstance(); + instance.put("enum_query_double", value); + return getBuilderAfterFakeGetenumQueryDouble(instance); + } + + default T enum_query_double(Schema5.DoubleSchemaEnums5 value) { + var instance = getInstance(); + instance.put("enum_query_double", value.value()); + return getBuilderAfterFakeGetenumQueryDouble(instance); + } + + default T enum_query_double(Schema5.FloatSchemaEnums5 value) { + var instance = getInstance(); + instance.put("enum_query_double", value.value()); + return getBuilderAfterFakeGetenumQueryDouble(instance); + } + } + + public interface SetterForFakeGetenumQueryString { + Map getInstance(); + T getBuilderAfterFakeGetenumQueryString(Map instance); + + default T enum_query_string(String value) { + var instance = getInstance(); + instance.put("enum_query_string", value); + return getBuilderAfterFakeGetenumQueryString(instance); + } + + default T enum_query_string(Schema3.StringSchemaEnums3 value) { + var instance = getInstance(); + instance.put("enum_query_string", value.value()); + return getBuilderAfterFakeGetenumQueryString(instance); + } + } + + public interface SetterForFakeGetenumQueryInteger { + Map getInstance(); + T getBuilderAfterFakeGetenumQueryInteger(Map instance); + + default T enum_query_integer(int value) { + var instance = getInstance(); + instance.put("enum_query_integer", value); + return getBuilderAfterFakeGetenumQueryInteger(instance); + } + + default T enum_query_integer(float value) { + var instance = getInstance(); + instance.put("enum_query_integer", value); + return getBuilderAfterFakeGetenumQueryInteger(instance); + } + + default T enum_query_integer(Schema4.IntegerSchemaEnums4 value) { + var instance = getInstance(); + instance.put("enum_query_integer", value.value()); + return getBuilderAfterFakeGetenumQueryInteger(instance); + } + + default T enum_query_integer(Schema4.LongSchemaEnums4 value) { + var instance = getInstance(); + instance.put("enum_query_integer", value.value()); + return getBuilderAfterFakeGetenumQueryInteger(instance); + } + + default T enum_query_integer(Schema4.FloatSchemaEnums4 value) { + var instance = getInstance(); + instance.put("enum_query_integer", value.value()); + return getBuilderAfterFakeGetenumQueryInteger(instance); + } + + default T enum_query_integer(Schema4.DoubleSchemaEnums4 value) { + var instance = getInstance(); + instance.put("enum_query_integer", value.value()); + return getBuilderAfterFakeGetenumQueryInteger(instance); + } + } + + public interface SetterForFakeGetenumQueryStringArray { + Map getInstance(); + T getBuilderAfterFakeGetenumQueryStringArray(Map instance); + + default T enum_query_string_array(List value) { + var instance = getInstance(); + instance.put("enum_query_string_array", value); + return getBuilderAfterFakeGetenumQueryStringArray(instance); + } + } + + public static class FakeGetQueryParametersMapBuilder implements GenericBuilder>, SetterForFakeGetenumQueryDouble, SetterForFakeGetenumQueryString, SetterForFakeGetenumQueryInteger, SetterForFakeGetenumQueryStringArray { + private final Map instance; + private static final Set knownKeys = Set.of( + "enum_query_double", + "enum_query_string", + "enum_query_integer", + "enum_query_string_array" + ); + public Set getKnownKeys() { + return knownKeys; + } + public FakeGetQueryParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map build() { + return instance; + } + public Map getInstance() { + return instance; + } + public FakeGetQueryParametersMapBuilder getBuilderAfterFakeGetenumQueryDouble(Map instance) { + return this; + } + public FakeGetQueryParametersMapBuilder getBuilderAfterFakeGetenumQueryString(Map instance) { + return this; + } + public FakeGetQueryParametersMapBuilder getBuilderAfterFakeGetenumQueryInteger(Map instance) { + return this; + } + public FakeGetQueryParametersMapBuilder getBuilderAfterFakeGetenumQueryStringArray(Map instance) { + return this; + } + } + + + public sealed interface FakeGetQueryParameters1Boxed permits FakeGetQueryParameters1BoxedMap { + @Nullable Object getData(); + } + + public record FakeGetQueryParameters1BoxedMap(FakeGetQueryParametersMap data) implements FakeGetQueryParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class FakeGetQueryParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable FakeGetQueryParameters1 instance = null; + + protected FakeGetQueryParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("enum_query_double", Schema5.Schema51.class), + new PropertyEntry("enum_query_string", Schema3.Schema31.class), + new PropertyEntry("enum_query_integer", Schema4.Schema41.class), + new PropertyEntry("enum_query_string_array", Schema2.Schema21.class) + )) + .additionalProperties(FakeGetadditionalProperties.class) + ); + } + + public static FakeGetQueryParameters1 getInstance() { + if (instance == null) { + instance = new FakeGetQueryParameters1(); + } + return instance; + } + + public FakeGetQueryParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + properties.put(propertyName, propertyInstance); + } + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); + return new FakeGetQueryParametersMap(castProperties); + } + + public FakeGetQueryParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public FakeGetQueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new FakeGetQueryParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public FakeGetQueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/FakeGetRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/FakeGetRequestBody.java new file mode 100644 index 00000000000..fc306ea11bd --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/FakeGetRequestBody.java @@ -0,0 +1,53 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.fake.get; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fake.get.requestbody.content.applicationxwwwformurlencoded.ApplicationxwwwformurlencodedSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class FakeGetRequestBody { + public sealed interface SealedMediaType permits ApplicationxwwwformurlencodedMediaType {} + + public record ApplicationxwwwformurlencodedMediaType(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationxwwwformurlencodedMediaType() { + this(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class FakeGetRequestBody1 extends RequestBodySerializer { + public FakeGetRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/x-www-form-urlencoded", new ApplicationxwwwformurlencodedMediaType()) + ), + false + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + ApplicationxwwwformurlencodedRequestBody requestBody0 = (ApplicationxwwwformurlencodedRequestBody) requestBody; + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } + } + + public sealed interface SealedRequestBody permits ApplicationxwwwformurlencodedRequestBody {} + public record ApplicationxwwwformurlencodedRequestBody(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "application/x-www-form-urlencoded"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/FakeGetResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/FakeGetResponses.java new file mode 100644 index 00000000000..ff46bc65ce0 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/FakeGetResponses.java @@ -0,0 +1,66 @@ +package org.openapijsonschematools.client.paths.fake.get; + +import org.openapijsonschematools.client.paths.fake.get.responses.FakeGetCode200Response; +import org.openapijsonschematools.client.paths.fake.get.responses.FakeGetCode404Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakeGetResponses { + public sealed interface EndpointResponse permits EndpointFakeGetCode200Response {} + + public record EndpointFakeGetCode200Response( + HttpResponse response, + Void body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakeGetCode200ResponseDeserializer, StatusFakeGetCode404ResponseDeserializer {} + + public static final class StatusFakeGetCode200ResponseDeserializer extends FakeGetCode200Response.FakeGetCode200Response1 implements StatusCodeResponseDeserializer { + } + public static final class StatusFakeGetCode404ResponseDeserializer extends FakeGetCode404Response.FakeGetCode404Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakeGetResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakeGetResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakeGetCode200ResponseDeserializer()), + new AbstractMap.SimpleEntry<>("404", new StatusFakeGetCode404ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + if (statusCodeDeserializer instanceof StatusFakeGetCode200ResponseDeserializer castDeserializer) { + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakeGetCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } else { + StatusFakeGetCode404ResponseDeserializer castDeserializer = (StatusFakeGetCode404ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + throw new FakeGetCode404Response.ResponseApiException( + "Received error statusCode response from server", + response, + deserializedResponse + ); + } + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/HeaderParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/HeaderParameters.java deleted file mode 100644 index c2c414a176f..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/HeaderParameters.java +++ /dev/null @@ -1,228 +0,0 @@ -package org.openapijsonschematools.client.paths.fake.get; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.fake.get.parameters.parameter0.Schema0; -import org.openapijsonschematools.client.paths.fake.get.parameters.parameter1.Schema1; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class HeaderParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class HeaderParametersMap extends FrozenMap<@Nullable Object> { - protected HeaderParametersMap(FrozenMap<@Nullable Object> m) { - super(m); - } - public static final Set requiredKeys = Set.of(); - public static final Set optionalKeys = Set.of( - "enum_header_string", - "enum_header_string_array" - ); - public static HeaderParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return HeaderParameters1.getInstance().validate(arg, configuration); - } - - public String enum_header_string() throws UnsetPropertyException { - String key = "enum_header_string"; - throwIfKeyNotPresent(key); - @Nullable Object value = get(key); - if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for enum_header_string"); - } - return (String) value; - } - - public Schema0.SchemaList0 enum_header_string_array() throws UnsetPropertyException { - String key = "enum_header_string_array"; - throwIfKeyNotPresent(key); - @Nullable Object value = get(key); - if (!(value instanceof Schema0.SchemaList0)) { - throw new RuntimeException("Invalid value stored for enum_header_string_array"); - } - return (Schema0.SchemaList0) value; - } - } - - public interface SetterForEnumHeaderString { - Map getInstance(); - T getBuilderAfterEnumHeaderString(Map instance); - - default T enum_header_string(String value) { - var instance = getInstance(); - instance.put("enum_header_string", value); - return getBuilderAfterEnumHeaderString(instance); - } - - default T enum_header_string(Schema1.StringSchemaEnums1 value) { - var instance = getInstance(); - instance.put("enum_header_string", value.value()); - return getBuilderAfterEnumHeaderString(instance); - } - } - - public interface SetterForEnumHeaderStringArray { - Map getInstance(); - T getBuilderAfterEnumHeaderStringArray(Map instance); - - default T enum_header_string_array(List value) { - var instance = getInstance(); - instance.put("enum_header_string_array", value); - return getBuilderAfterEnumHeaderStringArray(instance); - } - } - - public static class HeaderParametersMapBuilder implements GenericBuilder>, SetterForEnumHeaderString, SetterForEnumHeaderStringArray { - private final Map instance; - private static final Set knownKeys = Set.of( - "enum_header_string", - "enum_header_string_array" - ); - public Set getKnownKeys() { - return knownKeys; - } - public HeaderParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map build() { - return instance; - } - public Map getInstance() { - return instance; - } - public HeaderParametersMapBuilder getBuilderAfterEnumHeaderString(Map instance) { - return this; - } - public HeaderParametersMapBuilder getBuilderAfterEnumHeaderStringArray(Map instance) { - return this; - } - } - - - public sealed interface HeaderParameters1Boxed permits HeaderParameters1BoxedMap { - @Nullable Object getData(); - } - - public record HeaderParameters1BoxedMap(HeaderParametersMap data) implements HeaderParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class HeaderParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable HeaderParameters1 instance = null; - - protected HeaderParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("enum_header_string", Schema1.Schema11.class), - new PropertyEntry("enum_header_string_array", Schema0.Schema01.class) - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static HeaderParameters1 getInstance() { - if (instance == null) { - instance = new HeaderParameters1(); - } - return instance; - } - - public HeaderParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, propertyInstance); - } - FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); - return new HeaderParametersMap(castProperties); - } - - public HeaderParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public HeaderParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new HeaderParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public HeaderParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/QueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/QueryParameters.java deleted file mode 100644 index 1b72ab67825..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/QueryParameters.java +++ /dev/null @@ -1,344 +0,0 @@ -package org.openapijsonschematools.client.paths.fake.get; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.fake.get.parameters.parameter2.Schema2; -import org.openapijsonschematools.client.paths.fake.get.parameters.parameter3.Schema3; -import org.openapijsonschematools.client.paths.fake.get.parameters.parameter4.Schema4; -import org.openapijsonschematools.client.paths.fake.get.parameters.parameter5.Schema5; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class QueryParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class QueryParametersMap extends FrozenMap<@Nullable Object> { - protected QueryParametersMap(FrozenMap<@Nullable Object> m) { - super(m); - } - public static final Set requiredKeys = Set.of(); - public static final Set optionalKeys = Set.of( - "enum_query_double", - "enum_query_string", - "enum_query_integer", - "enum_query_string_array" - ); - public static QueryParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return QueryParameters1.getInstance().validate(arg, configuration); - } - - public Number enum_query_double() throws UnsetPropertyException { - String key = "enum_query_double"; - throwIfKeyNotPresent(key); - @Nullable Object value = get(key); - if (!(value instanceof Number)) { - throw new RuntimeException("Invalid value stored for enum_query_double"); - } - return (Number) value; - } - - public String enum_query_string() throws UnsetPropertyException { - String key = "enum_query_string"; - throwIfKeyNotPresent(key); - @Nullable Object value = get(key); - if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for enum_query_string"); - } - return (String) value; - } - - public Number enum_query_integer() throws UnsetPropertyException { - String key = "enum_query_integer"; - throwIfKeyNotPresent(key); - @Nullable Object value = get(key); - if (!(value instanceof Number)) { - throw new RuntimeException("Invalid value stored for enum_query_integer"); - } - return (Number) value; - } - - public Schema2.SchemaList2 enum_query_string_array() throws UnsetPropertyException { - String key = "enum_query_string_array"; - throwIfKeyNotPresent(key); - @Nullable Object value = get(key); - if (!(value instanceof Schema2.SchemaList2)) { - throw new RuntimeException("Invalid value stored for enum_query_string_array"); - } - return (Schema2.SchemaList2) value; - } - } - - public interface SetterForEnumQueryDouble { - Map getInstance(); - T getBuilderAfterEnumQueryDouble(Map instance); - - default T enum_query_double(int value) { - var instance = getInstance(); - instance.put("enum_query_double", value); - return getBuilderAfterEnumQueryDouble(instance); - } - - default T enum_query_double(float value) { - var instance = getInstance(); - instance.put("enum_query_double", value); - return getBuilderAfterEnumQueryDouble(instance); - } - - default T enum_query_double(long value) { - var instance = getInstance(); - instance.put("enum_query_double", value); - return getBuilderAfterEnumQueryDouble(instance); - } - - default T enum_query_double(double value) { - var instance = getInstance(); - instance.put("enum_query_double", value); - return getBuilderAfterEnumQueryDouble(instance); - } - - default T enum_query_double(Schema5.DoubleSchemaEnums5 value) { - var instance = getInstance(); - instance.put("enum_query_double", value.value()); - return getBuilderAfterEnumQueryDouble(instance); - } - - default T enum_query_double(Schema5.FloatSchemaEnums5 value) { - var instance = getInstance(); - instance.put("enum_query_double", value.value()); - return getBuilderAfterEnumQueryDouble(instance); - } - } - - public interface SetterForEnumQueryString { - Map getInstance(); - T getBuilderAfterEnumQueryString(Map instance); - - default T enum_query_string(String value) { - var instance = getInstance(); - instance.put("enum_query_string", value); - return getBuilderAfterEnumQueryString(instance); - } - - default T enum_query_string(Schema3.StringSchemaEnums3 value) { - var instance = getInstance(); - instance.put("enum_query_string", value.value()); - return getBuilderAfterEnumQueryString(instance); - } - } - - public interface SetterForEnumQueryInteger { - Map getInstance(); - T getBuilderAfterEnumQueryInteger(Map instance); - - default T enum_query_integer(int value) { - var instance = getInstance(); - instance.put("enum_query_integer", value); - return getBuilderAfterEnumQueryInteger(instance); - } - - default T enum_query_integer(float value) { - var instance = getInstance(); - instance.put("enum_query_integer", value); - return getBuilderAfterEnumQueryInteger(instance); - } - - default T enum_query_integer(Schema4.IntegerSchemaEnums4 value) { - var instance = getInstance(); - instance.put("enum_query_integer", value.value()); - return getBuilderAfterEnumQueryInteger(instance); - } - - default T enum_query_integer(Schema4.LongSchemaEnums4 value) { - var instance = getInstance(); - instance.put("enum_query_integer", value.value()); - return getBuilderAfterEnumQueryInteger(instance); - } - - default T enum_query_integer(Schema4.FloatSchemaEnums4 value) { - var instance = getInstance(); - instance.put("enum_query_integer", value.value()); - return getBuilderAfterEnumQueryInteger(instance); - } - - default T enum_query_integer(Schema4.DoubleSchemaEnums4 value) { - var instance = getInstance(); - instance.put("enum_query_integer", value.value()); - return getBuilderAfterEnumQueryInteger(instance); - } - } - - public interface SetterForEnumQueryStringArray { - Map getInstance(); - T getBuilderAfterEnumQueryStringArray(Map instance); - - default T enum_query_string_array(List value) { - var instance = getInstance(); - instance.put("enum_query_string_array", value); - return getBuilderAfterEnumQueryStringArray(instance); - } - } - - public static class QueryParametersMapBuilder implements GenericBuilder>, SetterForEnumQueryDouble, SetterForEnumQueryString, SetterForEnumQueryInteger, SetterForEnumQueryStringArray { - private final Map instance; - private static final Set knownKeys = Set.of( - "enum_query_double", - "enum_query_string", - "enum_query_integer", - "enum_query_string_array" - ); - public Set getKnownKeys() { - return knownKeys; - } - public QueryParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map build() { - return instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMapBuilder getBuilderAfterEnumQueryDouble(Map instance) { - return this; - } - public QueryParametersMapBuilder getBuilderAfterEnumQueryString(Map instance) { - return this; - } - public QueryParametersMapBuilder getBuilderAfterEnumQueryInteger(Map instance) { - return this; - } - public QueryParametersMapBuilder getBuilderAfterEnumQueryStringArray(Map instance) { - return this; - } - } - - - public sealed interface QueryParameters1Boxed permits QueryParameters1BoxedMap { - @Nullable Object getData(); - } - - public record QueryParameters1BoxedMap(QueryParametersMap data) implements QueryParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable QueryParameters1 instance = null; - - protected QueryParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("enum_query_double", Schema5.Schema51.class), - new PropertyEntry("enum_query_string", Schema3.Schema31.class), - new PropertyEntry("enum_query_integer", Schema4.Schema41.class), - new PropertyEntry("enum_query_string_array", Schema2.Schema21.class) - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static QueryParameters1 getInstance() { - if (instance == null) { - instance = new QueryParameters1(); - } - return instance; - } - - public QueryParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, propertyInstance); - } - FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); - return new QueryParametersMap(castProperties); - } - - public QueryParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public QueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new QueryParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public QueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/RequestBody.java deleted file mode 100644 index 3f8f13a779a..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/RequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.fake.get; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fake.get.requestbody.content.applicationxwwwformurlencoded.ApplicationxwwwformurlencodedSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits ApplicationxwwwformurlencodedMediaType {} - - public record ApplicationxwwwformurlencodedMediaType(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationxwwwformurlencodedMediaType() { - this(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/x-www-form-urlencoded", new ApplicationxwwwformurlencodedMediaType()) - ), - false - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - ApplicationxwwwformurlencodedRequestBody requestBody0 = (ApplicationxwwwformurlencodedRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } - } - - public sealed interface SealedRequestBody permits ApplicationxwwwformurlencodedRequestBody {} - public record ApplicationxwwwformurlencodedRequestBody(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "application/x-www-form-urlencoded"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/Responses.java deleted file mode 100644 index 6027d75594f..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/Responses.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.openapijsonschematools.client.paths.fake.get; - -import org.openapijsonschematools.client.paths.fake.get.responses.Code200Response; -import org.openapijsonschematools.client.paths.fake.get.responses.Code404Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer, StatusCode404ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - public static final class StatusCode404ResponseDeserializer extends Code404Response.Code404Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()), - new AbstractMap.SimpleEntry<>("404", new StatusCode404ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - if (statusCodeDeserializer instanceof StatusCode200ResponseDeserializer castDeserializer) { - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } else { - StatusCode404ResponseDeserializer castDeserializer = (StatusCode404ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - throw new Code404Response.ResponseApiException( - "Received error statusCode response from server", - response, - deserializedResponse - ); - } - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/Code200Response.java deleted file mode 100644 index 4c45da77e38..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/Code200Response.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.openapijsonschematools.client.paths.fake.get.responses; - -import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; - -public class Code200Response extends SuccessDescriptionOnly { - public static class Code200Response1 extends SuccessDescriptionOnly1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/Code404Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/Code404Response.java deleted file mode 100644 index 34af3ea2174..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/Code404Response.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fake.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fake.get.responses.code404response.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code404Response { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.MapJsonSchema1Boxed body) implements SealedResponseBody { } - - public static class Code404Response1 extends ResponseDeserializer { - public Code404Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/FakeGetCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/FakeGetCode200Response.java new file mode 100644 index 00000000000..5787a626bfc --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/FakeGetCode200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.fake.get.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class FakeGetCode200Response extends SuccessDescriptionOnly { + public static class FakeGetCode200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/FakeGetCode404Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/FakeGetCode404Response.java new file mode 100644 index 00000000000..7ed1e9138ab --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/get/responses/FakeGetCode404Response.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fake.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fake.get.responses.code404response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakeGetCode404Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.MapJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class FakeGetCode404Response1 extends ResponseDeserializer { + public FakeGetCode404Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/patch/FakePatchRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/patch/FakePatchRequestBody.java new file mode 100644 index 00000000000..0285e5cfd63 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/patch/FakePatchRequestBody.java @@ -0,0 +1,11 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.fake.patch; + +import org.openapijsonschematools.client.components.requestbodies.Client; + +public class FakePatchRequestBody extends Client { + public static class FakePatchRequestBody1 extends Client1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/patch/FakePatchResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/patch/FakePatchResponses.java new file mode 100644 index 00000000000..bdd4f5eaf64 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/patch/FakePatchResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fake.patch; + +import org.openapijsonschematools.client.paths.fake.patch.responses.FakePatchCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakePatchResponses { + public sealed interface EndpointResponse permits EndpointFakePatchCode200Response {} + + public record EndpointFakePatchCode200Response( + HttpResponse response, + FakePatchCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakePatchCode200ResponseDeserializer {} + + public static final class StatusFakePatchCode200ResponseDeserializer extends FakePatchCode200Response.FakePatchCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakePatchResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakePatchResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakePatchCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakePatchCode200ResponseDeserializer castDeserializer = (StatusFakePatchCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakePatchCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/patch/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/patch/RequestBody.java deleted file mode 100644 index cc756bafb50..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/patch/RequestBody.java +++ /dev/null @@ -1,11 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.fake.patch; - -import org.openapijsonschematools.client.components.requestbodies.Client; - -public class RequestBody extends Client { - public static class RequestBody1 extends Client1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/patch/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/patch/Responses.java deleted file mode 100644 index 5ea188b2480..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/patch/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fake.patch; - -import org.openapijsonschematools.client.paths.fake.patch.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/patch/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/patch/responses/Code200Response.java deleted file mode 100644 index 9e368e1e05c..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/patch/responses/Code200Response.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fake.patch.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fake.patch.responses.code200response.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.Client1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/patch/responses/FakePatchCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/patch/responses/FakePatchCode200Response.java new file mode 100644 index 00000000000..8e41f415025 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/patch/responses/FakePatchCode200Response.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fake.patch.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fake.patch.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakePatchCode200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.Client1Boxed body) implements SealedResponseBody { } + + public static class FakePatchCode200Response1 extends ResponseDeserializer { + public FakePatchCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/FakePostRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/FakePostRequestBody.java new file mode 100644 index 00000000000..3d6d88d95e9 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/FakePostRequestBody.java @@ -0,0 +1,53 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.fake.post; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fake.post.requestbody.content.applicationxwwwformurlencoded.ApplicationxwwwformurlencodedSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class FakePostRequestBody { + public sealed interface SealedMediaType permits ApplicationxwwwformurlencodedMediaType {} + + public record ApplicationxwwwformurlencodedMediaType(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationxwwwformurlencodedMediaType() { + this(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class FakePostRequestBody1 extends RequestBodySerializer { + public FakePostRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/x-www-form-urlencoded", new ApplicationxwwwformurlencodedMediaType()) + ), + false + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + ApplicationxwwwformurlencodedRequestBody requestBody0 = (ApplicationxwwwformurlencodedRequestBody) requestBody; + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } + } + + public sealed interface SealedRequestBody permits ApplicationxwwwformurlencodedRequestBody {} + public record ApplicationxwwwformurlencodedRequestBody(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "application/x-www-form-urlencoded"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/FakePostResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/FakePostResponses.java new file mode 100644 index 00000000000..407615511d5 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/FakePostResponses.java @@ -0,0 +1,66 @@ +package org.openapijsonschematools.client.paths.fake.post; + +import org.openapijsonschematools.client.paths.fake.post.responses.FakePostCode200Response; +import org.openapijsonschematools.client.paths.fake.post.responses.FakePostCode404Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakePostResponses { + public sealed interface EndpointResponse permits EndpointFakePostCode200Response {} + + public record EndpointFakePostCode200Response( + HttpResponse response, + Void body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakePostCode200ResponseDeserializer, StatusFakePostCode404ResponseDeserializer {} + + public static final class StatusFakePostCode200ResponseDeserializer extends FakePostCode200Response.FakePostCode200Response1 implements StatusCodeResponseDeserializer { + } + public static final class StatusFakePostCode404ResponseDeserializer extends FakePostCode404Response.FakePostCode404Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakePostResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakePostResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakePostCode200ResponseDeserializer()), + new AbstractMap.SimpleEntry<>("404", new StatusFakePostCode404ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + if (statusCodeDeserializer instanceof StatusFakePostCode200ResponseDeserializer castDeserializer) { + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakePostCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } else { + StatusFakePostCode404ResponseDeserializer castDeserializer = (StatusFakePostCode404ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + throw new FakePostCode404Response.ResponseApiException( + "Received error statusCode response from server", + response, + deserializedResponse + ); + } + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/RequestBody.java deleted file mode 100644 index f1df9eb31ed..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/RequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.fake.post; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fake.post.requestbody.content.applicationxwwwformurlencoded.ApplicationxwwwformurlencodedSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits ApplicationxwwwformurlencodedMediaType {} - - public record ApplicationxwwwformurlencodedMediaType(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationxwwwformurlencodedMediaType() { - this(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/x-www-form-urlencoded", new ApplicationxwwwformurlencodedMediaType()) - ), - false - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - ApplicationxwwwformurlencodedRequestBody requestBody0 = (ApplicationxwwwformurlencodedRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } - } - - public sealed interface SealedRequestBody permits ApplicationxwwwformurlencodedRequestBody {} - public record ApplicationxwwwformurlencodedRequestBody(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "application/x-www-form-urlencoded"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/Responses.java deleted file mode 100644 index 7a2562b0a60..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/Responses.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.openapijsonschematools.client.paths.fake.post; - -import org.openapijsonschematools.client.paths.fake.post.responses.Code200Response; -import org.openapijsonschematools.client.paths.fake.post.responses.Code404Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer, StatusCode404ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - public static final class StatusCode404ResponseDeserializer extends Code404Response.Code404Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()), - new AbstractMap.SimpleEntry<>("404", new StatusCode404ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - if (statusCodeDeserializer instanceof StatusCode200ResponseDeserializer castDeserializer) { - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } else { - StatusCode404ResponseDeserializer castDeserializer = (StatusCode404ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - throw new Code404Response.ResponseApiException( - "Received error statusCode response from server", - response, - deserializedResponse - ); - } - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/responses/Code200Response.java deleted file mode 100644 index e04e39b1f73..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/responses/Code200Response.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.openapijsonschematools.client.paths.fake.post.responses; - -import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; - -public class Code200Response extends SuccessDescriptionOnly { - public static class Code200Response1 extends SuccessDescriptionOnly1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/responses/Code404Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/responses/Code404Response.java deleted file mode 100644 index 4e6abc094e0..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/responses/Code404Response.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapijsonschematools.client.paths.fake.post.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; - -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code404Response { - - public static class Code404Response1 extends ResponseDeserializer { - public Code404Response1() { - super( - MapUtils.makeMap( - ) - ); - } - - @Override - protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { - return null; - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/responses/FakePostCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/responses/FakePostCode200Response.java new file mode 100644 index 00000000000..1806211707c --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/responses/FakePostCode200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.fake.post.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class FakePostCode200Response extends SuccessDescriptionOnly { + public static class FakePostCode200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/responses/FakePostCode404Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/responses/FakePostCode404Response.java new file mode 100644 index 00000000000..7da6740e34e --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fake/post/responses/FakePostCode404Response.java @@ -0,0 +1,45 @@ +package org.openapijsonschematools.client.paths.fake.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakePostCode404Response { + + public static class FakePostCode404Response1 extends ResponseDeserializer { + public FakePostCode404Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/FakeadditionalpropertieswitharrayofenumsGet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/FakeadditionalpropertieswitharrayofenumsGet.java new file mode 100644 index 00000000000..7cf5a80ec37 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/FakeadditionalpropertieswitharrayofenumsGet.java @@ -0,0 +1,152 @@ +package org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get.FakeadditionalpropertieswitharrayofenumsGetRequestBody; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get.FakeadditionalpropertieswitharrayofenumsGetResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Fakeadditionalpropertieswitharrayofenums; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakeadditionalpropertieswitharrayofenumsGet { + private static class GetProvider { + private static final String method = "get"; + + public static FakeadditionalpropertieswitharrayofenumsGetResponses.EndpointResponse get( + GetRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + @Nullable SerializedRequestBody serializedRequestBody; + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + if (request.requestBody != null) { + serializedRequestBody = new FakeadditionalpropertieswitharrayofenumsGetRequestBody.FakeadditionalpropertieswitharrayofenumsGetRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + bodyPublisher = serializedRequestBody.bodyPublisher; + } + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakeadditionalpropertieswitharrayofenums.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakeadditionalpropertieswitharrayofenumsGetResponses.FakeadditionalpropertieswitharrayofenumsGetResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface GetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakeadditionalpropertieswitharrayofenumsGetResponses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface AdditionalPropertiesWithArrayOfEnumsOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakeadditionalpropertieswitharrayofenumsGetResponses.EndpointResponse additionalPropertiesWithArrayOfEnums(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Get extends ApiClient implements GetOperation { + public Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class GetRequest { + public FakeadditionalpropertieswitharrayofenumsGetRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForRequestBody { + GetRequest getInstance(); + T getBuilderAfterRequestBody(GetRequest instance); + default T requestBody(FakeadditionalpropertieswitharrayofenumsGetRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public interface SetterForServerIndex { + GetRequest getInstance(); + T getBuilderAfterServerIndex(GetRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + GetRequest getInstance(); + T getBuilderAfterTimeout(GetRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class GetRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { + private final GetRequest instance; + + public GetRequestBuilder() { + this.instance = new GetRequest(); + } + + public GetRequest build() { + return instance; + } + + public GetRequest getInstance() { + return instance; + } + + public GetRequestBuilder getBuilderAfterRequestBody(GetRequest instance) { + return this; + } + + public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { + return this; + } + + public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/Get.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/Get.java deleted file mode 100644 index 07c73d4f887..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/Get.java +++ /dev/null @@ -1,143 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get.RequestBody; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Fakeadditionalpropertieswitharrayofenums; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Get { - private static class GetProvider { - private static final String method = "get"; - - public static Responses.EndpointResponse get( - GetRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - @Nullable SerializedRequestBody serializedRequestBody; - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - if (request.requestBody != null) { - serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - bodyPublisher = serializedRequestBody.bodyPublisher; - } - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakeadditionalpropertieswitharrayofenums.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface GetOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Get1 extends ApiClient implements GetOperation { - public Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class GetRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForRequestBody { - GetRequest getInstance(); - T getBuilderAfterRequestBody(GetRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public interface SetterForServerIndex { - GetRequest getInstance(); - T getBuilderAfterServerIndex(GetRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - GetRequest getInstance(); - T getBuilderAfterTimeout(GetRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class GetRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { - private final GetRequest instance; - - public GetRequestBuilder() { - this.instance = new GetRequest(); - } - - public GetRequest build() { - return instance; - } - - public GetRequest getInstance() { - return instance; - } - - public GetRequestBuilder getBuilderAfterRequestBody(GetRequest instance) { - return this; - } - - public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { - return this; - } - - public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/FakeadditionalpropertieswitharrayofenumsGetRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/FakeadditionalpropertieswitharrayofenumsGetRequestBody.java new file mode 100644 index 00000000000..b83e5c5b7af --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/FakeadditionalpropertieswitharrayofenumsGetRequestBody.java @@ -0,0 +1,53 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get.requestbody.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class FakeadditionalpropertieswitharrayofenumsGetRequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class FakeadditionalpropertieswitharrayofenumsGetRequestBody1 extends RequestBodySerializer { + public FakeadditionalpropertieswitharrayofenumsGetRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ), + false + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } + } + + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.AdditionalPropertiesWithArrayOfEnums1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "application/json"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/FakeadditionalpropertieswitharrayofenumsGetResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/FakeadditionalpropertieswitharrayofenumsGetResponses.java new file mode 100644 index 00000000000..072cf25c108 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/FakeadditionalpropertieswitharrayofenumsGetResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get; + +import org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get.responses.FakeadditionalpropertieswitharrayofenumsGetCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakeadditionalpropertieswitharrayofenumsGetResponses { + public sealed interface EndpointResponse permits EndpointFakeadditionalpropertieswitharrayofenumsGetCode200Response {} + + public record EndpointFakeadditionalpropertieswitharrayofenumsGetCode200Response( + HttpResponse response, + FakeadditionalpropertieswitharrayofenumsGetCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakeadditionalpropertieswitharrayofenumsGetCode200ResponseDeserializer {} + + public static final class StatusFakeadditionalpropertieswitharrayofenumsGetCode200ResponseDeserializer extends FakeadditionalpropertieswitharrayofenumsGetCode200Response.FakeadditionalpropertieswitharrayofenumsGetCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakeadditionalpropertieswitharrayofenumsGetResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakeadditionalpropertieswitharrayofenumsGetResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakeadditionalpropertieswitharrayofenumsGetCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakeadditionalpropertieswitharrayofenumsGetCode200ResponseDeserializer castDeserializer = (StatusFakeadditionalpropertieswitharrayofenumsGetCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakeadditionalpropertieswitharrayofenumsGetCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/RequestBody.java deleted file mode 100644 index b58e901cf8c..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/RequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get.requestbody.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ), - false - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } - } - - public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} - public record ApplicationjsonRequestBody(ApplicationjsonSchema.AdditionalPropertiesWithArrayOfEnums1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "application/json"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/Responses.java deleted file mode 100644 index be8ef287de3..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get; - -import org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/responses/Code200Response.java deleted file mode 100644 index 0a17d85055f..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/responses/Code200Response.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.AdditionalPropertiesWithArrayOfEnums1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/responses/FakeadditionalpropertieswitharrayofenumsGetCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/responses/FakeadditionalpropertieswitharrayofenumsGetCode200Response.java new file mode 100644 index 00000000000..1e32b3e20ca --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeadditionalpropertieswitharrayofenums/get/responses/FakeadditionalpropertieswitharrayofenumsGetCode200Response.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakeadditionalpropertieswitharrayofenums.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakeadditionalpropertieswitharrayofenumsGetCode200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.AdditionalPropertiesWithArrayOfEnums1Boxed body) implements SealedResponseBody { } + + public static class FakeadditionalpropertieswitharrayofenumsGetCode200Response1 extends ResponseDeserializer { + public FakeadditionalpropertieswitharrayofenumsGetCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/FakebodywithfileschemaPut.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/FakebodywithfileschemaPut.java new file mode 100644 index 00000000000..7c9a7ce3ef7 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/FakebodywithfileschemaPut.java @@ -0,0 +1,183 @@ +package org.openapijsonschematools.client.paths.fakebodywithfileschema; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakebodywithfileschema.put.FakebodywithfileschemaPutRequestBody; +import org.openapijsonschematools.client.paths.fakebodywithfileschema.put.FakebodywithfileschemaPutResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Fakebodywithfileschema; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakebodywithfileschemaPut { + private static class PutProvider { + private static final String method = "put"; + + public static FakebodywithfileschemaPutResponses.EndpointResponse put( + PutRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + SerializedRequestBody serializedRequestBody = new FakebodywithfileschemaPutRequestBody.FakebodywithfileschemaPutRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakebodywithfileschema.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakebodywithfileschemaPutResponses.FakebodywithfileschemaPutResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PutOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakebodywithfileschemaPutResponses.EndpointResponse put(PutRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PutProvider.put(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface BodyWithFileSchemaOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakebodywithfileschemaPutResponses.EndpointResponse bodyWithFileSchema(PutRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PutProvider.put(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Put extends ApiClient implements PutOperation { + public Put(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PutRequest { + public FakebodywithfileschemaPutRequestBody.SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + + public PutRequest( + FakebodywithfileschemaPutRequestBody.SealedRequestBody requestBody, + RootServerInfo.@Nullable ServerIndex serverIndex, + @Nullable Duration timeout + ) { + this.requestBody = requestBody; + this.serverIndex = serverIndex; + this.timeout = timeout; + } + } + + public static class PutNullableRequest { + public FakebodywithfileschemaPutRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + PutNullableRequest getInstance(); + T getBuilderAfterServerIndex(PutNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PutNullableRequest getInstance(); + T getBuilderAfterTimeout(PutNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForRequestBody { + PutNullableRequest getInstance(); + T getBuilderAfterRequestBody(PutNullableRequest instance); + default T requestBody(FakebodywithfileschemaPutRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public static class Put0RequestBuilder implements SetterForServerIndex, SetterForTimeout { + private final PutNullableRequest instance; + + public Put0RequestBuilder(PutNullableRequest instance) { + this.instance = instance; + } + + public PutRequest build() { + var requestBody = instance.requestBody; + if (requestBody == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new PutRequest( + requestBody, + instance.serverIndex, + instance.timeout + ); + } + + public PutNullableRequest getInstance() { + return instance; + } + + public Put0RequestBuilder getBuilderAfterServerIndex(PutNullableRequest instance) { + return this; + } + + public Put0RequestBuilder getBuilderAfterTimeout(PutNullableRequest instance) { + return this; + } + } + public static class PutRequestBuilder implements SetterForRequestBody { + private final PutNullableRequest instance; + + public PutRequestBuilder() { + this.instance = new PutNullableRequest(); + } + + public PutNullableRequest getInstance() { + return instance; + } + + public Put0RequestBuilder getBuilderAfterRequestBody(PutNullableRequest instance) { + return new Put0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/Put.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/Put.java deleted file mode 100644 index ddc35d6146a..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/Put.java +++ /dev/null @@ -1,174 +0,0 @@ -package org.openapijsonschematools.client.paths.fakebodywithfileschema; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakebodywithfileschema.put.RequestBody; -import org.openapijsonschematools.client.paths.fakebodywithfileschema.put.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Fakebodywithfileschema; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Put { - private static class PutProvider { - private static final String method = "put"; - - public static Responses.EndpointResponse put( - PutRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - SerializedRequestBody serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakebodywithfileschema.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PutOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse put(PutRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PutProvider.put(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Put1 extends ApiClient implements PutOperation { - public Put1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PutRequest { - public RequestBody.SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - - public PutRequest( - RequestBody.SealedRequestBody requestBody, - RootServerInfo.@Nullable ServerIndex serverIndex, - @Nullable Duration timeout - ) { - this.requestBody = requestBody; - this.serverIndex = serverIndex; - this.timeout = timeout; - } - } - - public static class PutNullableRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - PutNullableRequest getInstance(); - T getBuilderAfterServerIndex(PutNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PutNullableRequest getInstance(); - T getBuilderAfterTimeout(PutNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForRequestBody { - PutNullableRequest getInstance(); - T getBuilderAfterRequestBody(PutNullableRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public static class Put0RequestBuilder implements SetterForServerIndex, SetterForTimeout { - private final PutNullableRequest instance; - - public Put0RequestBuilder(PutNullableRequest instance) { - this.instance = instance; - } - - public PutRequest build() { - var requestBody = instance.requestBody; - if (requestBody == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new PutRequest( - requestBody, - instance.serverIndex, - instance.timeout - ); - } - - public PutNullableRequest getInstance() { - return instance; - } - - public Put0RequestBuilder getBuilderAfterServerIndex(PutNullableRequest instance) { - return this; - } - - public Put0RequestBuilder getBuilderAfterTimeout(PutNullableRequest instance) { - return this; - } - } - public static class PutRequestBuilder implements SetterForRequestBody { - private final PutNullableRequest instance; - - public PutRequestBuilder() { - this.instance = new PutNullableRequest(); - } - - public PutNullableRequest getInstance() { - return instance; - } - - public Put0RequestBuilder getBuilderAfterRequestBody(PutNullableRequest instance) { - return new Put0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/FakebodywithfileschemaPutRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/FakebodywithfileschemaPutRequestBody.java new file mode 100644 index 00000000000..6a9b15e21f4 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/FakebodywithfileschemaPutRequestBody.java @@ -0,0 +1,53 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.fakebodywithfileschema.put; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakebodywithfileschema.put.requestbody.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class FakebodywithfileschemaPutRequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class FakebodywithfileschemaPutRequestBody1 extends RequestBodySerializer { + public FakebodywithfileschemaPutRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ), + true + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } + } + + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.FileSchemaTestClass1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "application/json"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/FakebodywithfileschemaPutResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/FakebodywithfileschemaPutResponses.java new file mode 100644 index 00000000000..afcdcd2bd1a --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/FakebodywithfileschemaPutResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakebodywithfileschema.put; + +import org.openapijsonschematools.client.paths.fakebodywithfileschema.put.responses.FakebodywithfileschemaPutCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakebodywithfileschemaPutResponses { + public sealed interface EndpointResponse permits EndpointFakebodywithfileschemaPutCode200Response {} + + public record EndpointFakebodywithfileschemaPutCode200Response( + HttpResponse response, + Void body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakebodywithfileschemaPutCode200ResponseDeserializer {} + + public static final class StatusFakebodywithfileschemaPutCode200ResponseDeserializer extends FakebodywithfileschemaPutCode200Response.FakebodywithfileschemaPutCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakebodywithfileschemaPutResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakebodywithfileschemaPutResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakebodywithfileschemaPutCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakebodywithfileschemaPutCode200ResponseDeserializer castDeserializer = (StatusFakebodywithfileschemaPutCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakebodywithfileschemaPutCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/RequestBody.java deleted file mode 100644 index a46287e74b1..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/RequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.fakebodywithfileschema.put; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakebodywithfileschema.put.requestbody.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ), - true - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } - } - - public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} - public record ApplicationjsonRequestBody(ApplicationjsonSchema.FileSchemaTestClass1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "application/json"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/Responses.java deleted file mode 100644 index 0beb85a7c98..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakebodywithfileschema.put; - -import org.openapijsonschematools.client.paths.fakebodywithfileschema.put.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/responses/Code200Response.java deleted file mode 100644 index 71a49134261..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/responses/Code200Response.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.openapijsonschematools.client.paths.fakebodywithfileschema.put.responses; - -import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; - -public class Code200Response extends SuccessDescriptionOnly { - public static class Code200Response1 extends SuccessDescriptionOnly1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/responses/FakebodywithfileschemaPutCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/responses/FakebodywithfileschemaPutCode200Response.java new file mode 100644 index 00000000000..83a4cc26665 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithfileschema/put/responses/FakebodywithfileschemaPutCode200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.fakebodywithfileschema.put.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class FakebodywithfileschemaPutCode200Response extends SuccessDescriptionOnly { + public static class FakebodywithfileschemaPutCode200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/FakebodywithqueryparamsPut.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/FakebodywithqueryparamsPut.java new file mode 100644 index 00000000000..5be02fcd272 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/FakebodywithqueryparamsPut.java @@ -0,0 +1,242 @@ +package org.openapijsonschematools.client.paths.fakebodywithqueryparams; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.FakebodywithqueryparamsPutRequestBody; +import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.FakebodywithqueryparamsPutQueryParameters; +import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.Parameters; +import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.FakebodywithqueryparamsPutResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Fakebodywithqueryparams; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakebodywithqueryparamsPut { + private static class PutProvider { + private static final String method = "put"; + + public static FakebodywithqueryparamsPutResponses.EndpointResponse put( + PutRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + SerializedRequestBody serializedRequestBody = new FakebodywithqueryparamsPutRequestBody.FakebodywithqueryparamsPutRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; + + var querySerializer = new Parameters.QueryParametersSerializer(); + @Nullable Map queryMap = querySerializer.getQueryMap(request.queryParameters); + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakebodywithqueryparams.path; + if (queryMap != null) { + url = url + querySerializer.serialize(queryMap); + } + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakebodywithqueryparamsPutResponses.FakebodywithqueryparamsPutResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PutOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakebodywithqueryparamsPutResponses.EndpointResponse put(PutRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PutProvider.put(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface BodyWithQueryParamsOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakebodywithqueryparamsPutResponses.EndpointResponse bodyWithQueryParams(PutRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PutProvider.put(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Put extends ApiClient implements PutOperation { + public Put(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PutRequest { + public FakebodywithqueryparamsPutRequestBody.SealedRequestBody requestBody; + public FakebodywithqueryparamsPutQueryParameters.FakebodywithqueryparamsPutQueryParametersMap queryParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + + public PutRequest( + FakebodywithqueryparamsPutRequestBody.SealedRequestBody requestBody, + FakebodywithqueryparamsPutQueryParameters.FakebodywithqueryparamsPutQueryParametersMap queryParameters, + RootServerInfo.@Nullable ServerIndex serverIndex, + @Nullable Duration timeout + ) { + this.requestBody = requestBody; + this.queryParameters = queryParameters; + this.serverIndex = serverIndex; + this.timeout = timeout; + } + } + + public static class PutNullableRequest { + public FakebodywithqueryparamsPutRequestBody.@Nullable SealedRequestBody requestBody; + public FakebodywithqueryparamsPutQueryParameters.@Nullable FakebodywithqueryparamsPutQueryParametersMap queryParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + PutNullableRequest getInstance(); + T getBuilderAfterServerIndex(PutNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PutNullableRequest getInstance(); + T getBuilderAfterTimeout(PutNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForRequestBody { + PutNullableRequest getInstance(); + T getBuilderAfterRequestBody(PutNullableRequest instance); + default T requestBody(FakebodywithqueryparamsPutRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public interface SetterForQueryParameters { + PutNullableRequest getInstance(); + T getBuilderAfterQueryParameters(PutNullableRequest instance); + default T queryParameters(FakebodywithqueryparamsPutQueryParameters.FakebodywithqueryparamsPutQueryParametersMap queryParameters) { + var instance = getInstance(); + instance.queryParameters = queryParameters; + return getBuilderAfterQueryParameters(instance); + } + } + + public static class Put00RequestBuilder implements SetterForServerIndex, SetterForTimeout { + private final PutNullableRequest instance; + + public Put00RequestBuilder(PutNullableRequest instance) { + this.instance = instance; + } + + public PutRequest build() { + var requestBody = instance.requestBody; + if (requestBody == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + var queryParameters = instance.queryParameters; + if (queryParameters == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new PutRequest( + requestBody, + queryParameters, + instance.serverIndex, + instance.timeout + ); + } + + public PutNullableRequest getInstance() { + return instance; + } + + public Put00RequestBuilder getBuilderAfterServerIndex(PutNullableRequest instance) { + return this; + } + + public Put00RequestBuilder getBuilderAfterTimeout(PutNullableRequest instance) { + return this; + } + } + public static class Put01RequestBuilder implements SetterForQueryParameters { + private final PutNullableRequest instance; + + public Put01RequestBuilder(PutNullableRequest instance) { + this.instance = instance; + } + + public PutNullableRequest getInstance() { + return instance; + } + + public Put00RequestBuilder getBuilderAfterQueryParameters(PutNullableRequest instance) { + return new Put00RequestBuilder(instance); + } + } + public static class Put10RequestBuilder implements SetterForRequestBody { + private final PutNullableRequest instance; + + public Put10RequestBuilder(PutNullableRequest instance) { + this.instance = instance; + } + + public PutNullableRequest getInstance() { + return instance; + } + + public Put00RequestBuilder getBuilderAfterRequestBody(PutNullableRequest instance) { + return new Put00RequestBuilder(instance); + } + } + public static class PutRequestBuilder implements SetterForRequestBody, SetterForQueryParameters { + private final PutNullableRequest instance; + + public PutRequestBuilder() { + this.instance = new PutNullableRequest(); + } + + public PutNullableRequest getInstance() { + return instance; + } + + public Put01RequestBuilder getBuilderAfterRequestBody(PutNullableRequest instance) { + return new Put01RequestBuilder(instance); + } + + public Put10RequestBuilder getBuilderAfterQueryParameters(PutNullableRequest instance) { + return new Put10RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/Put.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/Put.java deleted file mode 100644 index ba8cd1a869b..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/Put.java +++ /dev/null @@ -1,233 +0,0 @@ -package org.openapijsonschematools.client.paths.fakebodywithqueryparams; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.RequestBody; -import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.QueryParameters; -import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.Parameters; -import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Fakebodywithqueryparams; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Put { - private static class PutProvider { - private static final String method = "put"; - - public static Responses.EndpointResponse put( - PutRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - SerializedRequestBody serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; - - var querySerializer = new Parameters.QueryParametersSerializer(); - @Nullable Map queryMap = querySerializer.getQueryMap(request.queryParameters); - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakebodywithqueryparams.path; - if (queryMap != null) { - url = url + querySerializer.serialize(queryMap); - } - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PutOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse put(PutRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PutProvider.put(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Put1 extends ApiClient implements PutOperation { - public Put1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PutRequest { - public RequestBody.SealedRequestBody requestBody; - public QueryParameters.QueryParametersMap queryParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - - public PutRequest( - RequestBody.SealedRequestBody requestBody, - QueryParameters.QueryParametersMap queryParameters, - RootServerInfo.@Nullable ServerIndex serverIndex, - @Nullable Duration timeout - ) { - this.requestBody = requestBody; - this.queryParameters = queryParameters; - this.serverIndex = serverIndex; - this.timeout = timeout; - } - } - - public static class PutNullableRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public QueryParameters.@Nullable QueryParametersMap queryParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - PutNullableRequest getInstance(); - T getBuilderAfterServerIndex(PutNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PutNullableRequest getInstance(); - T getBuilderAfterTimeout(PutNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForRequestBody { - PutNullableRequest getInstance(); - T getBuilderAfterRequestBody(PutNullableRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public interface SetterForQueryParameters { - PutNullableRequest getInstance(); - T getBuilderAfterQueryParameters(PutNullableRequest instance); - default T queryParameters(QueryParameters.QueryParametersMap queryParameters) { - var instance = getInstance(); - instance.queryParameters = queryParameters; - return getBuilderAfterQueryParameters(instance); - } - } - - public static class Put00RequestBuilder implements SetterForServerIndex, SetterForTimeout { - private final PutNullableRequest instance; - - public Put00RequestBuilder(PutNullableRequest instance) { - this.instance = instance; - } - - public PutRequest build() { - var requestBody = instance.requestBody; - if (requestBody == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - var queryParameters = instance.queryParameters; - if (queryParameters == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new PutRequest( - requestBody, - queryParameters, - instance.serverIndex, - instance.timeout - ); - } - - public PutNullableRequest getInstance() { - return instance; - } - - public Put00RequestBuilder getBuilderAfterServerIndex(PutNullableRequest instance) { - return this; - } - - public Put00RequestBuilder getBuilderAfterTimeout(PutNullableRequest instance) { - return this; - } - } - public static class Put01RequestBuilder implements SetterForQueryParameters { - private final PutNullableRequest instance; - - public Put01RequestBuilder(PutNullableRequest instance) { - this.instance = instance; - } - - public PutNullableRequest getInstance() { - return instance; - } - - public Put00RequestBuilder getBuilderAfterQueryParameters(PutNullableRequest instance) { - return new Put00RequestBuilder(instance); - } - } - public static class Put10RequestBuilder implements SetterForRequestBody { - private final PutNullableRequest instance; - - public Put10RequestBuilder(PutNullableRequest instance) { - this.instance = instance; - } - - public PutNullableRequest getInstance() { - return instance; - } - - public Put00RequestBuilder getBuilderAfterRequestBody(PutNullableRequest instance) { - return new Put00RequestBuilder(instance); - } - } - public static class PutRequestBuilder implements SetterForRequestBody, SetterForQueryParameters { - private final PutNullableRequest instance; - - public PutRequestBuilder() { - this.instance = new PutNullableRequest(); - } - - public PutNullableRequest getInstance() { - return instance; - } - - public Put01RequestBuilder getBuilderAfterRequestBody(PutNullableRequest instance) { - return new Put01RequestBuilder(instance); - } - - public Put10RequestBuilder getBuilderAfterQueryParameters(PutNullableRequest instance) { - return new Put10RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutQueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutQueryParameters.java new file mode 100644 index 00000000000..3b8284fac87 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutQueryParameters.java @@ -0,0 +1,205 @@ +package org.openapijsonschematools.client.paths.fakebodywithqueryparams.put; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.parameters.parameter0.Schema0; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class FakebodywithqueryparamsPutQueryParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class FakebodywithqueryparamsPutadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable FakebodywithqueryparamsPutadditionalProperties instance = null; + public static FakebodywithqueryparamsPutadditionalProperties getInstance() { + if (instance == null) { + instance = new FakebodywithqueryparamsPutadditionalProperties(); + } + return instance; + } + } + + + public static class FakebodywithqueryparamsPutQueryParametersMap extends FrozenMap { + protected FakebodywithqueryparamsPutQueryParametersMap(FrozenMap m) { + super(m); + } + public static final Set requiredKeys = Set.of( + "query" + ); + public static final Set optionalKeys = Set.of(); + public static FakebodywithqueryparamsPutQueryParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return FakebodywithqueryparamsPutQueryParameters1.getInstance().validate(arg, configuration); + } + + public String query() { + try { + return getOrThrow("version"); + } catch (UnsetPropertyException e) { + throw new RuntimeException(e); + } + } + } + + public interface SetterForFakebodywithqueryparamsPutquery { + Map getInstance(); + T getBuilderAfterFakebodywithqueryparamsPutquery(Map instance); + + default T query(String value) { + var instance = getInstance(); + instance.put("query", value); + return getBuilderAfterFakebodywithqueryparamsPutquery(instance); + } + } + + public static class FakebodywithqueryparamsPutQueryParametersMap0Builder implements GenericBuilder> { + private final Map instance; + private static final Set knownKeys = Set.of( + "query" + ); + public Set getKnownKeys() { + return knownKeys; + } + public FakebodywithqueryparamsPutQueryParametersMap0Builder(Map instance) { + this.instance = instance; + } + public Map build() { + return instance; + } + } + + public static class FakebodywithqueryparamsPutQueryParametersMapBuilder implements SetterForFakebodywithqueryparamsPutquery { + private final Map instance; + public FakebodywithqueryparamsPutQueryParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map getInstance() { + return instance; + } + public FakebodywithqueryparamsPutQueryParametersMap0Builder getBuilderAfterFakebodywithqueryparamsPutquery(Map instance) { + return new FakebodywithqueryparamsPutQueryParametersMap0Builder(instance); + } + } + + + public sealed interface FakebodywithqueryparamsPutQueryParameters1Boxed permits FakebodywithqueryparamsPutQueryParameters1BoxedMap { + @Nullable Object getData(); + } + + public record FakebodywithqueryparamsPutQueryParameters1BoxedMap(FakebodywithqueryparamsPutQueryParametersMap data) implements FakebodywithqueryparamsPutQueryParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class FakebodywithqueryparamsPutQueryParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable FakebodywithqueryparamsPutQueryParameters1 instance = null; + + protected FakebodywithqueryparamsPutQueryParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("query", Schema0.Schema01.class) + )) + .required(Set.of( + "query" + )) + .additionalProperties(FakebodywithqueryparamsPutadditionalProperties.class) + ); + } + + public static FakebodywithqueryparamsPutQueryParameters1 getInstance() { + if (instance == null) { + instance = new FakebodywithqueryparamsPutQueryParameters1(); + } + return instance; + } + + public FakebodywithqueryparamsPutQueryParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof String)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (String) propertyInstance); + } + FrozenMap castProperties = new FrozenMap<>(properties); + return new FakebodywithqueryparamsPutQueryParametersMap(castProperties); + } + + public FakebodywithqueryparamsPutQueryParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public FakebodywithqueryparamsPutQueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new FakebodywithqueryparamsPutQueryParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public FakebodywithqueryparamsPutQueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutRequestBody.java new file mode 100644 index 00000000000..06fe702b27b --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutRequestBody.java @@ -0,0 +1,53 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.fakebodywithqueryparams.put; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.requestbody.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class FakebodywithqueryparamsPutRequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class FakebodywithqueryparamsPutRequestBody1 extends RequestBodySerializer { + public FakebodywithqueryparamsPutRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ), + true + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } + } + + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.User1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "application/json"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutResponses.java new file mode 100644 index 00000000000..ad26d9ceb92 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/FakebodywithqueryparamsPutResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakebodywithqueryparams.put; + +import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.responses.FakebodywithqueryparamsPutCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakebodywithqueryparamsPutResponses { + public sealed interface EndpointResponse permits EndpointFakebodywithqueryparamsPutCode200Response {} + + public record EndpointFakebodywithqueryparamsPutCode200Response( + HttpResponse response, + Void body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakebodywithqueryparamsPutCode200ResponseDeserializer {} + + public static final class StatusFakebodywithqueryparamsPutCode200ResponseDeserializer extends FakebodywithqueryparamsPutCode200Response.FakebodywithqueryparamsPutCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakebodywithqueryparamsPutResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakebodywithqueryparamsPutResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakebodywithqueryparamsPutCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakebodywithqueryparamsPutCode200ResponseDeserializer castDeserializer = (StatusFakebodywithqueryparamsPutCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakebodywithqueryparamsPutCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/QueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/QueryParameters.java deleted file mode 100644 index 577273843e9..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/QueryParameters.java +++ /dev/null @@ -1,205 +0,0 @@ -package org.openapijsonschematools.client.paths.fakebodywithqueryparams.put; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.parameters.parameter0.Schema0; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class QueryParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class QueryParametersMap extends FrozenMap { - protected QueryParametersMap(FrozenMap m) { - super(m); - } - public static final Set requiredKeys = Set.of( - "query" - ); - public static final Set optionalKeys = Set.of(); - public static QueryParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return QueryParameters1.getInstance().validate(arg, configuration); - } - - public String query() { - try { - return getOrThrow("version"); - } catch (UnsetPropertyException e) { - throw new RuntimeException(e); - } - } - } - - public interface SetterForQuery { - Map getInstance(); - T getBuilderAfterQuery(Map instance); - - default T query(String value) { - var instance = getInstance(); - instance.put("query", value); - return getBuilderAfterQuery(instance); - } - } - - public static class QueryParametersMap0Builder implements GenericBuilder> { - private final Map instance; - private static final Set knownKeys = Set.of( - "query" - ); - public Set getKnownKeys() { - return knownKeys; - } - public QueryParametersMap0Builder(Map instance) { - this.instance = instance; - } - public Map build() { - return instance; - } - } - - public static class QueryParametersMapBuilder implements SetterForQuery { - private final Map instance; - public QueryParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map getInstance() { - return instance; - } - public QueryParametersMap0Builder getBuilderAfterQuery(Map instance) { - return new QueryParametersMap0Builder(instance); - } - } - - - public sealed interface QueryParameters1Boxed permits QueryParameters1BoxedMap { - @Nullable Object getData(); - } - - public record QueryParameters1BoxedMap(QueryParametersMap data) implements QueryParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable QueryParameters1 instance = null; - - protected QueryParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("query", Schema0.Schema01.class) - )) - .required(Set.of( - "query" - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static QueryParameters1 getInstance() { - if (instance == null) { - instance = new QueryParameters1(); - } - return instance; - } - - public QueryParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - if (!(propertyInstance instanceof String)) { - throw new RuntimeException("Invalid instantiated value"); - } - properties.put(propertyName, (String) propertyInstance); - } - FrozenMap castProperties = new FrozenMap<>(properties); - return new QueryParametersMap(castProperties); - } - - public QueryParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public QueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new QueryParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public QueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/RequestBody.java deleted file mode 100644 index 8d9663e8ef7..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/RequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.fakebodywithqueryparams.put; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.requestbody.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ), - true - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } - } - - public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} - public record ApplicationjsonRequestBody(ApplicationjsonSchema.User1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "application/json"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/Responses.java deleted file mode 100644 index 6109b533036..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakebodywithqueryparams.put; - -import org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/responses/Code200Response.java deleted file mode 100644 index 4370c358e93..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/responses/Code200Response.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.responses; - -import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; - -public class Code200Response extends SuccessDescriptionOnly { - public static class Code200Response1 extends SuccessDescriptionOnly1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/responses/FakebodywithqueryparamsPutCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/responses/FakebodywithqueryparamsPutCode200Response.java new file mode 100644 index 00000000000..b193efb7bee --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakebodywithqueryparams/put/responses/FakebodywithqueryparamsPutCode200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.fakebodywithqueryparams.put.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class FakebodywithqueryparamsPutCode200Response extends SuccessDescriptionOnly { + public static class FakebodywithqueryparamsPutCode200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/FakecasesensitiveparamsPut.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/FakecasesensitiveparamsPut.java new file mode 100644 index 00000000000..151c05d7f21 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/FakecasesensitiveparamsPut.java @@ -0,0 +1,180 @@ +package org.openapijsonschematools.client.paths.fakecasesensitiveparams; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.FakecasesensitiveparamsPutQueryParameters; +import org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.Parameters; +import org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.FakecasesensitiveparamsPutResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.paths.Fakecasesensitiveparams; + +import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakecasesensitiveparamsPut { + private static class PutProvider { + private static final String method = "put"; + + public static FakecasesensitiveparamsPutResponses.EndpointResponse put( + PutRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + + var querySerializer = new Parameters.QueryParametersSerializer(); + @Nullable Map queryMap = querySerializer.getQueryMap(request.queryParameters); + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakecasesensitiveparams.path; + if (queryMap != null) { + url = url + querySerializer.serialize(queryMap); + } + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakecasesensitiveparamsPutResponses.FakecasesensitiveparamsPutResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PutOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakecasesensitiveparamsPutResponses.EndpointResponse put(PutRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PutProvider.put(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface CaseSensitiveParamsOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakecasesensitiveparamsPutResponses.EndpointResponse caseSensitiveParams(PutRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PutProvider.put(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Put extends ApiClient implements PutOperation { + public Put(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PutRequest { + public FakecasesensitiveparamsPutQueryParameters.FakecasesensitiveparamsPutQueryParametersMap queryParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + + public PutRequest( + FakecasesensitiveparamsPutQueryParameters.FakecasesensitiveparamsPutQueryParametersMap queryParameters, + RootServerInfo.@Nullable ServerIndex serverIndex, + @Nullable Duration timeout + ) { + this.queryParameters = queryParameters; + this.serverIndex = serverIndex; + this.timeout = timeout; + } + } + + public static class PutNullableRequest { + public FakecasesensitiveparamsPutQueryParameters.@Nullable FakecasesensitiveparamsPutQueryParametersMap queryParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + PutNullableRequest getInstance(); + T getBuilderAfterServerIndex(PutNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PutNullableRequest getInstance(); + T getBuilderAfterTimeout(PutNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForQueryParameters { + PutNullableRequest getInstance(); + T getBuilderAfterQueryParameters(PutNullableRequest instance); + default T queryParameters(FakecasesensitiveparamsPutQueryParameters.FakecasesensitiveparamsPutQueryParametersMap queryParameters) { + var instance = getInstance(); + instance.queryParameters = queryParameters; + return getBuilderAfterQueryParameters(instance); + } + } + + public static class Put0RequestBuilder implements SetterForServerIndex, SetterForTimeout { + private final PutNullableRequest instance; + + public Put0RequestBuilder(PutNullableRequest instance) { + this.instance = instance; + } + + public PutRequest build() { + var queryParameters = instance.queryParameters; + if (queryParameters == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new PutRequest( + queryParameters, + instance.serverIndex, + instance.timeout + ); + } + + public PutNullableRequest getInstance() { + return instance; + } + + public Put0RequestBuilder getBuilderAfterServerIndex(PutNullableRequest instance) { + return this; + } + + public Put0RequestBuilder getBuilderAfterTimeout(PutNullableRequest instance) { + return this; + } + } + public static class PutRequestBuilder implements SetterForQueryParameters { + private final PutNullableRequest instance; + + public PutRequestBuilder() { + this.instance = new PutNullableRequest(); + } + + public PutNullableRequest getInstance() { + return instance; + } + + public Put0RequestBuilder getBuilderAfterQueryParameters(PutNullableRequest instance) { + return new Put0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/Put.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/Put.java deleted file mode 100644 index 9740580cca0..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/Put.java +++ /dev/null @@ -1,171 +0,0 @@ -package org.openapijsonschematools.client.paths.fakecasesensitiveparams; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.QueryParameters; -import org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.Parameters; -import org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.paths.Fakecasesensitiveparams; - -import java.io.IOException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Put { - private static class PutProvider { - private static final String method = "put"; - - public static Responses.EndpointResponse put( - PutRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - - var querySerializer = new Parameters.QueryParametersSerializer(); - @Nullable Map queryMap = querySerializer.getQueryMap(request.queryParameters); - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakecasesensitiveparams.path; - if (queryMap != null) { - url = url + querySerializer.serialize(queryMap); - } - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PutOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse put(PutRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PutProvider.put(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Put1 extends ApiClient implements PutOperation { - public Put1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PutRequest { - public QueryParameters.QueryParametersMap queryParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - - public PutRequest( - QueryParameters.QueryParametersMap queryParameters, - RootServerInfo.@Nullable ServerIndex serverIndex, - @Nullable Duration timeout - ) { - this.queryParameters = queryParameters; - this.serverIndex = serverIndex; - this.timeout = timeout; - } - } - - public static class PutNullableRequest { - public QueryParameters.@Nullable QueryParametersMap queryParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - PutNullableRequest getInstance(); - T getBuilderAfterServerIndex(PutNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PutNullableRequest getInstance(); - T getBuilderAfterTimeout(PutNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForQueryParameters { - PutNullableRequest getInstance(); - T getBuilderAfterQueryParameters(PutNullableRequest instance); - default T queryParameters(QueryParameters.QueryParametersMap queryParameters) { - var instance = getInstance(); - instance.queryParameters = queryParameters; - return getBuilderAfterQueryParameters(instance); - } - } - - public static class Put0RequestBuilder implements SetterForServerIndex, SetterForTimeout { - private final PutNullableRequest instance; - - public Put0RequestBuilder(PutNullableRequest instance) { - this.instance = instance; - } - - public PutRequest build() { - var queryParameters = instance.queryParameters; - if (queryParameters == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new PutRequest( - queryParameters, - instance.serverIndex, - instance.timeout - ); - } - - public PutNullableRequest getInstance() { - return instance; - } - - public Put0RequestBuilder getBuilderAfterServerIndex(PutNullableRequest instance) { - return this; - } - - public Put0RequestBuilder getBuilderAfterTimeout(PutNullableRequest instance) { - return this; - } - } - public static class PutRequestBuilder implements SetterForQueryParameters { - private final PutNullableRequest instance; - - public PutRequestBuilder() { - this.instance = new PutNullableRequest(); - } - - public PutNullableRequest getInstance() { - return instance; - } - - public Put0RequestBuilder getBuilderAfterQueryParameters(PutNullableRequest instance) { - return new Put0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/FakecasesensitiveparamsPutQueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/FakecasesensitiveparamsPutQueryParameters.java new file mode 100644 index 00000000000..156ae88ab40 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/FakecasesensitiveparamsPutQueryParameters.java @@ -0,0 +1,343 @@ +package org.openapijsonschematools.client.paths.fakecasesensitiveparams.put; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.parameters.parameter0.Schema0; +import org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.parameters.parameter1.Schema1; +import org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.parameters.parameter2.Schema2; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class FakecasesensitiveparamsPutQueryParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class FakecasesensitiveparamsPutadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable FakecasesensitiveparamsPutadditionalProperties instance = null; + public static FakecasesensitiveparamsPutadditionalProperties getInstance() { + if (instance == null) { + instance = new FakecasesensitiveparamsPutadditionalProperties(); + } + return instance; + } + } + + + public static class FakecasesensitiveparamsPutQueryParametersMap extends FrozenMap<@Nullable Object> { + protected FakecasesensitiveparamsPutQueryParametersMap(FrozenMap<@Nullable Object> m) { + super(m); + } + public static final Set requiredKeys = Set.of( + "SomeVar", + "someVar", + "some_var" + ); + public static final Set optionalKeys = Set.of(); + public static FakecasesensitiveparamsPutQueryParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return FakecasesensitiveparamsPutQueryParameters1.getInstance().validate(arg, configuration); + } + + public String SomeVar() { + @Nullable Object value = get("SomeVar"); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for SomeVar"); + } + return (String) value; + } + + public String someVar() { + @Nullable Object value = get("someVar"); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for someVar"); + } + return (String) value; + } + + public String some_var() { + @Nullable Object value = get("some_var"); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for some_var"); + } + return (String) value; + } + } + + public interface SetterForFakecasesensitiveparamsPutSomeVar { + Map getInstance(); + T getBuilderAfterFakecasesensitiveparamsPutSomeVar(Map instance); + + default T SomeVar(String value) { + var instance = getInstance(); + instance.put("SomeVar", value); + return getBuilderAfterFakecasesensitiveparamsPutSomeVar(instance); + } + } + + public interface SetterForFakecasesensitiveparamsPutsomeVar { + Map getInstance(); + T getBuilderAfterFakecasesensitiveparamsPutsomeVar(Map instance); + + default T someVar(String value) { + var instance = getInstance(); + instance.put("someVar", value); + return getBuilderAfterFakecasesensitiveparamsPutsomeVar(instance); + } + } + + public interface SetterForFakecasesensitiveparamsPutsomeVar1 { + Map getInstance(); + T getBuilderAfterFakecasesensitiveparamsPutsomeVar1(Map instance); + + default T some_var(String value) { + var instance = getInstance(); + instance.put("some_var", value); + return getBuilderAfterFakecasesensitiveparamsPutsomeVar1(instance); + } + } + + public static class FakecasesensitiveparamsPutQueryParametersMap000Builder implements GenericBuilder> { + private final Map instance; + private static final Set knownKeys = Set.of( + "SomeVar", + "someVar", + "some_var" + ); + public Set getKnownKeys() { + return knownKeys; + } + public FakecasesensitiveparamsPutQueryParametersMap000Builder(Map instance) { + this.instance = instance; + } + public Map build() { + return instance; + } + } + + public static class FakecasesensitiveparamsPutQueryParametersMap001Builder implements SetterForFakecasesensitiveparamsPutsomeVar1 { + private final Map instance; + public FakecasesensitiveparamsPutQueryParametersMap001Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FakecasesensitiveparamsPutQueryParametersMap000Builder getBuilderAfterFakecasesensitiveparamsPutsomeVar1(Map instance) { + return new FakecasesensitiveparamsPutQueryParametersMap000Builder(instance); + } + } + + public static class FakecasesensitiveparamsPutQueryParametersMap010Builder implements SetterForFakecasesensitiveparamsPutsomeVar { + private final Map instance; + public FakecasesensitiveparamsPutQueryParametersMap010Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FakecasesensitiveparamsPutQueryParametersMap000Builder getBuilderAfterFakecasesensitiveparamsPutsomeVar(Map instance) { + return new FakecasesensitiveparamsPutQueryParametersMap000Builder(instance); + } + } + + public static class FakecasesensitiveparamsPutQueryParametersMap011Builder implements SetterForFakecasesensitiveparamsPutsomeVar, SetterForFakecasesensitiveparamsPutsomeVar1 { + private final Map instance; + public FakecasesensitiveparamsPutQueryParametersMap011Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FakecasesensitiveparamsPutQueryParametersMap001Builder getBuilderAfterFakecasesensitiveparamsPutsomeVar(Map instance) { + return new FakecasesensitiveparamsPutQueryParametersMap001Builder(instance); + } + public FakecasesensitiveparamsPutQueryParametersMap010Builder getBuilderAfterFakecasesensitiveparamsPutsomeVar1(Map instance) { + return new FakecasesensitiveparamsPutQueryParametersMap010Builder(instance); + } + } + + public static class FakecasesensitiveparamsPutQueryParametersMap100Builder implements SetterForFakecasesensitiveparamsPutSomeVar { + private final Map instance; + public FakecasesensitiveparamsPutQueryParametersMap100Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FakecasesensitiveparamsPutQueryParametersMap000Builder getBuilderAfterFakecasesensitiveparamsPutSomeVar(Map instance) { + return new FakecasesensitiveparamsPutQueryParametersMap000Builder(instance); + } + } + + public static class FakecasesensitiveparamsPutQueryParametersMap101Builder implements SetterForFakecasesensitiveparamsPutSomeVar, SetterForFakecasesensitiveparamsPutsomeVar1 { + private final Map instance; + public FakecasesensitiveparamsPutQueryParametersMap101Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FakecasesensitiveparamsPutQueryParametersMap001Builder getBuilderAfterFakecasesensitiveparamsPutSomeVar(Map instance) { + return new FakecasesensitiveparamsPutQueryParametersMap001Builder(instance); + } + public FakecasesensitiveparamsPutQueryParametersMap100Builder getBuilderAfterFakecasesensitiveparamsPutsomeVar1(Map instance) { + return new FakecasesensitiveparamsPutQueryParametersMap100Builder(instance); + } + } + + public static class FakecasesensitiveparamsPutQueryParametersMap110Builder implements SetterForFakecasesensitiveparamsPutSomeVar, SetterForFakecasesensitiveparamsPutsomeVar { + private final Map instance; + public FakecasesensitiveparamsPutQueryParametersMap110Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FakecasesensitiveparamsPutQueryParametersMap010Builder getBuilderAfterFakecasesensitiveparamsPutSomeVar(Map instance) { + return new FakecasesensitiveparamsPutQueryParametersMap010Builder(instance); + } + public FakecasesensitiveparamsPutQueryParametersMap100Builder getBuilderAfterFakecasesensitiveparamsPutsomeVar(Map instance) { + return new FakecasesensitiveparamsPutQueryParametersMap100Builder(instance); + } + } + + public static class FakecasesensitiveparamsPutQueryParametersMapBuilder implements SetterForFakecasesensitiveparamsPutSomeVar, SetterForFakecasesensitiveparamsPutsomeVar, SetterForFakecasesensitiveparamsPutsomeVar1 { + private final Map instance; + public FakecasesensitiveparamsPutQueryParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map getInstance() { + return instance; + } + public FakecasesensitiveparamsPutQueryParametersMap011Builder getBuilderAfterFakecasesensitiveparamsPutSomeVar(Map instance) { + return new FakecasesensitiveparamsPutQueryParametersMap011Builder(instance); + } + public FakecasesensitiveparamsPutQueryParametersMap101Builder getBuilderAfterFakecasesensitiveparamsPutsomeVar(Map instance) { + return new FakecasesensitiveparamsPutQueryParametersMap101Builder(instance); + } + public FakecasesensitiveparamsPutQueryParametersMap110Builder getBuilderAfterFakecasesensitiveparamsPutsomeVar1(Map instance) { + return new FakecasesensitiveparamsPutQueryParametersMap110Builder(instance); + } + } + + + public sealed interface FakecasesensitiveparamsPutQueryParameters1Boxed permits FakecasesensitiveparamsPutQueryParameters1BoxedMap { + @Nullable Object getData(); + } + + public record FakecasesensitiveparamsPutQueryParameters1BoxedMap(FakecasesensitiveparamsPutQueryParametersMap data) implements FakecasesensitiveparamsPutQueryParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class FakecasesensitiveparamsPutQueryParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable FakecasesensitiveparamsPutQueryParameters1 instance = null; + + protected FakecasesensitiveparamsPutQueryParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("someVar", Schema0.Schema01.class), + new PropertyEntry("some_var", Schema2.Schema21.class), + new PropertyEntry("SomeVar", Schema1.Schema11.class) + )) + .required(Set.of( + "SomeVar", + "someVar", + "some_var" + )) + .additionalProperties(FakecasesensitiveparamsPutadditionalProperties.class) + ); + } + + public static FakecasesensitiveparamsPutQueryParameters1 getInstance() { + if (instance == null) { + instance = new FakecasesensitiveparamsPutQueryParameters1(); + } + return instance; + } + + public FakecasesensitiveparamsPutQueryParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + properties.put(propertyName, propertyInstance); + } + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); + return new FakecasesensitiveparamsPutQueryParametersMap(castProperties); + } + + public FakecasesensitiveparamsPutQueryParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public FakecasesensitiveparamsPutQueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new FakecasesensitiveparamsPutQueryParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public FakecasesensitiveparamsPutQueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/FakecasesensitiveparamsPutResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/FakecasesensitiveparamsPutResponses.java new file mode 100644 index 00000000000..4c72b6a0a50 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/FakecasesensitiveparamsPutResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakecasesensitiveparams.put; + +import org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.responses.FakecasesensitiveparamsPutCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakecasesensitiveparamsPutResponses { + public sealed interface EndpointResponse permits EndpointFakecasesensitiveparamsPutCode200Response {} + + public record EndpointFakecasesensitiveparamsPutCode200Response( + HttpResponse response, + Void body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakecasesensitiveparamsPutCode200ResponseDeserializer {} + + public static final class StatusFakecasesensitiveparamsPutCode200ResponseDeserializer extends FakecasesensitiveparamsPutCode200Response.FakecasesensitiveparamsPutCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakecasesensitiveparamsPutResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakecasesensitiveparamsPutResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakecasesensitiveparamsPutCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakecasesensitiveparamsPutCode200ResponseDeserializer castDeserializer = (StatusFakecasesensitiveparamsPutCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakecasesensitiveparamsPutCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/QueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/QueryParameters.java deleted file mode 100644 index 2e940b57cf6..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/QueryParameters.java +++ /dev/null @@ -1,343 +0,0 @@ -package org.openapijsonschematools.client.paths.fakecasesensitiveparams.put; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.parameters.parameter0.Schema0; -import org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.parameters.parameter1.Schema1; -import org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.parameters.parameter2.Schema2; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class QueryParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class QueryParametersMap extends FrozenMap<@Nullable Object> { - protected QueryParametersMap(FrozenMap<@Nullable Object> m) { - super(m); - } - public static final Set requiredKeys = Set.of( - "SomeVar", - "someVar", - "some_var" - ); - public static final Set optionalKeys = Set.of(); - public static QueryParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return QueryParameters1.getInstance().validate(arg, configuration); - } - - public String SomeVar() { - @Nullable Object value = get("SomeVar"); - if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for SomeVar"); - } - return (String) value; - } - - public String someVar() { - @Nullable Object value = get("someVar"); - if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for someVar"); - } - return (String) value; - } - - public String some_var() { - @Nullable Object value = get("some_var"); - if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for some_var"); - } - return (String) value; - } - } - - public interface SetterForSomeVar2 { - Map getInstance(); - T getBuilderAfterSomeVar2(Map instance); - - default T SomeVar(String value) { - var instance = getInstance(); - instance.put("SomeVar", value); - return getBuilderAfterSomeVar2(instance); - } - } - - public interface SetterForSomeVar { - Map getInstance(); - T getBuilderAfterSomeVar(Map instance); - - default T someVar(String value) { - var instance = getInstance(); - instance.put("someVar", value); - return getBuilderAfterSomeVar(instance); - } - } - - public interface SetterForSomeVar1 { - Map getInstance(); - T getBuilderAfterSomeVar1(Map instance); - - default T some_var(String value) { - var instance = getInstance(); - instance.put("some_var", value); - return getBuilderAfterSomeVar1(instance); - } - } - - public static class QueryParametersMap000Builder implements GenericBuilder> { - private final Map instance; - private static final Set knownKeys = Set.of( - "SomeVar", - "someVar", - "some_var" - ); - public Set getKnownKeys() { - return knownKeys; - } - public QueryParametersMap000Builder(Map instance) { - this.instance = instance; - } - public Map build() { - return instance; - } - } - - public static class QueryParametersMap001Builder implements SetterForSomeVar1 { - private final Map instance; - public QueryParametersMap001Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000Builder getBuilderAfterSomeVar1(Map instance) { - return new QueryParametersMap000Builder(instance); - } - } - - public static class QueryParametersMap010Builder implements SetterForSomeVar { - private final Map instance; - public QueryParametersMap010Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000Builder getBuilderAfterSomeVar(Map instance) { - return new QueryParametersMap000Builder(instance); - } - } - - public static class QueryParametersMap011Builder implements SetterForSomeVar, SetterForSomeVar1 { - private final Map instance; - public QueryParametersMap011Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap001Builder getBuilderAfterSomeVar(Map instance) { - return new QueryParametersMap001Builder(instance); - } - public QueryParametersMap010Builder getBuilderAfterSomeVar1(Map instance) { - return new QueryParametersMap010Builder(instance); - } - } - - public static class QueryParametersMap100Builder implements SetterForSomeVar2 { - private final Map instance; - public QueryParametersMap100Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000Builder getBuilderAfterSomeVar2(Map instance) { - return new QueryParametersMap000Builder(instance); - } - } - - public static class QueryParametersMap101Builder implements SetterForSomeVar2, SetterForSomeVar1 { - private final Map instance; - public QueryParametersMap101Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap001Builder getBuilderAfterSomeVar2(Map instance) { - return new QueryParametersMap001Builder(instance); - } - public QueryParametersMap100Builder getBuilderAfterSomeVar1(Map instance) { - return new QueryParametersMap100Builder(instance); - } - } - - public static class QueryParametersMap110Builder implements SetterForSomeVar2, SetterForSomeVar { - private final Map instance; - public QueryParametersMap110Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap010Builder getBuilderAfterSomeVar2(Map instance) { - return new QueryParametersMap010Builder(instance); - } - public QueryParametersMap100Builder getBuilderAfterSomeVar(Map instance) { - return new QueryParametersMap100Builder(instance); - } - } - - public static class QueryParametersMapBuilder implements SetterForSomeVar2, SetterForSomeVar, SetterForSomeVar1 { - private final Map instance; - public QueryParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map getInstance() { - return instance; - } - public QueryParametersMap011Builder getBuilderAfterSomeVar2(Map instance) { - return new QueryParametersMap011Builder(instance); - } - public QueryParametersMap101Builder getBuilderAfterSomeVar(Map instance) { - return new QueryParametersMap101Builder(instance); - } - public QueryParametersMap110Builder getBuilderAfterSomeVar1(Map instance) { - return new QueryParametersMap110Builder(instance); - } - } - - - public sealed interface QueryParameters1Boxed permits QueryParameters1BoxedMap { - @Nullable Object getData(); - } - - public record QueryParameters1BoxedMap(QueryParametersMap data) implements QueryParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable QueryParameters1 instance = null; - - protected QueryParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("someVar", Schema0.Schema01.class), - new PropertyEntry("some_var", Schema2.Schema21.class), - new PropertyEntry("SomeVar", Schema1.Schema11.class) - )) - .required(Set.of( - "SomeVar", - "someVar", - "some_var" - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static QueryParameters1 getInstance() { - if (instance == null) { - instance = new QueryParameters1(); - } - return instance; - } - - public QueryParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, propertyInstance); - } - FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); - return new QueryParametersMap(castProperties); - } - - public QueryParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public QueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new QueryParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public QueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/Responses.java deleted file mode 100644 index 657dc7e0feb..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakecasesensitiveparams.put; - -import org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/responses/Code200Response.java deleted file mode 100644 index 3b79dac0ee0..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/responses/Code200Response.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.responses; - -import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; - -public class Code200Response extends SuccessDescriptionOnly { - public static class Code200Response1 extends SuccessDescriptionOnly1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/responses/FakecasesensitiveparamsPutCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/responses/FakecasesensitiveparamsPutCode200Response.java new file mode 100644 index 00000000000..72eb0975e3a --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakecasesensitiveparams/put/responses/FakecasesensitiveparamsPutCode200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.fakecasesensitiveparams.put.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class FakecasesensitiveparamsPutCode200Response extends SuccessDescriptionOnly { + public static class FakecasesensitiveparamsPutCode200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/FakeclassnametestPatch.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/FakeclassnametestPatch.java new file mode 100644 index 00000000000..798f569e7ab --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/FakeclassnametestPatch.java @@ -0,0 +1,215 @@ +package org.openapijsonschematools.client.paths.fakeclassnametest; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeclassnametest.patch.FakeclassnametestPatchSecurityInfo; +import org.openapijsonschematools.client.paths.fakeclassnametest.patch.FakeclassnametestPatchRequestBody; +import org.openapijsonschematools.client.paths.fakeclassnametest.patch.FakeclassnametestPatchResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Fakeclassnametest; +import org.openapijsonschematools.client.securityrequirementobjects.SecurityRequirementObject; +import org.openapijsonschematools.client.securityrequirementobjects.AuthApplier; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakeclassnametestPatch { + private static class PatchProvider extends AuthApplier { + private static final String method = "patch"; + + public static FakeclassnametestPatchResponses.EndpointResponse patch( + PatchRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + SerializedRequestBody serializedRequestBody = new FakeclassnametestPatchRequestBody.FakeclassnametestPatchRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + SecurityRequirementObject securityRequirementObject = apiConfiguration.getSecurityRequirementObject(request.securityIndex); + updateParamsForAuth( + securityRequirementObject, + headers, + Fakeclassnametest.path, + method, + bodyPublisher, + queryMap, + apiConfiguration + ); + + String url = host + Fakeclassnametest.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakeclassnametestPatchResponses.FakeclassnametestPatchResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PatchOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakeclassnametestPatchResponses.EndpointResponse patch(PatchRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PatchProvider.patch(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface ClassnameOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakeclassnametestPatchResponses.EndpointResponse classname(PatchRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PatchProvider.patch(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Patch extends ApiClient implements PatchOperation { + public Patch(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PatchRequest { + public FakeclassnametestPatchRequestBody.SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public FakeclassnametestPatchSecurityInfo.@Nullable SecurityIndex securityIndex; + public @Nullable Duration timeout; + + public PatchRequest( + FakeclassnametestPatchRequestBody.SealedRequestBody requestBody, + RootServerInfo.@Nullable ServerIndex serverIndex, + FakeclassnametestPatchSecurityInfo.@Nullable SecurityIndex securityIndex, + @Nullable Duration timeout + ) { + this.requestBody = requestBody; + this.serverIndex = serverIndex; + this.securityIndex = securityIndex; + this.timeout = timeout; + } + } + + public static class PatchNullableRequest { + public FakeclassnametestPatchRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public FakeclassnametestPatchSecurityInfo.@Nullable SecurityIndex securityIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + PatchNullableRequest getInstance(); + T getBuilderAfterServerIndex(PatchNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForSecurityIndex { + PatchNullableRequest getInstance(); + T getBuilderAfterSecurityIndex(PatchNullableRequest instance); + default T securityIndex(FakeclassnametestPatchSecurityInfo.SecurityIndex securityIndex) { + var instance = getInstance(); + instance.securityIndex = securityIndex; + return getBuilderAfterSecurityIndex(instance); + } + } + + public interface SetterForTimeout { + PatchNullableRequest getInstance(); + T getBuilderAfterTimeout(PatchNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForRequestBody { + PatchNullableRequest getInstance(); + T getBuilderAfterRequestBody(PatchNullableRequest instance); + default T requestBody(FakeclassnametestPatchRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public static class Patch0RequestBuilder implements SetterForServerIndex, SetterForSecurityIndex, SetterForTimeout { + private final PatchNullableRequest instance; + + public Patch0RequestBuilder(PatchNullableRequest instance) { + this.instance = instance; + } + + public PatchRequest build() { + var requestBody = instance.requestBody; + if (requestBody == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new PatchRequest( + requestBody, + instance.serverIndex, + instance.securityIndex, + instance.timeout + ); + } + + public PatchNullableRequest getInstance() { + return instance; + } + + public Patch0RequestBuilder getBuilderAfterServerIndex(PatchNullableRequest instance) { + return this; + } + + public Patch0RequestBuilder getBuilderAfterSecurityIndex(PatchNullableRequest instance) { + return this; + } + + public Patch0RequestBuilder getBuilderAfterTimeout(PatchNullableRequest instance) { + return this; + } + } + public static class PatchRequestBuilder implements SetterForRequestBody { + private final PatchNullableRequest instance; + + public PatchRequestBuilder() { + this.instance = new PatchNullableRequest(); + } + + public PatchNullableRequest getInstance() { + return instance; + } + + public Patch0RequestBuilder getBuilderAfterRequestBody(PatchNullableRequest instance) { + return new Patch0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/Patch.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/Patch.java deleted file mode 100644 index dd5ea58f497..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/Patch.java +++ /dev/null @@ -1,206 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeclassnametest; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakeclassnametest.patch.FakeclassnametestPatchSecurityInfo; -import org.openapijsonschematools.client.paths.fakeclassnametest.patch.RequestBody; -import org.openapijsonschematools.client.paths.fakeclassnametest.patch.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Fakeclassnametest; -import org.openapijsonschematools.client.securityrequirementobjects.SecurityRequirementObject; -import org.openapijsonschematools.client.securityrequirementobjects.AuthApplier; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Patch { - private static class PatchProvider extends AuthApplier { - private static final String method = "patch"; - - public static Responses.EndpointResponse patch( - PatchRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - SerializedRequestBody serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - SecurityRequirementObject securityRequirementObject = apiConfiguration.getSecurityRequirementObject(request.securityIndex); - updateParamsForAuth( - securityRequirementObject, - headers, - Fakeclassnametest.path, - method, - bodyPublisher, - queryMap, - apiConfiguration - ); - - String url = host + Fakeclassnametest.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PatchOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse patch(PatchRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PatchProvider.patch(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Patch1 extends ApiClient implements PatchOperation { - public Patch1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PatchRequest { - public RequestBody.SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public FakeclassnametestPatchSecurityInfo.@Nullable SecurityIndex securityIndex; - public @Nullable Duration timeout; - - public PatchRequest( - RequestBody.SealedRequestBody requestBody, - RootServerInfo.@Nullable ServerIndex serverIndex, - FakeclassnametestPatchSecurityInfo.@Nullable SecurityIndex securityIndex, - @Nullable Duration timeout - ) { - this.requestBody = requestBody; - this.serverIndex = serverIndex; - this.securityIndex = securityIndex; - this.timeout = timeout; - } - } - - public static class PatchNullableRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public FakeclassnametestPatchSecurityInfo.@Nullable SecurityIndex securityIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - PatchNullableRequest getInstance(); - T getBuilderAfterServerIndex(PatchNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForSecurityIndex { - PatchNullableRequest getInstance(); - T getBuilderAfterSecurityIndex(PatchNullableRequest instance); - default T securityIndex(FakeclassnametestPatchSecurityInfo.SecurityIndex securityIndex) { - var instance = getInstance(); - instance.securityIndex = securityIndex; - return getBuilderAfterSecurityIndex(instance); - } - } - - public interface SetterForTimeout { - PatchNullableRequest getInstance(); - T getBuilderAfterTimeout(PatchNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForRequestBody { - PatchNullableRequest getInstance(); - T getBuilderAfterRequestBody(PatchNullableRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public static class Patch0RequestBuilder implements SetterForServerIndex, SetterForSecurityIndex, SetterForTimeout { - private final PatchNullableRequest instance; - - public Patch0RequestBuilder(PatchNullableRequest instance) { - this.instance = instance; - } - - public PatchRequest build() { - var requestBody = instance.requestBody; - if (requestBody == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new PatchRequest( - requestBody, - instance.serverIndex, - instance.securityIndex, - instance.timeout - ); - } - - public PatchNullableRequest getInstance() { - return instance; - } - - public Patch0RequestBuilder getBuilderAfterServerIndex(PatchNullableRequest instance) { - return this; - } - - public Patch0RequestBuilder getBuilderAfterSecurityIndex(PatchNullableRequest instance) { - return this; - } - - public Patch0RequestBuilder getBuilderAfterTimeout(PatchNullableRequest instance) { - return this; - } - } - public static class PatchRequestBuilder implements SetterForRequestBody { - private final PatchNullableRequest instance; - - public PatchRequestBuilder() { - this.instance = new PatchNullableRequest(); - } - - public PatchNullableRequest getInstance() { - return instance; - } - - public Patch0RequestBuilder getBuilderAfterRequestBody(PatchNullableRequest instance) { - return new Patch0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/FakeclassnametestPatchRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/FakeclassnametestPatchRequestBody.java new file mode 100644 index 00000000000..5b8ff4f8390 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/FakeclassnametestPatchRequestBody.java @@ -0,0 +1,11 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.fakeclassnametest.patch; + +import org.openapijsonschematools.client.components.requestbodies.Client; + +public class FakeclassnametestPatchRequestBody extends Client { + public static class FakeclassnametestPatchRequestBody1 extends Client1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/FakeclassnametestPatchResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/FakeclassnametestPatchResponses.java new file mode 100644 index 00000000000..4d9a18471e8 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/FakeclassnametestPatchResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakeclassnametest.patch; + +import org.openapijsonschematools.client.paths.fakeclassnametest.patch.responses.FakeclassnametestPatchCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakeclassnametestPatchResponses { + public sealed interface EndpointResponse permits EndpointFakeclassnametestPatchCode200Response {} + + public record EndpointFakeclassnametestPatchCode200Response( + HttpResponse response, + FakeclassnametestPatchCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakeclassnametestPatchCode200ResponseDeserializer {} + + public static final class StatusFakeclassnametestPatchCode200ResponseDeserializer extends FakeclassnametestPatchCode200Response.FakeclassnametestPatchCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakeclassnametestPatchResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakeclassnametestPatchResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakeclassnametestPatchCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakeclassnametestPatchCode200ResponseDeserializer castDeserializer = (StatusFakeclassnametestPatchCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakeclassnametestPatchCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/RequestBody.java deleted file mode 100644 index 8a4c5d01373..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/RequestBody.java +++ /dev/null @@ -1,11 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.fakeclassnametest.patch; - -import org.openapijsonschematools.client.components.requestbodies.Client; - -public class RequestBody extends Client { - public static class RequestBody1 extends Client1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/Responses.java deleted file mode 100644 index 6c0629531b3..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeclassnametest.patch; - -import org.openapijsonschematools.client.paths.fakeclassnametest.patch.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/responses/Code200Response.java deleted file mode 100644 index 89d40f66041..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/responses/Code200Response.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeclassnametest.patch.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakeclassnametest.patch.responses.code200response.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.Client1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/responses/FakeclassnametestPatchCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/responses/FakeclassnametestPatchCode200Response.java new file mode 100644 index 00000000000..93fdc3843da --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeclassnametest/patch/responses/FakeclassnametestPatchCode200Response.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakeclassnametest.patch.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakeclassnametest.patch.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakeclassnametestPatchCode200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.Client1Boxed body) implements SealedResponseBody { } + + public static class FakeclassnametestPatchCode200Response1 extends ResponseDeserializer { + public FakeclassnametestPatchCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/Delete.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/Delete.java deleted file mode 100644 index cedaa59345b..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/Delete.java +++ /dev/null @@ -1,170 +0,0 @@ -package org.openapijsonschematools.client.paths.fakedeletecoffeeid; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.PathParameters; -import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.Parameters; -import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.paths.Fakedeletecoffeeid; - -import java.io.IOException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Delete { - private static class DeleteProvider { - private static final String method = "delete"; - - public static Responses.EndpointResponse delete( - DeleteRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - - var pathSerializer = new Parameters.PathParametersSerializer(); - String updatedPath = pathSerializer.serialize(request.pathParameters, Fakedeletecoffeeid.path); - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + updatedPath; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface DeleteOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse delete(DeleteRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return DeleteProvider.delete(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Delete1 extends ApiClient implements DeleteOperation { - public Delete1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class DeleteRequest { - public PathParameters.PathParametersMap pathParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - - public DeleteRequest( - PathParameters.PathParametersMap pathParameters, - RootServerInfo.@Nullable ServerIndex serverIndex, - @Nullable Duration timeout - ) { - this.pathParameters = pathParameters; - this.serverIndex = serverIndex; - this.timeout = timeout; - } - } - - public static class DeleteNullableRequest { - public PathParameters.@Nullable PathParametersMap pathParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - DeleteNullableRequest getInstance(); - T getBuilderAfterServerIndex(DeleteNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - DeleteNullableRequest getInstance(); - T getBuilderAfterTimeout(DeleteNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForPathParameters { - DeleteNullableRequest getInstance(); - T getBuilderAfterPathParameters(DeleteNullableRequest instance); - default T pathParameters(PathParameters.PathParametersMap pathParameters) { - var instance = getInstance(); - instance.pathParameters = pathParameters; - return getBuilderAfterPathParameters(instance); - } - } - - public static class Delete0RequestBuilder implements SetterForServerIndex, SetterForTimeout { - private final DeleteNullableRequest instance; - - public Delete0RequestBuilder(DeleteNullableRequest instance) { - this.instance = instance; - } - - public DeleteRequest build() { - var pathParameters = instance.pathParameters; - if (pathParameters == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new DeleteRequest( - pathParameters, - instance.serverIndex, - instance.timeout - ); - } - - public DeleteNullableRequest getInstance() { - return instance; - } - - public Delete0RequestBuilder getBuilderAfterServerIndex(DeleteNullableRequest instance) { - return this; - } - - public Delete0RequestBuilder getBuilderAfterTimeout(DeleteNullableRequest instance) { - return this; - } - } - public static class DeleteRequestBuilder implements SetterForPathParameters { - private final DeleteNullableRequest instance; - - public DeleteRequestBuilder() { - this.instance = new DeleteNullableRequest(); - } - - public DeleteNullableRequest getInstance() { - return instance; - } - - public Delete0RequestBuilder getBuilderAfterPathParameters(DeleteNullableRequest instance) { - return new Delete0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/FakedeletecoffeeidDelete.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/FakedeletecoffeeidDelete.java new file mode 100644 index 00000000000..4fca9306157 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/FakedeletecoffeeidDelete.java @@ -0,0 +1,179 @@ +package org.openapijsonschematools.client.paths.fakedeletecoffeeid; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.FakedeletecoffeeidDeletePathParameters; +import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.Parameters; +import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.FakedeletecoffeeidDeleteResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.paths.Fakedeletecoffeeid; + +import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakedeletecoffeeidDelete { + private static class DeleteProvider { + private static final String method = "delete"; + + public static FakedeletecoffeeidDeleteResponses.EndpointResponse delete( + DeleteRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + + var pathSerializer = new Parameters.PathParametersSerializer(); + String updatedPath = pathSerializer.serialize(request.pathParameters, Fakedeletecoffeeid.path); + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + updatedPath; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakedeletecoffeeidDeleteResponses.FakedeletecoffeeidDeleteResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface DeleteOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakedeletecoffeeidDeleteResponses.EndpointResponse delete(DeleteRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return DeleteProvider.delete(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface DeleteCoffeeOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakedeletecoffeeidDeleteResponses.EndpointResponse deleteCoffee(DeleteRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return DeleteProvider.delete(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Delete extends ApiClient implements DeleteOperation { + public Delete(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class DeleteRequest { + public FakedeletecoffeeidDeletePathParameters.FakedeletecoffeeidDeletePathParametersMap pathParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + + public DeleteRequest( + FakedeletecoffeeidDeletePathParameters.FakedeletecoffeeidDeletePathParametersMap pathParameters, + RootServerInfo.@Nullable ServerIndex serverIndex, + @Nullable Duration timeout + ) { + this.pathParameters = pathParameters; + this.serverIndex = serverIndex; + this.timeout = timeout; + } + } + + public static class DeleteNullableRequest { + public FakedeletecoffeeidDeletePathParameters.@Nullable FakedeletecoffeeidDeletePathParametersMap pathParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + DeleteNullableRequest getInstance(); + T getBuilderAfterServerIndex(DeleteNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + DeleteNullableRequest getInstance(); + T getBuilderAfterTimeout(DeleteNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForPathParameters { + DeleteNullableRequest getInstance(); + T getBuilderAfterPathParameters(DeleteNullableRequest instance); + default T pathParameters(FakedeletecoffeeidDeletePathParameters.FakedeletecoffeeidDeletePathParametersMap pathParameters) { + var instance = getInstance(); + instance.pathParameters = pathParameters; + return getBuilderAfterPathParameters(instance); + } + } + + public static class Delete0RequestBuilder implements SetterForServerIndex, SetterForTimeout { + private final DeleteNullableRequest instance; + + public Delete0RequestBuilder(DeleteNullableRequest instance) { + this.instance = instance; + } + + public DeleteRequest build() { + var pathParameters = instance.pathParameters; + if (pathParameters == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new DeleteRequest( + pathParameters, + instance.serverIndex, + instance.timeout + ); + } + + public DeleteNullableRequest getInstance() { + return instance; + } + + public Delete0RequestBuilder getBuilderAfterServerIndex(DeleteNullableRequest instance) { + return this; + } + + public Delete0RequestBuilder getBuilderAfterTimeout(DeleteNullableRequest instance) { + return this; + } + } + public static class DeleteRequestBuilder implements SetterForPathParameters { + private final DeleteNullableRequest instance; + + public DeleteRequestBuilder() { + this.instance = new DeleteNullableRequest(); + } + + public DeleteNullableRequest getInstance() { + return instance; + } + + public Delete0RequestBuilder getBuilderAfterPathParameters(DeleteNullableRequest instance) { + return new Delete0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/FakedeletecoffeeidDeletePathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/FakedeletecoffeeidDeletePathParameters.java new file mode 100644 index 00000000000..870bd0bc79f --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/FakedeletecoffeeidDeletePathParameters.java @@ -0,0 +1,205 @@ +package org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.parameters.parameter0.Schema0; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class FakedeletecoffeeidDeletePathParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class FakedeletecoffeeidDeleteadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable FakedeletecoffeeidDeleteadditionalProperties instance = null; + public static FakedeletecoffeeidDeleteadditionalProperties getInstance() { + if (instance == null) { + instance = new FakedeletecoffeeidDeleteadditionalProperties(); + } + return instance; + } + } + + + public static class FakedeletecoffeeidDeletePathParametersMap extends FrozenMap { + protected FakedeletecoffeeidDeletePathParametersMap(FrozenMap m) { + super(m); + } + public static final Set requiredKeys = Set.of( + "id" + ); + public static final Set optionalKeys = Set.of(); + public static FakedeletecoffeeidDeletePathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return FakedeletecoffeeidDeletePathParameters1.getInstance().validate(arg, configuration); + } + + public String id() { + try { + return getOrThrow("version"); + } catch (UnsetPropertyException e) { + throw new RuntimeException(e); + } + } + } + + public interface SetterForFakedeletecoffeeidDeleteid { + Map getInstance(); + T getBuilderAfterFakedeletecoffeeidDeleteid(Map instance); + + default T id(String value) { + var instance = getInstance(); + instance.put("id", value); + return getBuilderAfterFakedeletecoffeeidDeleteid(instance); + } + } + + public static class FakedeletecoffeeidDeletePathParametersMap0Builder implements GenericBuilder> { + private final Map instance; + private static final Set knownKeys = Set.of( + "id" + ); + public Set getKnownKeys() { + return knownKeys; + } + public FakedeletecoffeeidDeletePathParametersMap0Builder(Map instance) { + this.instance = instance; + } + public Map build() { + return instance; + } + } + + public static class FakedeletecoffeeidDeletePathParametersMapBuilder implements SetterForFakedeletecoffeeidDeleteid { + private final Map instance; + public FakedeletecoffeeidDeletePathParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map getInstance() { + return instance; + } + public FakedeletecoffeeidDeletePathParametersMap0Builder getBuilderAfterFakedeletecoffeeidDeleteid(Map instance) { + return new FakedeletecoffeeidDeletePathParametersMap0Builder(instance); + } + } + + + public sealed interface FakedeletecoffeeidDeletePathParameters1Boxed permits FakedeletecoffeeidDeletePathParameters1BoxedMap { + @Nullable Object getData(); + } + + public record FakedeletecoffeeidDeletePathParameters1BoxedMap(FakedeletecoffeeidDeletePathParametersMap data) implements FakedeletecoffeeidDeletePathParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class FakedeletecoffeeidDeletePathParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable FakedeletecoffeeidDeletePathParameters1 instance = null; + + protected FakedeletecoffeeidDeletePathParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("id", Schema0.Schema01.class) + )) + .required(Set.of( + "id" + )) + .additionalProperties(FakedeletecoffeeidDeleteadditionalProperties.class) + ); + } + + public static FakedeletecoffeeidDeletePathParameters1 getInstance() { + if (instance == null) { + instance = new FakedeletecoffeeidDeletePathParameters1(); + } + return instance; + } + + public FakedeletecoffeeidDeletePathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof String)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (String) propertyInstance); + } + FrozenMap castProperties = new FrozenMap<>(properties); + return new FakedeletecoffeeidDeletePathParametersMap(castProperties); + } + + public FakedeletecoffeeidDeletePathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public FakedeletecoffeeidDeletePathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new FakedeletecoffeeidDeletePathParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public FakedeletecoffeeidDeletePathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/FakedeletecoffeeidDeleteResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/FakedeletecoffeeidDeleteResponses.java new file mode 100644 index 00000000000..d58495afcb2 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/FakedeletecoffeeidDeleteResponses.java @@ -0,0 +1,61 @@ +package org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete; + +import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.responses.FakedeletecoffeeidDeleteCode200Response; +import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.responses.FakedeletecoffeeidDeleteCodedefaultResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakedeletecoffeeidDeleteResponses { + public sealed interface EndpointResponse permits EndpointFakedeletecoffeeidDeleteCode200Response, EndpointFakedeletecoffeeidDeleteCodedefaultResponse {} + + public record EndpointFakedeletecoffeeidDeleteCode200Response( + HttpResponse response, + Void body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public record EndpointFakedeletecoffeeidDeleteCodedefaultResponse( + HttpResponse response, + Void body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakedeletecoffeeidDeleteCode200ResponseDeserializer {} + + public static final class StatusFakedeletecoffeeidDeleteCode200ResponseDeserializer extends FakedeletecoffeeidDeleteCode200Response.FakedeletecoffeeidDeleteCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakedeletecoffeeidDeleteResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + private final FakedeletecoffeeidDeleteCodedefaultResponse.FakedeletecoffeeidDeleteCodedefaultResponse1 defaultResponseDeserializer; + public FakedeletecoffeeidDeleteResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakedeletecoffeeidDeleteCode200ResponseDeserializer()) + ); + this.defaultResponseDeserializer = new FakedeletecoffeeidDeleteCodedefaultResponse.FakedeletecoffeeidDeleteCodedefaultResponse1(); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer != null) { + StatusFakedeletecoffeeidDeleteCode200ResponseDeserializer castDeserializer = (StatusFakedeletecoffeeidDeleteCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakedeletecoffeeidDeleteCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + var deserializedResponse = defaultResponseDeserializer.deserialize(response, configuration); + return new EndpointFakedeletecoffeeidDeleteCodedefaultResponse(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/PathParameters.java deleted file mode 100644 index ac73ba87fae..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/PathParameters.java +++ /dev/null @@ -1,205 +0,0 @@ -package org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.parameters.parameter0.Schema0; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class PathParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class PathParametersMap extends FrozenMap { - protected PathParametersMap(FrozenMap m) { - super(m); - } - public static final Set requiredKeys = Set.of( - "id" - ); - public static final Set optionalKeys = Set.of(); - public static PathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return PathParameters1.getInstance().validate(arg, configuration); - } - - public String id() { - try { - return getOrThrow("version"); - } catch (UnsetPropertyException e) { - throw new RuntimeException(e); - } - } - } - - public interface SetterForId { - Map getInstance(); - T getBuilderAfterId(Map instance); - - default T id(String value) { - var instance = getInstance(); - instance.put("id", value); - return getBuilderAfterId(instance); - } - } - - public static class PathParametersMap0Builder implements GenericBuilder> { - private final Map instance; - private static final Set knownKeys = Set.of( - "id" - ); - public Set getKnownKeys() { - return knownKeys; - } - public PathParametersMap0Builder(Map instance) { - this.instance = instance; - } - public Map build() { - return instance; - } - } - - public static class PathParametersMapBuilder implements SetterForId { - private final Map instance; - public PathParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map getInstance() { - return instance; - } - public PathParametersMap0Builder getBuilderAfterId(Map instance) { - return new PathParametersMap0Builder(instance); - } - } - - - public sealed interface PathParameters1Boxed permits PathParameters1BoxedMap { - @Nullable Object getData(); - } - - public record PathParameters1BoxedMap(PathParametersMap data) implements PathParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable PathParameters1 instance = null; - - protected PathParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("id", Schema0.Schema01.class) - )) - .required(Set.of( - "id" - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static PathParameters1 getInstance() { - if (instance == null) { - instance = new PathParameters1(); - } - return instance; - } - - public PathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - if (!(propertyInstance instanceof String)) { - throw new RuntimeException("Invalid instantiated value"); - } - properties.put(propertyName, (String) propertyInstance); - } - FrozenMap castProperties = new FrozenMap<>(properties); - return new PathParametersMap(castProperties); - } - - public PathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new PathParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/Responses.java deleted file mode 100644 index 992b7a97bbf..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/Responses.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete; - -import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.responses.Code200Response; -import org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.responses.CodedefaultResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response, EndpointCodedefaultResponse {} - - public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public record EndpointCodedefaultResponse( - HttpResponse response, - Void body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - private final CodedefaultResponse.CodedefaultResponse1 defaultResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - this.defaultResponseDeserializer = new CodedefaultResponse.CodedefaultResponse1(); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer != null) { - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - var deserializedResponse = defaultResponseDeserializer.deserialize(response, configuration); - return new EndpointCodedefaultResponse(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/responses/Code200Response.java deleted file mode 100644 index 29983a94575..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/responses/Code200Response.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.responses; - -import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; - -public class Code200Response extends SuccessDescriptionOnly { - public static class Code200Response1 extends SuccessDescriptionOnly1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/responses/CodedefaultResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/responses/CodedefaultResponse.java deleted file mode 100644 index 1035e7e22d1..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/responses/CodedefaultResponse.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; - -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class CodedefaultResponse { - - public static class CodedefaultResponse1 extends ResponseDeserializer { - public CodedefaultResponse1() { - super( - MapUtils.makeMap( - ) - ); - } - - @Override - protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { - return null; - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/responses/FakedeletecoffeeidDeleteCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/responses/FakedeletecoffeeidDeleteCode200Response.java new file mode 100644 index 00000000000..56f5f4b8774 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/responses/FakedeletecoffeeidDeleteCode200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class FakedeletecoffeeidDeleteCode200Response extends SuccessDescriptionOnly { + public static class FakedeletecoffeeidDeleteCode200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/responses/FakedeletecoffeeidDeleteCodedefaultResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/responses/FakedeletecoffeeidDeleteCodedefaultResponse.java new file mode 100644 index 00000000000..2a5713c9f0d --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakedeletecoffeeid/delete/responses/FakedeletecoffeeidDeleteCodedefaultResponse.java @@ -0,0 +1,45 @@ +package org.openapijsonschematools.client.paths.fakedeletecoffeeid.delete.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakedeletecoffeeidDeleteCodedefaultResponse { + + public static class FakedeletecoffeeidDeleteCodedefaultResponse1 extends ResponseDeserializer { + public FakedeletecoffeeidDeleteCodedefaultResponse1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakehealth/FakehealthGet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakehealth/FakehealthGet.java new file mode 100644 index 00000000000..49b0d51d461 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakehealth/FakehealthGet.java @@ -0,0 +1,124 @@ +package org.openapijsonschematools.client.paths.fakehealth; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakehealth.get.FakehealthGetResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.paths.Fakehealth; + +import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakehealthGet { + private static class GetProvider { + private static final String method = "get"; + + public static FakehealthGetResponses.EndpointResponse get( + GetRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakehealth.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakehealthGetResponses.FakehealthGetResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface GetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakehealthGetResponses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface FakeHealthGetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakehealthGetResponses.EndpointResponse fakeHealthGet(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Get extends ApiClient implements GetOperation { + public Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class GetRequest { + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + GetRequest getInstance(); + T getBuilderAfterServerIndex(GetRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + GetRequest getInstance(); + T getBuilderAfterTimeout(GetRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class GetRequestBuilder implements SetterForServerIndex, SetterForTimeout { + private final GetRequest instance; + + public GetRequestBuilder() { + this.instance = new GetRequest(); + } + + public GetRequest build() { + return instance; + } + + public GetRequest getInstance() { + return instance; + } + + public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { + return this; + } + + public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakehealth/Get.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakehealth/Get.java deleted file mode 100644 index 9e1fcb44bc3..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakehealth/Get.java +++ /dev/null @@ -1,115 +0,0 @@ -package org.openapijsonschematools.client.paths.fakehealth; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakehealth.get.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.paths.Fakehealth; - -import java.io.IOException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Get { - private static class GetProvider { - private static final String method = "get"; - - public static Responses.EndpointResponse get( - GetRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakehealth.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface GetOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Get1 extends ApiClient implements GetOperation { - public Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class GetRequest { - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - GetRequest getInstance(); - T getBuilderAfterServerIndex(GetRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - GetRequest getInstance(); - T getBuilderAfterTimeout(GetRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class GetRequestBuilder implements SetterForServerIndex, SetterForTimeout { - private final GetRequest instance; - - public GetRequestBuilder() { - this.instance = new GetRequest(); - } - - public GetRequest build() { - return instance; - } - - public GetRequest getInstance() { - return instance; - } - - public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { - return this; - } - - public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakehealth/get/FakehealthGetResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakehealth/get/FakehealthGetResponses.java new file mode 100644 index 00000000000..e926fe15b5a --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakehealth/get/FakehealthGetResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakehealth.get; + +import org.openapijsonschematools.client.paths.fakehealth.get.responses.FakehealthGetCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakehealthGetResponses { + public sealed interface EndpointResponse permits EndpointFakehealthGetCode200Response {} + + public record EndpointFakehealthGetCode200Response( + HttpResponse response, + FakehealthGetCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakehealthGetCode200ResponseDeserializer {} + + public static final class StatusFakehealthGetCode200ResponseDeserializer extends FakehealthGetCode200Response.FakehealthGetCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakehealthGetResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakehealthGetResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakehealthGetCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakehealthGetCode200ResponseDeserializer castDeserializer = (StatusFakehealthGetCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakehealthGetCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakehealth/get/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakehealth/get/Responses.java deleted file mode 100644 index 60cdc4cf144..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakehealth/get/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakehealth.get; - -import org.openapijsonschematools.client.paths.fakehealth.get.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakehealth/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakehealth/get/responses/Code200Response.java deleted file mode 100644 index 1de1e383c20..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakehealth/get/responses/Code200Response.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakehealth.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakehealth.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.HealthCheckResult1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakehealth/get/responses/FakehealthGetCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakehealth/get/responses/FakehealthGetCode200Response.java new file mode 100644 index 00000000000..1d60e2ef28d --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakehealth/get/responses/FakehealthGetCode200Response.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakehealth.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakehealth.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakehealthGetCode200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.HealthCheckResult1Boxed body) implements SealedResponseBody { } + + public static class FakehealthGetCode200Response1 extends ResponseDeserializer { + public FakehealthGetCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/FakeinlineadditionalpropertiesPost.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/FakeinlineadditionalpropertiesPost.java new file mode 100644 index 00000000000..9eaf3f07fe2 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/FakeinlineadditionalpropertiesPost.java @@ -0,0 +1,183 @@ +package org.openapijsonschematools.client.paths.fakeinlineadditionalproperties; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post.FakeinlineadditionalpropertiesPostRequestBody; +import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post.FakeinlineadditionalpropertiesPostResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Fakeinlineadditionalproperties; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakeinlineadditionalpropertiesPost { + private static class PostProvider { + private static final String method = "post"; + + public static FakeinlineadditionalpropertiesPostResponses.EndpointResponse post( + PostRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + SerializedRequestBody serializedRequestBody = new FakeinlineadditionalpropertiesPostRequestBody.FakeinlineadditionalpropertiesPostRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakeinlineadditionalproperties.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakeinlineadditionalpropertiesPostResponses.FakeinlineadditionalpropertiesPostResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PostOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakeinlineadditionalpropertiesPostResponses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface InlineAdditionalPropertiesOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakeinlineadditionalpropertiesPostResponses.EndpointResponse inlineAdditionalProperties(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Post extends ApiClient implements PostOperation { + public Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PostRequest { + public FakeinlineadditionalpropertiesPostRequestBody.SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + + public PostRequest( + FakeinlineadditionalpropertiesPostRequestBody.SealedRequestBody requestBody, + RootServerInfo.@Nullable ServerIndex serverIndex, + @Nullable Duration timeout + ) { + this.requestBody = requestBody; + this.serverIndex = serverIndex; + this.timeout = timeout; + } + } + + public static class PostNullableRequest { + public FakeinlineadditionalpropertiesPostRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + PostNullableRequest getInstance(); + T getBuilderAfterServerIndex(PostNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PostNullableRequest getInstance(); + T getBuilderAfterTimeout(PostNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForRequestBody { + PostNullableRequest getInstance(); + T getBuilderAfterRequestBody(PostNullableRequest instance); + default T requestBody(FakeinlineadditionalpropertiesPostRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public static class Post0RequestBuilder implements SetterForServerIndex, SetterForTimeout { + private final PostNullableRequest instance; + + public Post0RequestBuilder(PostNullableRequest instance) { + this.instance = instance; + } + + public PostRequest build() { + var requestBody = instance.requestBody; + if (requestBody == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new PostRequest( + requestBody, + instance.serverIndex, + instance.timeout + ); + } + + public PostNullableRequest getInstance() { + return instance; + } + + public Post0RequestBuilder getBuilderAfterServerIndex(PostNullableRequest instance) { + return this; + } + + public Post0RequestBuilder getBuilderAfterTimeout(PostNullableRequest instance) { + return this; + } + } + public static class PostRequestBuilder implements SetterForRequestBody { + private final PostNullableRequest instance; + + public PostRequestBuilder() { + this.instance = new PostNullableRequest(); + } + + public PostNullableRequest getInstance() { + return instance; + } + + public Post0RequestBuilder getBuilderAfterRequestBody(PostNullableRequest instance) { + return new Post0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/Post.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/Post.java deleted file mode 100644 index 6b9aec9067f..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/Post.java +++ /dev/null @@ -1,174 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeinlineadditionalproperties; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post.RequestBody; -import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Fakeinlineadditionalproperties; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Post { - private static class PostProvider { - private static final String method = "post"; - - public static Responses.EndpointResponse post( - PostRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - SerializedRequestBody serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakeinlineadditionalproperties.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PostOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Post1 extends ApiClient implements PostOperation { - public Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PostRequest { - public RequestBody.SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - - public PostRequest( - RequestBody.SealedRequestBody requestBody, - RootServerInfo.@Nullable ServerIndex serverIndex, - @Nullable Duration timeout - ) { - this.requestBody = requestBody; - this.serverIndex = serverIndex; - this.timeout = timeout; - } - } - - public static class PostNullableRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - PostNullableRequest getInstance(); - T getBuilderAfterServerIndex(PostNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PostNullableRequest getInstance(); - T getBuilderAfterTimeout(PostNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForRequestBody { - PostNullableRequest getInstance(); - T getBuilderAfterRequestBody(PostNullableRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public static class Post0RequestBuilder implements SetterForServerIndex, SetterForTimeout { - private final PostNullableRequest instance; - - public Post0RequestBuilder(PostNullableRequest instance) { - this.instance = instance; - } - - public PostRequest build() { - var requestBody = instance.requestBody; - if (requestBody == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new PostRequest( - requestBody, - instance.serverIndex, - instance.timeout - ); - } - - public PostNullableRequest getInstance() { - return instance; - } - - public Post0RequestBuilder getBuilderAfterServerIndex(PostNullableRequest instance) { - return this; - } - - public Post0RequestBuilder getBuilderAfterTimeout(PostNullableRequest instance) { - return this; - } - } - public static class PostRequestBuilder implements SetterForRequestBody { - private final PostNullableRequest instance; - - public PostRequestBuilder() { - this.instance = new PostNullableRequest(); - } - - public PostNullableRequest getInstance() { - return instance; - } - - public Post0RequestBuilder getBuilderAfterRequestBody(PostNullableRequest instance) { - return new Post0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/FakeinlineadditionalpropertiesPostRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/FakeinlineadditionalpropertiesPostRequestBody.java new file mode 100644 index 00000000000..6c4c153915a --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/FakeinlineadditionalpropertiesPostRequestBody.java @@ -0,0 +1,53 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post.requestbody.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class FakeinlineadditionalpropertiesPostRequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class FakeinlineadditionalpropertiesPostRequestBody1 extends RequestBodySerializer { + public FakeinlineadditionalpropertiesPostRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ), + true + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } + } + + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.ApplicationjsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "application/json"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/FakeinlineadditionalpropertiesPostResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/FakeinlineadditionalpropertiesPostResponses.java new file mode 100644 index 00000000000..2fa1bf18e40 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/FakeinlineadditionalpropertiesPostResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post; + +import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post.responses.FakeinlineadditionalpropertiesPostCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakeinlineadditionalpropertiesPostResponses { + public sealed interface EndpointResponse permits EndpointFakeinlineadditionalpropertiesPostCode200Response {} + + public record EndpointFakeinlineadditionalpropertiesPostCode200Response( + HttpResponse response, + Void body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakeinlineadditionalpropertiesPostCode200ResponseDeserializer {} + + public static final class StatusFakeinlineadditionalpropertiesPostCode200ResponseDeserializer extends FakeinlineadditionalpropertiesPostCode200Response.FakeinlineadditionalpropertiesPostCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakeinlineadditionalpropertiesPostResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakeinlineadditionalpropertiesPostResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakeinlineadditionalpropertiesPostCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakeinlineadditionalpropertiesPostCode200ResponseDeserializer castDeserializer = (StatusFakeinlineadditionalpropertiesPostCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakeinlineadditionalpropertiesPostCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/RequestBody.java deleted file mode 100644 index 85529afa41c..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/RequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post.requestbody.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ), - true - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } - } - - public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} - public record ApplicationjsonRequestBody(ApplicationjsonSchema.ApplicationjsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "application/json"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/Responses.java deleted file mode 100644 index aa94f2fbb73..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post; - -import org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/responses/Code200Response.java deleted file mode 100644 index ce64200111e..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/responses/Code200Response.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post.responses; - -import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; - -public class Code200Response extends SuccessDescriptionOnly { - public static class Code200Response1 extends SuccessDescriptionOnly1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/responses/FakeinlineadditionalpropertiesPostCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/responses/FakeinlineadditionalpropertiesPostCode200Response.java new file mode 100644 index 00000000000..f3f0c8ae16c --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlineadditionalproperties/post/responses/FakeinlineadditionalpropertiesPostCode200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.fakeinlineadditionalproperties.post.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class FakeinlineadditionalpropertiesPostCode200Response extends SuccessDescriptionOnly { + public static class FakeinlineadditionalpropertiesPostCode200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/FakeinlinecompositionPost.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/FakeinlinecompositionPost.java new file mode 100644 index 00000000000..ce21538668b --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/FakeinlinecompositionPost.java @@ -0,0 +1,176 @@ +package org.openapijsonschematools.client.paths.fakeinlinecomposition; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.FakeinlinecompositionPostRequestBody; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.FakeinlinecompositionPostQueryParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.Parameters; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.FakeinlinecompositionPostResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Fakeinlinecomposition; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakeinlinecompositionPost { + private static class PostProvider { + private static final String method = "post"; + + public static FakeinlinecompositionPostResponses.EndpointResponse post( + PostRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + @Nullable SerializedRequestBody serializedRequestBody; + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + if (request.requestBody != null) { + serializedRequestBody = new FakeinlinecompositionPostRequestBody.FakeinlinecompositionPostRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + bodyPublisher = serializedRequestBody.bodyPublisher; + } + + var querySerializer = new Parameters.QueryParametersSerializer(); + @Nullable Map queryMap = null; + if (request.queryParameters != null) { + queryMap = querySerializer.getQueryMap(request.queryParameters); + } + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakeinlinecomposition.path; + if (queryMap != null) { + url = url + querySerializer.serialize(queryMap); + } + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakeinlinecompositionPostResponses.FakeinlinecompositionPostResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PostOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakeinlinecompositionPostResponses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface InlineCompositionOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakeinlinecompositionPostResponses.EndpointResponse inlineComposition(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Post extends ApiClient implements PostOperation { + public Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PostRequest { + public FakeinlinecompositionPostRequestBody.@Nullable SealedRequestBody requestBody; + public FakeinlinecompositionPostQueryParameters.@Nullable FakeinlinecompositionPostQueryParametersMap queryParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForRequestBody { + PostRequest getInstance(); + T getBuilderAfterRequestBody(PostRequest instance); + default T requestBody(FakeinlinecompositionPostRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public interface SetterForQueryParameters { + PostRequest getInstance(); + T getBuilderAfterQueryParameters(PostRequest instance); + default T queryParameters(FakeinlinecompositionPostQueryParameters.FakeinlinecompositionPostQueryParametersMap queryParameters) { + var instance = getInstance(); + instance.queryParameters = queryParameters; + return getBuilderAfterQueryParameters(instance); + } + } + + public interface SetterForServerIndex { + PostRequest getInstance(); + T getBuilderAfterServerIndex(PostRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PostRequest getInstance(); + T getBuilderAfterTimeout(PostRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class PostRequestBuilder implements SetterForRequestBody, SetterForQueryParameters, SetterForServerIndex, SetterForTimeout { + private final PostRequest instance; + + public PostRequestBuilder() { + this.instance = new PostRequest(); + } + + public PostRequest build() { + return instance; + } + + public PostRequest getInstance() { + return instance; + } + + public PostRequestBuilder getBuilderAfterRequestBody(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterQueryParameters(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterServerIndex(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterTimeout(PostRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/Post.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/Post.java deleted file mode 100644 index 06f4d279174..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/Post.java +++ /dev/null @@ -1,167 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeinlinecomposition; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.RequestBody; -import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.QueryParameters; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.Parameters; -import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Fakeinlinecomposition; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Post { - private static class PostProvider { - private static final String method = "post"; - - public static Responses.EndpointResponse post( - PostRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - @Nullable SerializedRequestBody serializedRequestBody; - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - if (request.requestBody != null) { - serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - bodyPublisher = serializedRequestBody.bodyPublisher; - } - - var querySerializer = new Parameters.QueryParametersSerializer(); - @Nullable Map queryMap = null; - if (request.queryParameters != null) { - queryMap = querySerializer.getQueryMap(request.queryParameters); - } - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakeinlinecomposition.path; - if (queryMap != null) { - url = url + querySerializer.serialize(queryMap); - } - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PostOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Post1 extends ApiClient implements PostOperation { - public Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PostRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public QueryParameters.@Nullable QueryParametersMap queryParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForRequestBody { - PostRequest getInstance(); - T getBuilderAfterRequestBody(PostRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public interface SetterForQueryParameters { - PostRequest getInstance(); - T getBuilderAfterQueryParameters(PostRequest instance); - default T queryParameters(QueryParameters.QueryParametersMap queryParameters) { - var instance = getInstance(); - instance.queryParameters = queryParameters; - return getBuilderAfterQueryParameters(instance); - } - } - - public interface SetterForServerIndex { - PostRequest getInstance(); - T getBuilderAfterServerIndex(PostRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PostRequest getInstance(); - T getBuilderAfterTimeout(PostRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class PostRequestBuilder implements SetterForRequestBody, SetterForQueryParameters, SetterForServerIndex, SetterForTimeout { - private final PostRequest instance; - - public PostRequestBuilder() { - this.instance = new PostRequest(); - } - - public PostRequest build() { - return instance; - } - - public PostRequest getInstance() { - return instance; - } - - public PostRequestBuilder getBuilderAfterRequestBody(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterQueryParameters(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterServerIndex(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterTimeout(PostRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/FakeinlinecompositionPostQueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/FakeinlinecompositionPostQueryParameters.java new file mode 100644 index 00000000000..445cd00fb69 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/FakeinlinecompositionPostQueryParameters.java @@ -0,0 +1,270 @@ +package org.openapijsonschematools.client.paths.fakeinlinecomposition.post; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.parameters.parameter0.Schema0; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.parameters.parameter1.Schema1; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class FakeinlinecompositionPostQueryParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class FakeinlinecompositionPostadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable FakeinlinecompositionPostadditionalProperties instance = null; + public static FakeinlinecompositionPostadditionalProperties getInstance() { + if (instance == null) { + instance = new FakeinlinecompositionPostadditionalProperties(); + } + return instance; + } + } + + + public static class FakeinlinecompositionPostQueryParametersMap extends FrozenMap<@Nullable Object> { + protected FakeinlinecompositionPostQueryParametersMap(FrozenMap<@Nullable Object> m) { + super(m); + } + public static final Set requiredKeys = Set.of(); + public static final Set optionalKeys = Set.of( + "compositionAtRoot", + "compositionInProperty" + ); + public static FakeinlinecompositionPostQueryParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return FakeinlinecompositionPostQueryParameters1.getInstance().validate(arg, configuration); + } + + public @Nullable Object compositionAtRoot() throws UnsetPropertyException { + String key = "compositionAtRoot"; + throwIfKeyNotPresent(key); + @Nullable Object value = get(key); + if (!(value instanceof Object)) { + throw new RuntimeException("Invalid value stored for compositionAtRoot"); + } + return (@Nullable Object) value; + } + + public Schema1.SchemaMap1 compositionInProperty() throws UnsetPropertyException { + String key = "compositionInProperty"; + throwIfKeyNotPresent(key); + @Nullable Object value = get(key); + if (!(value instanceof Schema1.SchemaMap1)) { + throw new RuntimeException("Invalid value stored for compositionInProperty"); + } + return (Schema1.SchemaMap1) value; + } + } + + public interface SetterForFakeinlinecompositionPostcompositionAtRoot { + Map getInstance(); + T getBuilderAfterFakeinlinecompositionPostcompositionAtRoot(Map instance); + + default T compositionAtRoot(Void value) { + var instance = getInstance(); + instance.put("compositionAtRoot", null); + return getBuilderAfterFakeinlinecompositionPostcompositionAtRoot(instance); + } + + default T compositionAtRoot(boolean value) { + var instance = getInstance(); + instance.put("compositionAtRoot", value); + return getBuilderAfterFakeinlinecompositionPostcompositionAtRoot(instance); + } + + default T compositionAtRoot(String value) { + var instance = getInstance(); + instance.put("compositionAtRoot", value); + return getBuilderAfterFakeinlinecompositionPostcompositionAtRoot(instance); + } + + default T compositionAtRoot(int value) { + var instance = getInstance(); + instance.put("compositionAtRoot", value); + return getBuilderAfterFakeinlinecompositionPostcompositionAtRoot(instance); + } + + default T compositionAtRoot(float value) { + var instance = getInstance(); + instance.put("compositionAtRoot", value); + return getBuilderAfterFakeinlinecompositionPostcompositionAtRoot(instance); + } + + default T compositionAtRoot(long value) { + var instance = getInstance(); + instance.put("compositionAtRoot", value); + return getBuilderAfterFakeinlinecompositionPostcompositionAtRoot(instance); + } + + default T compositionAtRoot(double value) { + var instance = getInstance(); + instance.put("compositionAtRoot", value); + return getBuilderAfterFakeinlinecompositionPostcompositionAtRoot(instance); + } + + default T compositionAtRoot(List value) { + var instance = getInstance(); + instance.put("compositionAtRoot", value); + return getBuilderAfterFakeinlinecompositionPostcompositionAtRoot(instance); + } + + default T compositionAtRoot(Map value) { + var instance = getInstance(); + instance.put("compositionAtRoot", value); + return getBuilderAfterFakeinlinecompositionPostcompositionAtRoot(instance); + } + } + + public interface SetterForFakeinlinecompositionPostcompositionInProperty { + Map getInstance(); + T getBuilderAfterFakeinlinecompositionPostcompositionInProperty(Map instance); + + default T compositionInProperty(Map value) { + var instance = getInstance(); + instance.put("compositionInProperty", value); + return getBuilderAfterFakeinlinecompositionPostcompositionInProperty(instance); + } + } + + public static class FakeinlinecompositionPostQueryParametersMapBuilder implements GenericBuilder>, SetterForFakeinlinecompositionPostcompositionAtRoot, SetterForFakeinlinecompositionPostcompositionInProperty { + private final Map instance; + private static final Set knownKeys = Set.of( + "compositionAtRoot", + "compositionInProperty" + ); + public Set getKnownKeys() { + return knownKeys; + } + public FakeinlinecompositionPostQueryParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map build() { + return instance; + } + public Map getInstance() { + return instance; + } + public FakeinlinecompositionPostQueryParametersMapBuilder getBuilderAfterFakeinlinecompositionPostcompositionAtRoot(Map instance) { + return this; + } + public FakeinlinecompositionPostQueryParametersMapBuilder getBuilderAfterFakeinlinecompositionPostcompositionInProperty(Map instance) { + return this; + } + } + + + public sealed interface FakeinlinecompositionPostQueryParameters1Boxed permits FakeinlinecompositionPostQueryParameters1BoxedMap { + @Nullable Object getData(); + } + + public record FakeinlinecompositionPostQueryParameters1BoxedMap(FakeinlinecompositionPostQueryParametersMap data) implements FakeinlinecompositionPostQueryParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class FakeinlinecompositionPostQueryParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable FakeinlinecompositionPostQueryParameters1 instance = null; + + protected FakeinlinecompositionPostQueryParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("compositionAtRoot", Schema0.Schema01.class), + new PropertyEntry("compositionInProperty", Schema1.Schema11.class) + )) + .additionalProperties(FakeinlinecompositionPostadditionalProperties.class) + ); + } + + public static FakeinlinecompositionPostQueryParameters1 getInstance() { + if (instance == null) { + instance = new FakeinlinecompositionPostQueryParameters1(); + } + return instance; + } + + public FakeinlinecompositionPostQueryParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + properties.put(propertyName, propertyInstance); + } + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); + return new FakeinlinecompositionPostQueryParametersMap(castProperties); + } + + public FakeinlinecompositionPostQueryParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public FakeinlinecompositionPostQueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new FakeinlinecompositionPostQueryParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public FakeinlinecompositionPostQueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/FakeinlinecompositionPostRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/FakeinlinecompositionPostRequestBody.java new file mode 100644 index 00000000000..3dd064dc81c --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/FakeinlinecompositionPostRequestBody.java @@ -0,0 +1,75 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.fakeinlinecomposition.post; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.requestbody.content.applicationjson.ApplicationjsonSchema; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.requestbody.content.multipartformdata.MultipartformdataSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class FakeinlinecompositionPostRequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType, MultipartformdataMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public record MultipartformdataMediaType(MultipartformdataSchema.MultipartformdataSchema1 schema) implements SealedMediaType, MediaType { + public MultipartformdataMediaType() { + this(MultipartformdataSchema.MultipartformdataSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class FakeinlinecompositionPostRequestBody1 extends RequestBodySerializer { + public FakeinlinecompositionPostRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()), + new AbstractMap.SimpleEntry<>("multipart/form-data", new MultipartformdataMediaType()) + ), + false + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + if (requestBody instanceof ApplicationjsonRequestBody requestBody0) { + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } else { + MultipartformdataRequestBody requestBody1 = (MultipartformdataRequestBody) requestBody; + return serialize(requestBody1.contentType(), requestBody1.body().getData()); + } + } + } + + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody, MultipartformdataRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.ApplicationjsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "application/json"; + } + } + public record MultipartformdataRequestBody(MultipartformdataSchema.MultipartformdataSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "multipart/form-data"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/FakeinlinecompositionPostResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/FakeinlinecompositionPostResponses.java new file mode 100644 index 00000000000..a1799f4cc66 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/FakeinlinecompositionPostResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakeinlinecomposition.post; + +import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.responses.FakeinlinecompositionPostCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakeinlinecompositionPostResponses { + public sealed interface EndpointResponse permits EndpointFakeinlinecompositionPostCode200Response {} + + public record EndpointFakeinlinecompositionPostCode200Response( + HttpResponse response, + FakeinlinecompositionPostCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakeinlinecompositionPostCode200ResponseDeserializer {} + + public static final class StatusFakeinlinecompositionPostCode200ResponseDeserializer extends FakeinlinecompositionPostCode200Response.FakeinlinecompositionPostCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakeinlinecompositionPostResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakeinlinecompositionPostResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakeinlinecompositionPostCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakeinlinecompositionPostCode200ResponseDeserializer castDeserializer = (StatusFakeinlinecompositionPostCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakeinlinecompositionPostCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/QueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/QueryParameters.java deleted file mode 100644 index eb7668fddb7..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/QueryParameters.java +++ /dev/null @@ -1,270 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeinlinecomposition.post; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.parameters.parameter0.Schema0; -import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.parameters.parameter1.Schema1; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class QueryParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class QueryParametersMap extends FrozenMap<@Nullable Object> { - protected QueryParametersMap(FrozenMap<@Nullable Object> m) { - super(m); - } - public static final Set requiredKeys = Set.of(); - public static final Set optionalKeys = Set.of( - "compositionAtRoot", - "compositionInProperty" - ); - public static QueryParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return QueryParameters1.getInstance().validate(arg, configuration); - } - - public @Nullable Object compositionAtRoot() throws UnsetPropertyException { - String key = "compositionAtRoot"; - throwIfKeyNotPresent(key); - @Nullable Object value = get(key); - if (!(value instanceof Object)) { - throw new RuntimeException("Invalid value stored for compositionAtRoot"); - } - return (@Nullable Object) value; - } - - public Schema1.SchemaMap1 compositionInProperty() throws UnsetPropertyException { - String key = "compositionInProperty"; - throwIfKeyNotPresent(key); - @Nullable Object value = get(key); - if (!(value instanceof Schema1.SchemaMap1)) { - throw new RuntimeException("Invalid value stored for compositionInProperty"); - } - return (Schema1.SchemaMap1) value; - } - } - - public interface SetterForCompositionAtRoot { - Map getInstance(); - T getBuilderAfterCompositionAtRoot(Map instance); - - default T compositionAtRoot(Void value) { - var instance = getInstance(); - instance.put("compositionAtRoot", null); - return getBuilderAfterCompositionAtRoot(instance); - } - - default T compositionAtRoot(boolean value) { - var instance = getInstance(); - instance.put("compositionAtRoot", value); - return getBuilderAfterCompositionAtRoot(instance); - } - - default T compositionAtRoot(String value) { - var instance = getInstance(); - instance.put("compositionAtRoot", value); - return getBuilderAfterCompositionAtRoot(instance); - } - - default T compositionAtRoot(int value) { - var instance = getInstance(); - instance.put("compositionAtRoot", value); - return getBuilderAfterCompositionAtRoot(instance); - } - - default T compositionAtRoot(float value) { - var instance = getInstance(); - instance.put("compositionAtRoot", value); - return getBuilderAfterCompositionAtRoot(instance); - } - - default T compositionAtRoot(long value) { - var instance = getInstance(); - instance.put("compositionAtRoot", value); - return getBuilderAfterCompositionAtRoot(instance); - } - - default T compositionAtRoot(double value) { - var instance = getInstance(); - instance.put("compositionAtRoot", value); - return getBuilderAfterCompositionAtRoot(instance); - } - - default T compositionAtRoot(List value) { - var instance = getInstance(); - instance.put("compositionAtRoot", value); - return getBuilderAfterCompositionAtRoot(instance); - } - - default T compositionAtRoot(Map value) { - var instance = getInstance(); - instance.put("compositionAtRoot", value); - return getBuilderAfterCompositionAtRoot(instance); - } - } - - public interface SetterForCompositionInProperty { - Map getInstance(); - T getBuilderAfterCompositionInProperty(Map instance); - - default T compositionInProperty(Map value) { - var instance = getInstance(); - instance.put("compositionInProperty", value); - return getBuilderAfterCompositionInProperty(instance); - } - } - - public static class QueryParametersMapBuilder implements GenericBuilder>, SetterForCompositionAtRoot, SetterForCompositionInProperty { - private final Map instance; - private static final Set knownKeys = Set.of( - "compositionAtRoot", - "compositionInProperty" - ); - public Set getKnownKeys() { - return knownKeys; - } - public QueryParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map build() { - return instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMapBuilder getBuilderAfterCompositionAtRoot(Map instance) { - return this; - } - public QueryParametersMapBuilder getBuilderAfterCompositionInProperty(Map instance) { - return this; - } - } - - - public sealed interface QueryParameters1Boxed permits QueryParameters1BoxedMap { - @Nullable Object getData(); - } - - public record QueryParameters1BoxedMap(QueryParametersMap data) implements QueryParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable QueryParameters1 instance = null; - - protected QueryParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("compositionAtRoot", Schema0.Schema01.class), - new PropertyEntry("compositionInProperty", Schema1.Schema11.class) - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static QueryParameters1 getInstance() { - if (instance == null) { - instance = new QueryParameters1(); - } - return instance; - } - - public QueryParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, propertyInstance); - } - FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); - return new QueryParametersMap(castProperties); - } - - public QueryParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public QueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new QueryParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public QueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/RequestBody.java deleted file mode 100644 index 0264be90b7b..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/RequestBody.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.fakeinlinecomposition.post; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.requestbody.content.applicationjson.ApplicationjsonSchema; -import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.requestbody.content.multipartformdata.MultipartformdataSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits ApplicationjsonMediaType, MultipartformdataMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public record MultipartformdataMediaType(MultipartformdataSchema.MultipartformdataSchema1 schema) implements SealedMediaType, MediaType { - public MultipartformdataMediaType() { - this(MultipartformdataSchema.MultipartformdataSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()), - new AbstractMap.SimpleEntry<>("multipart/form-data", new MultipartformdataMediaType()) - ), - false - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - if (requestBody instanceof ApplicationjsonRequestBody requestBody0) { - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } else { - MultipartformdataRequestBody requestBody1 = (MultipartformdataRequestBody) requestBody; - return serialize(requestBody1.contentType(), requestBody1.body().getData()); - } - } - } - - public sealed interface SealedRequestBody permits ApplicationjsonRequestBody, MultipartformdataRequestBody {} - public record ApplicationjsonRequestBody(ApplicationjsonSchema.ApplicationjsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "application/json"; - } - } - public record MultipartformdataRequestBody(MultipartformdataSchema.MultipartformdataSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "multipart/form-data"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/Responses.java deleted file mode 100644 index ce85d87ccd8..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeinlinecomposition.post; - -import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/Code200Response.java deleted file mode 100644 index d8bdbbf90a7..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/Code200Response.java +++ /dev/null @@ -1,81 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeinlinecomposition.post.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; -import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.responses.code200response.content.multipartformdata.MultipartformdataSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationjsonMediaType, MultipartformdataMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public record MultipartformdataMediaType(MultipartformdataSchema.MultipartformdataSchema1 schema) implements SealedMediaType, MediaType { - public MultipartformdataMediaType() { - this(MultipartformdataSchema.MultipartformdataSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody, MultipartformdataResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.ApplicationjsonSchema1Boxed body) implements SealedResponseBody { } - public record MultipartformdataResponseBody(MultipartformdataSchema.MultipartformdataSchema1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()), - new AbstractMap.SimpleEntry<>("multipart/form-data", new MultipartformdataMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } else { - MultipartformdataMediaType thisMediaType = (MultipartformdataMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new MultipartformdataResponseBody(deserializedBody); - } - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/FakeinlinecompositionPostCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/FakeinlinecompositionPostCode200Response.java new file mode 100644 index 00000000000..11da1d76b4a --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeinlinecomposition/post/responses/FakeinlinecompositionPostCode200Response.java @@ -0,0 +1,81 @@ +package org.openapijsonschematools.client.paths.fakeinlinecomposition.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; +import org.openapijsonschematools.client.paths.fakeinlinecomposition.post.responses.code200response.content.multipartformdata.MultipartformdataSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakeinlinecompositionPostCode200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType, MultipartformdataMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public record MultipartformdataMediaType(MultipartformdataSchema.MultipartformdataSchema1 schema) implements SealedMediaType, MediaType { + public MultipartformdataMediaType() { + this(MultipartformdataSchema.MultipartformdataSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody, MultipartformdataResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.ApplicationjsonSchema1Boxed body) implements SealedResponseBody { } + public record MultipartformdataResponseBody(MultipartformdataSchema.MultipartformdataSchema1Boxed body) implements SealedResponseBody { } + + public static class FakeinlinecompositionPostCode200Response1 extends ResponseDeserializer { + public FakeinlinecompositionPostCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()), + new AbstractMap.SimpleEntry<>("multipart/form-data", new MultipartformdataMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + if (mediaType instanceof ApplicationjsonMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } else { + MultipartformdataMediaType thisMediaType = (MultipartformdataMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new MultipartformdataResponseBody(deserializedBody); + } + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/FakejsonformdataGet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/FakejsonformdataGet.java new file mode 100644 index 00000000000..d0ab6bd7642 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/FakejsonformdataGet.java @@ -0,0 +1,152 @@ +package org.openapijsonschematools.client.paths.fakejsonformdata; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.fakejsonformdata.get.FakejsonformdataGetRequestBody; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakejsonformdata.get.FakejsonformdataGetResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Fakejsonformdata; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakejsonformdataGet { + private static class GetProvider { + private static final String method = "get"; + + public static FakejsonformdataGetResponses.EndpointResponse get( + GetRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + @Nullable SerializedRequestBody serializedRequestBody; + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + if (request.requestBody != null) { + serializedRequestBody = new FakejsonformdataGetRequestBody.FakejsonformdataGetRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + bodyPublisher = serializedRequestBody.bodyPublisher; + } + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakejsonformdata.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakejsonformdataGetResponses.FakejsonformdataGetResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface GetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakejsonformdataGetResponses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface JsonFormDataOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakejsonformdataGetResponses.EndpointResponse jsonFormData(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Get extends ApiClient implements GetOperation { + public Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class GetRequest { + public FakejsonformdataGetRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForRequestBody { + GetRequest getInstance(); + T getBuilderAfterRequestBody(GetRequest instance); + default T requestBody(FakejsonformdataGetRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public interface SetterForServerIndex { + GetRequest getInstance(); + T getBuilderAfterServerIndex(GetRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + GetRequest getInstance(); + T getBuilderAfterTimeout(GetRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class GetRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { + private final GetRequest instance; + + public GetRequestBuilder() { + this.instance = new GetRequest(); + } + + public GetRequest build() { + return instance; + } + + public GetRequest getInstance() { + return instance; + } + + public GetRequestBuilder getBuilderAfterRequestBody(GetRequest instance) { + return this; + } + + public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { + return this; + } + + public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/Get.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/Get.java deleted file mode 100644 index 7f09ba7a1f4..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/Get.java +++ /dev/null @@ -1,143 +0,0 @@ -package org.openapijsonschematools.client.paths.fakejsonformdata; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.fakejsonformdata.get.RequestBody; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakejsonformdata.get.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Fakejsonformdata; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Get { - private static class GetProvider { - private static final String method = "get"; - - public static Responses.EndpointResponse get( - GetRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - @Nullable SerializedRequestBody serializedRequestBody; - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - if (request.requestBody != null) { - serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - bodyPublisher = serializedRequestBody.bodyPublisher; - } - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakejsonformdata.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface GetOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Get1 extends ApiClient implements GetOperation { - public Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class GetRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForRequestBody { - GetRequest getInstance(); - T getBuilderAfterRequestBody(GetRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public interface SetterForServerIndex { - GetRequest getInstance(); - T getBuilderAfterServerIndex(GetRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - GetRequest getInstance(); - T getBuilderAfterTimeout(GetRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class GetRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { - private final GetRequest instance; - - public GetRequestBuilder() { - this.instance = new GetRequest(); - } - - public GetRequest build() { - return instance; - } - - public GetRequest getInstance() { - return instance; - } - - public GetRequestBuilder getBuilderAfterRequestBody(GetRequest instance) { - return this; - } - - public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { - return this; - } - - public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/FakejsonformdataGetRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/FakejsonformdataGetRequestBody.java new file mode 100644 index 00000000000..e479c67b45a --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/FakejsonformdataGetRequestBody.java @@ -0,0 +1,53 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.fakejsonformdata.get; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakejsonformdata.get.requestbody.content.applicationxwwwformurlencoded.ApplicationxwwwformurlencodedSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class FakejsonformdataGetRequestBody { + public sealed interface SealedMediaType permits ApplicationxwwwformurlencodedMediaType {} + + public record ApplicationxwwwformurlencodedMediaType(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationxwwwformurlencodedMediaType() { + this(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class FakejsonformdataGetRequestBody1 extends RequestBodySerializer { + public FakejsonformdataGetRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/x-www-form-urlencoded", new ApplicationxwwwformurlencodedMediaType()) + ), + false + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + ApplicationxwwwformurlencodedRequestBody requestBody0 = (ApplicationxwwwformurlencodedRequestBody) requestBody; + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } + } + + public sealed interface SealedRequestBody permits ApplicationxwwwformurlencodedRequestBody {} + public record ApplicationxwwwformurlencodedRequestBody(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "application/x-www-form-urlencoded"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/FakejsonformdataGetResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/FakejsonformdataGetResponses.java new file mode 100644 index 00000000000..eb89e916396 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/FakejsonformdataGetResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakejsonformdata.get; + +import org.openapijsonschematools.client.paths.fakejsonformdata.get.responses.FakejsonformdataGetCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakejsonformdataGetResponses { + public sealed interface EndpointResponse permits EndpointFakejsonformdataGetCode200Response {} + + public record EndpointFakejsonformdataGetCode200Response( + HttpResponse response, + Void body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakejsonformdataGetCode200ResponseDeserializer {} + + public static final class StatusFakejsonformdataGetCode200ResponseDeserializer extends FakejsonformdataGetCode200Response.FakejsonformdataGetCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakejsonformdataGetResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakejsonformdataGetResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakejsonformdataGetCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakejsonformdataGetCode200ResponseDeserializer castDeserializer = (StatusFakejsonformdataGetCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakejsonformdataGetCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/RequestBody.java deleted file mode 100644 index 50a121737b4..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/RequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.fakejsonformdata.get; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakejsonformdata.get.requestbody.content.applicationxwwwformurlencoded.ApplicationxwwwformurlencodedSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits ApplicationxwwwformurlencodedMediaType {} - - public record ApplicationxwwwformurlencodedMediaType(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationxwwwformurlencodedMediaType() { - this(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/x-www-form-urlencoded", new ApplicationxwwwformurlencodedMediaType()) - ), - false - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - ApplicationxwwwformurlencodedRequestBody requestBody0 = (ApplicationxwwwformurlencodedRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } - } - - public sealed interface SealedRequestBody permits ApplicationxwwwformurlencodedRequestBody {} - public record ApplicationxwwwformurlencodedRequestBody(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "application/x-www-form-urlencoded"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/Responses.java deleted file mode 100644 index f583e035a7d..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakejsonformdata.get; - -import org.openapijsonschematools.client.paths.fakejsonformdata.get.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/responses/Code200Response.java deleted file mode 100644 index 7973ff46632..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/responses/Code200Response.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.openapijsonschematools.client.paths.fakejsonformdata.get.responses; - -import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; - -public class Code200Response extends SuccessDescriptionOnly { - public static class Code200Response1 extends SuccessDescriptionOnly1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/responses/FakejsonformdataGetCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/responses/FakejsonformdataGetCode200Response.java new file mode 100644 index 00000000000..ea7665e2152 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonformdata/get/responses/FakejsonformdataGetCode200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.fakejsonformdata.get.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class FakejsonformdataGetCode200Response extends SuccessDescriptionOnly { + public static class FakejsonformdataGetCode200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/FakejsonpatchPatch.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/FakejsonpatchPatch.java new file mode 100644 index 00000000000..a13ac896280 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/FakejsonpatchPatch.java @@ -0,0 +1,152 @@ +package org.openapijsonschematools.client.paths.fakejsonpatch; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.fakejsonpatch.patch.FakejsonpatchPatchRequestBody; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakejsonpatch.patch.FakejsonpatchPatchResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Fakejsonpatch; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakejsonpatchPatch { + private static class PatchProvider { + private static final String method = "patch"; + + public static FakejsonpatchPatchResponses.EndpointResponse patch( + PatchRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + @Nullable SerializedRequestBody serializedRequestBody; + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + if (request.requestBody != null) { + serializedRequestBody = new FakejsonpatchPatchRequestBody.FakejsonpatchPatchRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + bodyPublisher = serializedRequestBody.bodyPublisher; + } + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakejsonpatch.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakejsonpatchPatchResponses.FakejsonpatchPatchResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PatchOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakejsonpatchPatchResponses.EndpointResponse patch(PatchRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PatchProvider.patch(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface JsonPatchOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakejsonpatchPatchResponses.EndpointResponse jsonPatch(PatchRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PatchProvider.patch(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Patch extends ApiClient implements PatchOperation { + public Patch(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PatchRequest { + public FakejsonpatchPatchRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForRequestBody { + PatchRequest getInstance(); + T getBuilderAfterRequestBody(PatchRequest instance); + default T requestBody(FakejsonpatchPatchRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public interface SetterForServerIndex { + PatchRequest getInstance(); + T getBuilderAfterServerIndex(PatchRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PatchRequest getInstance(); + T getBuilderAfterTimeout(PatchRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class PatchRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { + private final PatchRequest instance; + + public PatchRequestBuilder() { + this.instance = new PatchRequest(); + } + + public PatchRequest build() { + return instance; + } + + public PatchRequest getInstance() { + return instance; + } + + public PatchRequestBuilder getBuilderAfterRequestBody(PatchRequest instance) { + return this; + } + + public PatchRequestBuilder getBuilderAfterServerIndex(PatchRequest instance) { + return this; + } + + public PatchRequestBuilder getBuilderAfterTimeout(PatchRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/Patch.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/Patch.java deleted file mode 100644 index 11acaae5b01..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/Patch.java +++ /dev/null @@ -1,143 +0,0 @@ -package org.openapijsonschematools.client.paths.fakejsonpatch; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.fakejsonpatch.patch.RequestBody; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakejsonpatch.patch.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Fakejsonpatch; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Patch { - private static class PatchProvider { - private static final String method = "patch"; - - public static Responses.EndpointResponse patch( - PatchRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - @Nullable SerializedRequestBody serializedRequestBody; - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - if (request.requestBody != null) { - serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - bodyPublisher = serializedRequestBody.bodyPublisher; - } - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakejsonpatch.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PatchOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse patch(PatchRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PatchProvider.patch(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Patch1 extends ApiClient implements PatchOperation { - public Patch1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PatchRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForRequestBody { - PatchRequest getInstance(); - T getBuilderAfterRequestBody(PatchRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public interface SetterForServerIndex { - PatchRequest getInstance(); - T getBuilderAfterServerIndex(PatchRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PatchRequest getInstance(); - T getBuilderAfterTimeout(PatchRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class PatchRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { - private final PatchRequest instance; - - public PatchRequestBuilder() { - this.instance = new PatchRequest(); - } - - public PatchRequest build() { - return instance; - } - - public PatchRequest getInstance() { - return instance; - } - - public PatchRequestBuilder getBuilderAfterRequestBody(PatchRequest instance) { - return this; - } - - public PatchRequestBuilder getBuilderAfterServerIndex(PatchRequest instance) { - return this; - } - - public PatchRequestBuilder getBuilderAfterTimeout(PatchRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/FakejsonpatchPatchRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/FakejsonpatchPatchRequestBody.java new file mode 100644 index 00000000000..081d25adba1 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/FakejsonpatchPatchRequestBody.java @@ -0,0 +1,53 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.fakejsonpatch.patch; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakejsonpatch.patch.requestbody.content.applicationjsonpatchjson.ApplicationjsonpatchjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class FakejsonpatchPatchRequestBody { + public sealed interface SealedMediaType permits ApplicationjsonpatchjsonMediaType {} + + public record ApplicationjsonpatchjsonMediaType(ApplicationjsonpatchjsonSchema.ApplicationjsonpatchjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonpatchjsonMediaType() { + this(ApplicationjsonpatchjsonSchema.ApplicationjsonpatchjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class FakejsonpatchPatchRequestBody1 extends RequestBodySerializer { + public FakejsonpatchPatchRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json-patch+json", new ApplicationjsonpatchjsonMediaType()) + ), + false + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + ApplicationjsonpatchjsonRequestBody requestBody0 = (ApplicationjsonpatchjsonRequestBody) requestBody; + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } + } + + public sealed interface SealedRequestBody permits ApplicationjsonpatchjsonRequestBody {} + public record ApplicationjsonpatchjsonRequestBody(ApplicationjsonpatchjsonSchema.JSONPatchRequest1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "application/json-patch+json"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/FakejsonpatchPatchResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/FakejsonpatchPatchResponses.java new file mode 100644 index 00000000000..f1699dcc589 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/FakejsonpatchPatchResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakejsonpatch.patch; + +import org.openapijsonschematools.client.paths.fakejsonpatch.patch.responses.FakejsonpatchPatchCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakejsonpatchPatchResponses { + public sealed interface EndpointResponse permits EndpointFakejsonpatchPatchCode200Response {} + + public record EndpointFakejsonpatchPatchCode200Response( + HttpResponse response, + Void body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakejsonpatchPatchCode200ResponseDeserializer {} + + public static final class StatusFakejsonpatchPatchCode200ResponseDeserializer extends FakejsonpatchPatchCode200Response.FakejsonpatchPatchCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakejsonpatchPatchResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakejsonpatchPatchResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakejsonpatchPatchCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakejsonpatchPatchCode200ResponseDeserializer castDeserializer = (StatusFakejsonpatchPatchCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakejsonpatchPatchCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/RequestBody.java deleted file mode 100644 index f9b1f076f6b..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/RequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.fakejsonpatch.patch; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakejsonpatch.patch.requestbody.content.applicationjsonpatchjson.ApplicationjsonpatchjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits ApplicationjsonpatchjsonMediaType {} - - public record ApplicationjsonpatchjsonMediaType(ApplicationjsonpatchjsonSchema.ApplicationjsonpatchjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonpatchjsonMediaType() { - this(ApplicationjsonpatchjsonSchema.ApplicationjsonpatchjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json-patch+json", new ApplicationjsonpatchjsonMediaType()) - ), - false - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - ApplicationjsonpatchjsonRequestBody requestBody0 = (ApplicationjsonpatchjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } - } - - public sealed interface SealedRequestBody permits ApplicationjsonpatchjsonRequestBody {} - public record ApplicationjsonpatchjsonRequestBody(ApplicationjsonpatchjsonSchema.JSONPatchRequest1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "application/json-patch+json"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/Responses.java deleted file mode 100644 index 8b8c72ea1e2..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakejsonpatch.patch; - -import org.openapijsonschematools.client.paths.fakejsonpatch.patch.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/responses/Code200Response.java deleted file mode 100644 index 261e52cbb39..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/responses/Code200Response.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.openapijsonschematools.client.paths.fakejsonpatch.patch.responses; - -import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; - -public class Code200Response extends SuccessDescriptionOnly { - public static class Code200Response1 extends SuccessDescriptionOnly1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/responses/FakejsonpatchPatchCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/responses/FakejsonpatchPatchCode200Response.java new file mode 100644 index 00000000000..9c5391108b0 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonpatch/patch/responses/FakejsonpatchPatchCode200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.fakejsonpatch.patch.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class FakejsonpatchPatchCode200Response extends SuccessDescriptionOnly { + public static class FakejsonpatchPatchCode200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/FakejsonwithcharsetPost.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/FakejsonwithcharsetPost.java new file mode 100644 index 00000000000..480a7570011 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/FakejsonwithcharsetPost.java @@ -0,0 +1,152 @@ +package org.openapijsonschematools.client.paths.fakejsonwithcharset; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.fakejsonwithcharset.post.FakejsonwithcharsetPostRequestBody; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakejsonwithcharset.post.FakejsonwithcharsetPostResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Fakejsonwithcharset; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakejsonwithcharsetPost { + private static class PostProvider { + private static final String method = "post"; + + public static FakejsonwithcharsetPostResponses.EndpointResponse post( + PostRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + @Nullable SerializedRequestBody serializedRequestBody; + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + if (request.requestBody != null) { + serializedRequestBody = new FakejsonwithcharsetPostRequestBody.FakejsonwithcharsetPostRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + bodyPublisher = serializedRequestBody.bodyPublisher; + } + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakejsonwithcharset.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakejsonwithcharsetPostResponses.FakejsonwithcharsetPostResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PostOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakejsonwithcharsetPostResponses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface JsonWithCharsetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakejsonwithcharsetPostResponses.EndpointResponse jsonWithCharset(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Post extends ApiClient implements PostOperation { + public Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PostRequest { + public FakejsonwithcharsetPostRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForRequestBody { + PostRequest getInstance(); + T getBuilderAfterRequestBody(PostRequest instance); + default T requestBody(FakejsonwithcharsetPostRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public interface SetterForServerIndex { + PostRequest getInstance(); + T getBuilderAfterServerIndex(PostRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PostRequest getInstance(); + T getBuilderAfterTimeout(PostRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class PostRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { + private final PostRequest instance; + + public PostRequestBuilder() { + this.instance = new PostRequest(); + } + + public PostRequest build() { + return instance; + } + + public PostRequest getInstance() { + return instance; + } + + public PostRequestBuilder getBuilderAfterRequestBody(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterServerIndex(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterTimeout(PostRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/Post.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/Post.java deleted file mode 100644 index 256707d6c16..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/Post.java +++ /dev/null @@ -1,143 +0,0 @@ -package org.openapijsonschematools.client.paths.fakejsonwithcharset; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.fakejsonwithcharset.post.RequestBody; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakejsonwithcharset.post.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Fakejsonwithcharset; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Post { - private static class PostProvider { - private static final String method = "post"; - - public static Responses.EndpointResponse post( - PostRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - @Nullable SerializedRequestBody serializedRequestBody; - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - if (request.requestBody != null) { - serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - bodyPublisher = serializedRequestBody.bodyPublisher; - } - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakejsonwithcharset.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PostOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Post1 extends ApiClient implements PostOperation { - public Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PostRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForRequestBody { - PostRequest getInstance(); - T getBuilderAfterRequestBody(PostRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public interface SetterForServerIndex { - PostRequest getInstance(); - T getBuilderAfterServerIndex(PostRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PostRequest getInstance(); - T getBuilderAfterTimeout(PostRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class PostRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { - private final PostRequest instance; - - public PostRequestBuilder() { - this.instance = new PostRequest(); - } - - public PostRequest build() { - return instance; - } - - public PostRequest getInstance() { - return instance; - } - - public PostRequestBuilder getBuilderAfterRequestBody(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterServerIndex(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterTimeout(PostRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/FakejsonwithcharsetPostRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/FakejsonwithcharsetPostRequestBody.java new file mode 100644 index 00000000000..f0d5ad440d1 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/FakejsonwithcharsetPostRequestBody.java @@ -0,0 +1,53 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.fakejsonwithcharset.post; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakejsonwithcharset.post.requestbody.content.applicationjsoncharsetutf8.Applicationjsoncharsetutf8Schema; + +import java.util.AbstractMap; +import java.util.Map; + +public class FakejsonwithcharsetPostRequestBody { + public sealed interface SealedMediaType permits Applicationjsoncharsetutf8MediaType {} + + public record Applicationjsoncharsetutf8MediaType(Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1 schema) implements SealedMediaType, MediaType { + public Applicationjsoncharsetutf8MediaType() { + this(Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class FakejsonwithcharsetPostRequestBody1 extends RequestBodySerializer { + public FakejsonwithcharsetPostRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json; charset=utf-8", new Applicationjsoncharsetutf8MediaType()) + ), + false + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + Applicationjsoncharsetutf8RequestBody requestBody0 = (Applicationjsoncharsetutf8RequestBody) requestBody; + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } + } + + public sealed interface SealedRequestBody permits Applicationjsoncharsetutf8RequestBody {} + public record Applicationjsoncharsetutf8RequestBody(Applicationjsoncharsetutf8Schema.AnyTypeJsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "application/json; charset=utf-8"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/FakejsonwithcharsetPostResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/FakejsonwithcharsetPostResponses.java new file mode 100644 index 00000000000..f695b513166 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/FakejsonwithcharsetPostResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakejsonwithcharset.post; + +import org.openapijsonschematools.client.paths.fakejsonwithcharset.post.responses.FakejsonwithcharsetPostCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakejsonwithcharsetPostResponses { + public sealed interface EndpointResponse permits EndpointFakejsonwithcharsetPostCode200Response {} + + public record EndpointFakejsonwithcharsetPostCode200Response( + HttpResponse response, + FakejsonwithcharsetPostCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakejsonwithcharsetPostCode200ResponseDeserializer {} + + public static final class StatusFakejsonwithcharsetPostCode200ResponseDeserializer extends FakejsonwithcharsetPostCode200Response.FakejsonwithcharsetPostCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakejsonwithcharsetPostResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakejsonwithcharsetPostResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakejsonwithcharsetPostCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakejsonwithcharsetPostCode200ResponseDeserializer castDeserializer = (StatusFakejsonwithcharsetPostCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakejsonwithcharsetPostCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/RequestBody.java deleted file mode 100644 index 6843dc22e74..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/RequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.fakejsonwithcharset.post; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakejsonwithcharset.post.requestbody.content.applicationjsoncharsetutf8.Applicationjsoncharsetutf8Schema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits Applicationjsoncharsetutf8MediaType {} - - public record Applicationjsoncharsetutf8MediaType(Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1 schema) implements SealedMediaType, MediaType { - public Applicationjsoncharsetutf8MediaType() { - this(Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json; charset=utf-8", new Applicationjsoncharsetutf8MediaType()) - ), - false - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - Applicationjsoncharsetutf8RequestBody requestBody0 = (Applicationjsoncharsetutf8RequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } - } - - public sealed interface SealedRequestBody permits Applicationjsoncharsetutf8RequestBody {} - public record Applicationjsoncharsetutf8RequestBody(Applicationjsoncharsetutf8Schema.AnyTypeJsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "application/json; charset=utf-8"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/Responses.java deleted file mode 100644 index c4ad7ae4d22..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakejsonwithcharset.post; - -import org.openapijsonschematools.client.paths.fakejsonwithcharset.post.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/responses/Code200Response.java deleted file mode 100644 index d1c8cfba01a..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/responses/Code200Response.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakejsonwithcharset.post.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakejsonwithcharset.post.responses.code200response.content.applicationjsoncharsetutf8.Applicationjsoncharsetutf8Schema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits Applicationjsoncharsetutf8MediaType {} - - public record Applicationjsoncharsetutf8MediaType(Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1 schema) implements SealedMediaType, MediaType { - public Applicationjsoncharsetutf8MediaType() { - this(Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits Applicationjsoncharsetutf8ResponseBody {} - public record Applicationjsoncharsetutf8ResponseBody(Applicationjsoncharsetutf8Schema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json; charset=utf-8", new Applicationjsoncharsetutf8MediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - Applicationjsoncharsetutf8MediaType thisMediaType = (Applicationjsoncharsetutf8MediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new Applicationjsoncharsetutf8ResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/responses/FakejsonwithcharsetPostCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/responses/FakejsonwithcharsetPostCode200Response.java new file mode 100644 index 00000000000..71a35408633 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakejsonwithcharset/post/responses/FakejsonwithcharsetPostCode200Response.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakejsonwithcharset.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakejsonwithcharset.post.responses.code200response.content.applicationjsoncharsetutf8.Applicationjsoncharsetutf8Schema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakejsonwithcharsetPostCode200Response { + public sealed interface SealedMediaType permits Applicationjsoncharsetutf8MediaType {} + + public record Applicationjsoncharsetutf8MediaType(Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1 schema) implements SealedMediaType, MediaType { + public Applicationjsoncharsetutf8MediaType() { + this(Applicationjsoncharsetutf8Schema.Applicationjsoncharsetutf8Schema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits Applicationjsoncharsetutf8ResponseBody {} + public record Applicationjsoncharsetutf8ResponseBody(Applicationjsoncharsetutf8Schema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class FakejsonwithcharsetPostCode200Response1 extends ResponseDeserializer { + public FakejsonwithcharsetPostCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json; charset=utf-8", new Applicationjsoncharsetutf8MediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + Applicationjsoncharsetutf8MediaType thisMediaType = (Applicationjsoncharsetutf8MediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new Applicationjsoncharsetutf8ResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/FakemultiplerequestbodycontenttypesPost.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/FakemultiplerequestbodycontenttypesPost.java new file mode 100644 index 00000000000..585ea8c5680 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/FakemultiplerequestbodycontenttypesPost.java @@ -0,0 +1,152 @@ +package org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.FakemultiplerequestbodycontenttypesPostRequestBody; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.FakemultiplerequestbodycontenttypesPostResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Fakemultiplerequestbodycontenttypes; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakemultiplerequestbodycontenttypesPost { + private static class PostProvider { + private static final String method = "post"; + + public static FakemultiplerequestbodycontenttypesPostResponses.EndpointResponse post( + PostRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + @Nullable SerializedRequestBody serializedRequestBody; + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + if (request.requestBody != null) { + serializedRequestBody = new FakemultiplerequestbodycontenttypesPostRequestBody.FakemultiplerequestbodycontenttypesPostRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + bodyPublisher = serializedRequestBody.bodyPublisher; + } + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakemultiplerequestbodycontenttypes.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakemultiplerequestbodycontenttypesPostResponses.FakemultiplerequestbodycontenttypesPostResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PostOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakemultiplerequestbodycontenttypesPostResponses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface MultipleRequestBodyContentTypesOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakemultiplerequestbodycontenttypesPostResponses.EndpointResponse multipleRequestBodyContentTypes(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Post extends ApiClient implements PostOperation { + public Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PostRequest { + public FakemultiplerequestbodycontenttypesPostRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForRequestBody { + PostRequest getInstance(); + T getBuilderAfterRequestBody(PostRequest instance); + default T requestBody(FakemultiplerequestbodycontenttypesPostRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public interface SetterForServerIndex { + PostRequest getInstance(); + T getBuilderAfterServerIndex(PostRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PostRequest getInstance(); + T getBuilderAfterTimeout(PostRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class PostRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { + private final PostRequest instance; + + public PostRequestBuilder() { + this.instance = new PostRequest(); + } + + public PostRequest build() { + return instance; + } + + public PostRequest getInstance() { + return instance; + } + + public PostRequestBuilder getBuilderAfterRequestBody(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterServerIndex(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterTimeout(PostRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/Post.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/Post.java deleted file mode 100644 index eec76f14d75..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/Post.java +++ /dev/null @@ -1,143 +0,0 @@ -package org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.RequestBody; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Fakemultiplerequestbodycontenttypes; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Post { - private static class PostProvider { - private static final String method = "post"; - - public static Responses.EndpointResponse post( - PostRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - @Nullable SerializedRequestBody serializedRequestBody; - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - if (request.requestBody != null) { - serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - bodyPublisher = serializedRequestBody.bodyPublisher; - } - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakemultiplerequestbodycontenttypes.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PostOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Post1 extends ApiClient implements PostOperation { - public Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PostRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForRequestBody { - PostRequest getInstance(); - T getBuilderAfterRequestBody(PostRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public interface SetterForServerIndex { - PostRequest getInstance(); - T getBuilderAfterServerIndex(PostRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PostRequest getInstance(); - T getBuilderAfterTimeout(PostRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class PostRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { - private final PostRequest instance; - - public PostRequestBuilder() { - this.instance = new PostRequest(); - } - - public PostRequest build() { - return instance; - } - - public PostRequest getInstance() { - return instance; - } - - public PostRequestBuilder getBuilderAfterRequestBody(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterServerIndex(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterTimeout(PostRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/FakemultiplerequestbodycontenttypesPostRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/FakemultiplerequestbodycontenttypesPostRequestBody.java new file mode 100644 index 00000000000..5b9b8fc6ab8 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/FakemultiplerequestbodycontenttypesPostRequestBody.java @@ -0,0 +1,75 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.requestbody.content.applicationjson.ApplicationjsonSchema; +import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.requestbody.content.multipartformdata.MultipartformdataSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class FakemultiplerequestbodycontenttypesPostRequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType, MultipartformdataMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public record MultipartformdataMediaType(MultipartformdataSchema.MultipartformdataSchema1 schema) implements SealedMediaType, MediaType { + public MultipartformdataMediaType() { + this(MultipartformdataSchema.MultipartformdataSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class FakemultiplerequestbodycontenttypesPostRequestBody1 extends RequestBodySerializer { + public FakemultiplerequestbodycontenttypesPostRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()), + new AbstractMap.SimpleEntry<>("multipart/form-data", new MultipartformdataMediaType()) + ), + false + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + if (requestBody instanceof ApplicationjsonRequestBody requestBody0) { + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } else { + MultipartformdataRequestBody requestBody1 = (MultipartformdataRequestBody) requestBody; + return serialize(requestBody1.contentType(), requestBody1.body().getData()); + } + } + } + + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody, MultipartformdataRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.ApplicationjsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "application/json"; + } + } + public record MultipartformdataRequestBody(MultipartformdataSchema.MultipartformdataSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "multipart/form-data"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/FakemultiplerequestbodycontenttypesPostResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/FakemultiplerequestbodycontenttypesPostResponses.java new file mode 100644 index 00000000000..fedc18554a6 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/FakemultiplerequestbodycontenttypesPostResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post; + +import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.responses.FakemultiplerequestbodycontenttypesPostCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakemultiplerequestbodycontenttypesPostResponses { + public sealed interface EndpointResponse permits EndpointFakemultiplerequestbodycontenttypesPostCode200Response {} + + public record EndpointFakemultiplerequestbodycontenttypesPostCode200Response( + HttpResponse response, + FakemultiplerequestbodycontenttypesPostCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakemultiplerequestbodycontenttypesPostCode200ResponseDeserializer {} + + public static final class StatusFakemultiplerequestbodycontenttypesPostCode200ResponseDeserializer extends FakemultiplerequestbodycontenttypesPostCode200Response.FakemultiplerequestbodycontenttypesPostCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakemultiplerequestbodycontenttypesPostResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakemultiplerequestbodycontenttypesPostResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakemultiplerequestbodycontenttypesPostCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakemultiplerequestbodycontenttypesPostCode200ResponseDeserializer castDeserializer = (StatusFakemultiplerequestbodycontenttypesPostCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakemultiplerequestbodycontenttypesPostCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/RequestBody.java deleted file mode 100644 index 0566e226c14..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/RequestBody.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.requestbody.content.applicationjson.ApplicationjsonSchema; -import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.requestbody.content.multipartformdata.MultipartformdataSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits ApplicationjsonMediaType, MultipartformdataMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public record MultipartformdataMediaType(MultipartformdataSchema.MultipartformdataSchema1 schema) implements SealedMediaType, MediaType { - public MultipartformdataMediaType() { - this(MultipartformdataSchema.MultipartformdataSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()), - new AbstractMap.SimpleEntry<>("multipart/form-data", new MultipartformdataMediaType()) - ), - false - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - if (requestBody instanceof ApplicationjsonRequestBody requestBody0) { - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } else { - MultipartformdataRequestBody requestBody1 = (MultipartformdataRequestBody) requestBody; - return serialize(requestBody1.contentType(), requestBody1.body().getData()); - } - } - } - - public sealed interface SealedRequestBody permits ApplicationjsonRequestBody, MultipartformdataRequestBody {} - public record ApplicationjsonRequestBody(ApplicationjsonSchema.ApplicationjsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "application/json"; - } - } - public record MultipartformdataRequestBody(MultipartformdataSchema.MultipartformdataSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "multipart/form-data"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/Responses.java deleted file mode 100644 index 0eeb2290be0..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post; - -import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/responses/Code200Response.java deleted file mode 100644 index 30659d828c6..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/responses/Code200Response.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/responses/FakemultiplerequestbodycontenttypesPostCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/responses/FakemultiplerequestbodycontenttypesPostCode200Response.java new file mode 100644 index 00000000000..31866cb56d6 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplerequestbodycontenttypes/post/responses/FakemultiplerequestbodycontenttypesPostCode200Response.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakemultiplerequestbodycontenttypes.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakemultiplerequestbodycontenttypesPostCode200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class FakemultiplerequestbodycontenttypesPostCode200Response1 extends ResponseDeserializer { + public FakemultiplerequestbodycontenttypesPostCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/FakemultipleresponsebodiesGet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/FakemultipleresponsebodiesGet.java new file mode 100644 index 00000000000..78be3b0ebe6 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/FakemultipleresponsebodiesGet.java @@ -0,0 +1,124 @@ +package org.openapijsonschematools.client.paths.fakemultipleresponsebodies; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.FakemultipleresponsebodiesGetResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.paths.Fakemultipleresponsebodies; + +import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakemultipleresponsebodiesGet { + private static class GetProvider { + private static final String method = "get"; + + public static FakemultipleresponsebodiesGetResponses.EndpointResponse get( + GetRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakemultipleresponsebodies.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakemultipleresponsebodiesGetResponses.FakemultipleresponsebodiesGetResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface GetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakemultipleresponsebodiesGetResponses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface MultipleResponseBodiesOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakemultipleresponsebodiesGetResponses.EndpointResponse multipleResponseBodies(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Get extends ApiClient implements GetOperation { + public Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class GetRequest { + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + GetRequest getInstance(); + T getBuilderAfterServerIndex(GetRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + GetRequest getInstance(); + T getBuilderAfterTimeout(GetRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class GetRequestBuilder implements SetterForServerIndex, SetterForTimeout { + private final GetRequest instance; + + public GetRequestBuilder() { + this.instance = new GetRequest(); + } + + public GetRequest build() { + return instance; + } + + public GetRequest getInstance() { + return instance; + } + + public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { + return this; + } + + public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/Get.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/Get.java deleted file mode 100644 index c741ed63ddb..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/Get.java +++ /dev/null @@ -1,115 +0,0 @@ -package org.openapijsonschematools.client.paths.fakemultipleresponsebodies; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.paths.Fakemultipleresponsebodies; - -import java.io.IOException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Get { - private static class GetProvider { - private static final String method = "get"; - - public static Responses.EndpointResponse get( - GetRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakemultipleresponsebodies.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface GetOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Get1 extends ApiClient implements GetOperation { - public Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class GetRequest { - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - GetRequest getInstance(); - T getBuilderAfterServerIndex(GetRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - GetRequest getInstance(); - T getBuilderAfterTimeout(GetRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class GetRequestBuilder implements SetterForServerIndex, SetterForTimeout { - private final GetRequest instance; - - public GetRequestBuilder() { - this.instance = new GetRequest(); - } - - public GetRequest build() { - return instance; - } - - public GetRequest getInstance() { - return instance; - } - - public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { - return this; - } - - public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/FakemultipleresponsebodiesGetResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/FakemultipleresponsebodiesGetResponses.java new file mode 100644 index 00000000000..328ed565f80 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/FakemultipleresponsebodiesGetResponses.java @@ -0,0 +1,69 @@ +package org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get; + +import org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.responses.FakemultipleresponsebodiesGetCode200Response; +import org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.responses.FakemultipleresponsebodiesGetCode202Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakemultipleresponsebodiesGetResponses { + public sealed interface EndpointResponse permits EndpointFakemultipleresponsebodiesGetCode200Response, EndpointFakemultipleresponsebodiesGetCode202Response {} + + public record EndpointFakemultipleresponsebodiesGetCode200Response( + HttpResponse response, + FakemultipleresponsebodiesGetCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public record EndpointFakemultipleresponsebodiesGetCode202Response( + HttpResponse response, + FakemultipleresponsebodiesGetCode202Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakemultipleresponsebodiesGetCode200ResponseDeserializer, StatusFakemultipleresponsebodiesGetCode202ResponseDeserializer {} + + public static final class StatusFakemultipleresponsebodiesGetCode200ResponseDeserializer extends FakemultipleresponsebodiesGetCode200Response.FakemultipleresponsebodiesGetCode200Response1 implements StatusCodeResponseDeserializer { + } + public static final class StatusFakemultipleresponsebodiesGetCode202ResponseDeserializer extends FakemultipleresponsebodiesGetCode202Response.FakemultipleresponsebodiesGetCode202Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakemultipleresponsebodiesGetResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakemultipleresponsebodiesGetResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakemultipleresponsebodiesGetCode200ResponseDeserializer()), + new AbstractMap.SimpleEntry<>("202", new StatusFakemultipleresponsebodiesGetCode202ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + if (statusCodeDeserializer instanceof StatusFakemultipleresponsebodiesGetCode200ResponseDeserializer castDeserializer) { + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakemultipleresponsebodiesGetCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } else { + StatusFakemultipleresponsebodiesGetCode202ResponseDeserializer castDeserializer = (StatusFakemultipleresponsebodiesGetCode202ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakemultipleresponsebodiesGetCode202Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/Responses.java deleted file mode 100644 index 3325b9085a8..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/Responses.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get; - -import org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.responses.Code200Response; -import org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.responses.Code202Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response, EndpointCode202Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public record EndpointCode202Response( - HttpResponse response, - Code202Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer, StatusCode202ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - public static final class StatusCode202ResponseDeserializer extends Code202Response.Code202Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()), - new AbstractMap.SimpleEntry<>("202", new StatusCode202ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - if (statusCodeDeserializer instanceof StatusCode200ResponseDeserializer castDeserializer) { - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } else { - StatusCode202ResponseDeserializer castDeserializer = (StatusCode202ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode202Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/Code200Response.java deleted file mode 100644 index 567d4148b74..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/Code200Response.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/Code202Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/Code202Response.java deleted file mode 100644 index 2783f09c99f..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/Code202Response.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.responses.code202response.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code202Response { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } - - public static class Code202Response1 extends ResponseDeserializer { - public Code202Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/FakemultipleresponsebodiesGetCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/FakemultipleresponsebodiesGetCode200Response.java new file mode 100644 index 00000000000..aa57e66abcc --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/FakemultipleresponsebodiesGetCode200Response.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakemultipleresponsebodiesGetCode200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class FakemultipleresponsebodiesGetCode200Response1 extends ResponseDeserializer { + public FakemultipleresponsebodiesGetCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/FakemultipleresponsebodiesGetCode202Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/FakemultipleresponsebodiesGetCode202Response.java new file mode 100644 index 00000000000..059d4284e0d --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultipleresponsebodies/get/responses/FakemultipleresponsebodiesGetCode202Response.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakemultipleresponsebodies.get.responses.code202response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakemultipleresponsebodiesGetCode202Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class FakemultipleresponsebodiesGetCode202Response1 extends ResponseDeserializer { + public FakemultipleresponsebodiesGetCode202Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/FakemultiplesecuritiesGet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/FakemultiplesecuritiesGet.java new file mode 100644 index 00000000000..99652396c14 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/FakemultiplesecuritiesGet.java @@ -0,0 +1,152 @@ +package org.openapijsonschematools.client.paths.fakemultiplesecurities; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakemultiplesecurities.get.FakemultiplesecuritiesGetSecurityInfo; +import org.openapijsonschematools.client.paths.fakemultiplesecurities.get.FakemultiplesecuritiesGetResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.paths.Fakemultiplesecurities; +import org.openapijsonschematools.client.securityrequirementobjects.SecurityRequirementObject; +import org.openapijsonschematools.client.securityrequirementobjects.AuthApplier; + +import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakemultiplesecuritiesGet { + private static class GetProvider extends AuthApplier { + private static final String method = "get"; + + public static FakemultiplesecuritiesGetResponses.EndpointResponse get( + GetRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + SecurityRequirementObject securityRequirementObject = apiConfiguration.getSecurityRequirementObject(request.securityIndex); + updateParamsForAuth( + securityRequirementObject, + headers, + Fakemultiplesecurities.path, + method, + bodyPublisher, + queryMap, + apiConfiguration + ); + + String url = host + Fakemultiplesecurities.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakemultiplesecuritiesGetResponses.FakemultiplesecuritiesGetResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface GetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakemultiplesecuritiesGetResponses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface MultipleSecuritiesOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakemultiplesecuritiesGetResponses.EndpointResponse multipleSecurities(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Get extends ApiClient implements GetOperation { + public Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class GetRequest { + public RootServerInfo.@Nullable ServerIndex serverIndex; + public FakemultiplesecuritiesGetSecurityInfo.@Nullable SecurityIndex securityIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + GetRequest getInstance(); + T getBuilderAfterServerIndex(GetRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForSecurityIndex { + GetRequest getInstance(); + T getBuilderAfterSecurityIndex(GetRequest instance); + default T securityIndex(FakemultiplesecuritiesGetSecurityInfo.SecurityIndex securityIndex) { + var instance = getInstance(); + instance.securityIndex = securityIndex; + return getBuilderAfterSecurityIndex(instance); + } + } + + public interface SetterForTimeout { + GetRequest getInstance(); + T getBuilderAfterTimeout(GetRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class GetRequestBuilder implements SetterForServerIndex, SetterForSecurityIndex, SetterForTimeout { + private final GetRequest instance; + + public GetRequestBuilder() { + this.instance = new GetRequest(); + } + + public GetRequest build() { + return instance; + } + + public GetRequest getInstance() { + return instance; + } + + public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { + return this; + } + + public GetRequestBuilder getBuilderAfterSecurityIndex(GetRequest instance) { + return this; + } + + public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/Get.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/Get.java deleted file mode 100644 index d7db1ca4247..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/Get.java +++ /dev/null @@ -1,143 +0,0 @@ -package org.openapijsonschematools.client.paths.fakemultiplesecurities; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakemultiplesecurities.get.FakemultiplesecuritiesGetSecurityInfo; -import org.openapijsonschematools.client.paths.fakemultiplesecurities.get.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.paths.Fakemultiplesecurities; -import org.openapijsonschematools.client.securityrequirementobjects.SecurityRequirementObject; -import org.openapijsonschematools.client.securityrequirementobjects.AuthApplier; - -import java.io.IOException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Get { - private static class GetProvider extends AuthApplier { - private static final String method = "get"; - - public static Responses.EndpointResponse get( - GetRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - SecurityRequirementObject securityRequirementObject = apiConfiguration.getSecurityRequirementObject(request.securityIndex); - updateParamsForAuth( - securityRequirementObject, - headers, - Fakemultiplesecurities.path, - method, - bodyPublisher, - queryMap, - apiConfiguration - ); - - String url = host + Fakemultiplesecurities.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface GetOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Get1 extends ApiClient implements GetOperation { - public Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class GetRequest { - public RootServerInfo.@Nullable ServerIndex serverIndex; - public FakemultiplesecuritiesGetSecurityInfo.@Nullable SecurityIndex securityIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - GetRequest getInstance(); - T getBuilderAfterServerIndex(GetRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForSecurityIndex { - GetRequest getInstance(); - T getBuilderAfterSecurityIndex(GetRequest instance); - default T securityIndex(FakemultiplesecuritiesGetSecurityInfo.SecurityIndex securityIndex) { - var instance = getInstance(); - instance.securityIndex = securityIndex; - return getBuilderAfterSecurityIndex(instance); - } - } - - public interface SetterForTimeout { - GetRequest getInstance(); - T getBuilderAfterTimeout(GetRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class GetRequestBuilder implements SetterForServerIndex, SetterForSecurityIndex, SetterForTimeout { - private final GetRequest instance; - - public GetRequestBuilder() { - this.instance = new GetRequest(); - } - - public GetRequest build() { - return instance; - } - - public GetRequest getInstance() { - return instance; - } - - public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { - return this; - } - - public GetRequestBuilder getBuilderAfterSecurityIndex(GetRequest instance) { - return this; - } - - public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/FakemultiplesecuritiesGetResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/FakemultiplesecuritiesGetResponses.java new file mode 100644 index 00000000000..c10a56a840a --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/FakemultiplesecuritiesGetResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakemultiplesecurities.get; + +import org.openapijsonschematools.client.paths.fakemultiplesecurities.get.responses.FakemultiplesecuritiesGetCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakemultiplesecuritiesGetResponses { + public sealed interface EndpointResponse permits EndpointFakemultiplesecuritiesGetCode200Response {} + + public record EndpointFakemultiplesecuritiesGetCode200Response( + HttpResponse response, + FakemultiplesecuritiesGetCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakemultiplesecuritiesGetCode200ResponseDeserializer {} + + public static final class StatusFakemultiplesecuritiesGetCode200ResponseDeserializer extends FakemultiplesecuritiesGetCode200Response.FakemultiplesecuritiesGetCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakemultiplesecuritiesGetResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakemultiplesecuritiesGetResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakemultiplesecuritiesGetCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakemultiplesecuritiesGetCode200ResponseDeserializer castDeserializer = (StatusFakemultiplesecuritiesGetCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakemultiplesecuritiesGetCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/Responses.java deleted file mode 100644 index 94d796bdc3c..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakemultiplesecurities.get; - -import org.openapijsonschematools.client.paths.fakemultiplesecurities.get.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/responses/Code200Response.java deleted file mode 100644 index 14964db98f2..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/responses/Code200Response.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakemultiplesecurities.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakemultiplesecurities.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/responses/FakemultiplesecuritiesGetCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/responses/FakemultiplesecuritiesGetCode200Response.java new file mode 100644 index 00000000000..06c0ea10767 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakemultiplesecurities/get/responses/FakemultiplesecuritiesGetCode200Response.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakemultiplesecurities.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakemultiplesecurities.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakemultiplesecuritiesGetCode200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class FakemultiplesecuritiesGetCode200Response1 extends ResponseDeserializer { + public FakemultiplesecuritiesGetCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/FakeobjinqueryGet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/FakeobjinqueryGet.java new file mode 100644 index 00000000000..fafba1cee8e --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/FakeobjinqueryGet.java @@ -0,0 +1,148 @@ +package org.openapijsonschematools.client.paths.fakeobjinquery; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.fakeobjinquery.get.FakeobjinqueryGetQueryParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeobjinquery.get.Parameters; +import org.openapijsonschematools.client.paths.fakeobjinquery.get.FakeobjinqueryGetResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.paths.Fakeobjinquery; + +import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakeobjinqueryGet { + private static class GetProvider { + private static final String method = "get"; + + public static FakeobjinqueryGetResponses.EndpointResponse get( + GetRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + + var querySerializer = new Parameters.QueryParametersSerializer(); + @Nullable Map queryMap = null; + if (request.queryParameters != null) { + queryMap = querySerializer.getQueryMap(request.queryParameters); + } + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakeobjinquery.path; + if (queryMap != null) { + url = url + querySerializer.serialize(queryMap); + } + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakeobjinqueryGetResponses.FakeobjinqueryGetResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface GetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakeobjinqueryGetResponses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface ObjectInQueryOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakeobjinqueryGetResponses.EndpointResponse objectInQuery(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Get extends ApiClient implements GetOperation { + public Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class GetRequest { + public FakeobjinqueryGetQueryParameters.@Nullable FakeobjinqueryGetQueryParametersMap queryParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForQueryParameters { + GetRequest getInstance(); + T getBuilderAfterQueryParameters(GetRequest instance); + default T queryParameters(FakeobjinqueryGetQueryParameters.FakeobjinqueryGetQueryParametersMap queryParameters) { + var instance = getInstance(); + instance.queryParameters = queryParameters; + return getBuilderAfterQueryParameters(instance); + } + } + + public interface SetterForServerIndex { + GetRequest getInstance(); + T getBuilderAfterServerIndex(GetRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + GetRequest getInstance(); + T getBuilderAfterTimeout(GetRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class GetRequestBuilder implements SetterForQueryParameters, SetterForServerIndex, SetterForTimeout { + private final GetRequest instance; + + public GetRequestBuilder() { + this.instance = new GetRequest(); + } + + public GetRequest build() { + return instance; + } + + public GetRequest getInstance() { + return instance; + } + + public GetRequestBuilder getBuilderAfterQueryParameters(GetRequest instance) { + return this; + } + + public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { + return this; + } + + public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/Get.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/Get.java deleted file mode 100644 index e4f5836bd16..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/Get.java +++ /dev/null @@ -1,139 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeobjinquery; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.fakeobjinquery.get.QueryParameters; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakeobjinquery.get.Parameters; -import org.openapijsonschematools.client.paths.fakeobjinquery.get.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.paths.Fakeobjinquery; - -import java.io.IOException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Get { - private static class GetProvider { - private static final String method = "get"; - - public static Responses.EndpointResponse get( - GetRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - - var querySerializer = new Parameters.QueryParametersSerializer(); - @Nullable Map queryMap = null; - if (request.queryParameters != null) { - queryMap = querySerializer.getQueryMap(request.queryParameters); - } - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakeobjinquery.path; - if (queryMap != null) { - url = url + querySerializer.serialize(queryMap); - } - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface GetOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Get1 extends ApiClient implements GetOperation { - public Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class GetRequest { - public QueryParameters.@Nullable QueryParametersMap queryParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForQueryParameters { - GetRequest getInstance(); - T getBuilderAfterQueryParameters(GetRequest instance); - default T queryParameters(QueryParameters.QueryParametersMap queryParameters) { - var instance = getInstance(); - instance.queryParameters = queryParameters; - return getBuilderAfterQueryParameters(instance); - } - } - - public interface SetterForServerIndex { - GetRequest getInstance(); - T getBuilderAfterServerIndex(GetRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - GetRequest getInstance(); - T getBuilderAfterTimeout(GetRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class GetRequestBuilder implements SetterForQueryParameters, SetterForServerIndex, SetterForTimeout { - private final GetRequest instance; - - public GetRequestBuilder() { - this.instance = new GetRequest(); - } - - public GetRequest build() { - return instance; - } - - public GetRequest getInstance() { - return instance; - } - - public GetRequestBuilder getBuilderAfterQueryParameters(GetRequest instance) { - return this; - } - - public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { - return this; - } - - public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/FakeobjinqueryGetQueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/FakeobjinqueryGetQueryParameters.java new file mode 100644 index 00000000000..65d46dd8fe8 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/FakeobjinqueryGetQueryParameters.java @@ -0,0 +1,191 @@ +package org.openapijsonschematools.client.paths.fakeobjinquery.get; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.fakeobjinquery.get.parameters.parameter0.Schema0; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class FakeobjinqueryGetQueryParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class FakeobjinqueryGetadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable FakeobjinqueryGetadditionalProperties instance = null; + public static FakeobjinqueryGetadditionalProperties getInstance() { + if (instance == null) { + instance = new FakeobjinqueryGetadditionalProperties(); + } + return instance; + } + } + + + public static class FakeobjinqueryGetQueryParametersMap extends FrozenMap { + protected FakeobjinqueryGetQueryParametersMap(FrozenMap m) { + super(m); + } + public static final Set requiredKeys = Set.of(); + public static final Set optionalKeys = Set.of( + "mapBean" + ); + public static FakeobjinqueryGetQueryParametersMap of(Map> arg, SchemaConfiguration configuration) throws ValidationException { + return FakeobjinqueryGetQueryParameters1.getInstance().validate(arg, configuration); + } + + public Schema0.SchemaMap0 mapBean() throws UnsetPropertyException { + return getOrThrow("mapBean"); + } + } + + public interface SetterForFakeobjinqueryGetmapBean { + Map> getInstance(); + T getBuilderAfterFakeobjinqueryGetmapBean(Map> instance); + + default T mapBean(Map value) { + var instance = getInstance(); + instance.put("mapBean", value); + return getBuilderAfterFakeobjinqueryGetmapBean(instance); + } + } + + public static class FakeobjinqueryGetQueryParametersMapBuilder implements GenericBuilder>>, SetterForFakeobjinqueryGetmapBean { + private final Map> instance; + private static final Set knownKeys = Set.of( + "mapBean" + ); + public Set getKnownKeys() { + return knownKeys; + } + public FakeobjinqueryGetQueryParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map> build() { + return instance; + } + public Map> getInstance() { + return instance; + } + public FakeobjinqueryGetQueryParametersMapBuilder getBuilderAfterFakeobjinqueryGetmapBean(Map> instance) { + return this; + } + } + + + public sealed interface FakeobjinqueryGetQueryParameters1Boxed permits FakeobjinqueryGetQueryParameters1BoxedMap { + @Nullable Object getData(); + } + + public record FakeobjinqueryGetQueryParameters1BoxedMap(FakeobjinqueryGetQueryParametersMap data) implements FakeobjinqueryGetQueryParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class FakeobjinqueryGetQueryParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable FakeobjinqueryGetQueryParameters1 instance = null; + + protected FakeobjinqueryGetQueryParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("mapBean", Schema0.Schema01.class) + )) + .additionalProperties(FakeobjinqueryGetadditionalProperties.class) + ); + } + + public static FakeobjinqueryGetQueryParameters1 getInstance() { + if (instance == null) { + instance = new FakeobjinqueryGetQueryParameters1(); + } + return instance; + } + + public FakeobjinqueryGetQueryParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Schema0.SchemaMap0)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (Schema0.SchemaMap0) propertyInstance); + } + FrozenMap castProperties = new FrozenMap<>(properties); + return new FakeobjinqueryGetQueryParametersMap(castProperties); + } + + public FakeobjinqueryGetQueryParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public FakeobjinqueryGetQueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new FakeobjinqueryGetQueryParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public FakeobjinqueryGetQueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/FakeobjinqueryGetResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/FakeobjinqueryGetResponses.java new file mode 100644 index 00000000000..f3b4fc6711e --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/FakeobjinqueryGetResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakeobjinquery.get; + +import org.openapijsonschematools.client.paths.fakeobjinquery.get.responses.FakeobjinqueryGetCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakeobjinqueryGetResponses { + public sealed interface EndpointResponse permits EndpointFakeobjinqueryGetCode200Response {} + + public record EndpointFakeobjinqueryGetCode200Response( + HttpResponse response, + Void body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakeobjinqueryGetCode200ResponseDeserializer {} + + public static final class StatusFakeobjinqueryGetCode200ResponseDeserializer extends FakeobjinqueryGetCode200Response.FakeobjinqueryGetCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakeobjinqueryGetResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakeobjinqueryGetResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakeobjinqueryGetCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakeobjinqueryGetCode200ResponseDeserializer castDeserializer = (StatusFakeobjinqueryGetCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakeobjinqueryGetCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/QueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/QueryParameters.java deleted file mode 100644 index ab8fcd644a7..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/QueryParameters.java +++ /dev/null @@ -1,191 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeobjinquery.get; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.fakeobjinquery.get.parameters.parameter0.Schema0; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class QueryParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class QueryParametersMap extends FrozenMap { - protected QueryParametersMap(FrozenMap m) { - super(m); - } - public static final Set requiredKeys = Set.of(); - public static final Set optionalKeys = Set.of( - "mapBean" - ); - public static QueryParametersMap of(Map> arg, SchemaConfiguration configuration) throws ValidationException { - return QueryParameters1.getInstance().validate(arg, configuration); - } - - public Schema0.SchemaMap0 mapBean() throws UnsetPropertyException { - return getOrThrow("mapBean"); - } - } - - public interface SetterForMapBean { - Map> getInstance(); - T getBuilderAfterMapBean(Map> instance); - - default T mapBean(Map value) { - var instance = getInstance(); - instance.put("mapBean", value); - return getBuilderAfterMapBean(instance); - } - } - - public static class QueryParametersMapBuilder implements GenericBuilder>>, SetterForMapBean { - private final Map> instance; - private static final Set knownKeys = Set.of( - "mapBean" - ); - public Set getKnownKeys() { - return knownKeys; - } - public QueryParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map> build() { - return instance; - } - public Map> getInstance() { - return instance; - } - public QueryParametersMapBuilder getBuilderAfterMapBean(Map> instance) { - return this; - } - } - - - public sealed interface QueryParameters1Boxed permits QueryParameters1BoxedMap { - @Nullable Object getData(); - } - - public record QueryParameters1BoxedMap(QueryParametersMap data) implements QueryParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable QueryParameters1 instance = null; - - protected QueryParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("mapBean", Schema0.Schema01.class) - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static QueryParameters1 getInstance() { - if (instance == null) { - instance = new QueryParameters1(); - } - return instance; - } - - public QueryParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - if (!(propertyInstance instanceof Schema0.SchemaMap0)) { - throw new RuntimeException("Invalid instantiated value"); - } - properties.put(propertyName, (Schema0.SchemaMap0) propertyInstance); - } - FrozenMap castProperties = new FrozenMap<>(properties); - return new QueryParametersMap(castProperties); - } - - public QueryParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public QueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new QueryParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public QueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/Responses.java deleted file mode 100644 index 1cb6c0ca42e..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeobjinquery.get; - -import org.openapijsonschematools.client.paths.fakeobjinquery.get.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/responses/Code200Response.java deleted file mode 100644 index 3e317ea4671..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/responses/Code200Response.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeobjinquery.get.responses; - -import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; - -public class Code200Response extends SuccessDescriptionOnly { - public static class Code200Response1 extends SuccessDescriptionOnly1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/responses/FakeobjinqueryGetCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/responses/FakeobjinqueryGetCode200Response.java new file mode 100644 index 00000000000..ea4029a4cb2 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeobjinquery/get/responses/FakeobjinqueryGetCode200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.fakeobjinquery.get.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class FakeobjinqueryGetCode200Response extends SuccessDescriptionOnly { + public static class FakeobjinqueryGetCode200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/Fakeparametercollisions1ababselfabPost.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/Fakeparametercollisions1ababselfabPost.java new file mode 100644 index 00000000000..1e7dc076454 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/Fakeparametercollisions1ababselfabPost.java @@ -0,0 +1,291 @@ +package org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Fakeparametercollisions1ababselfabPostRequestBody; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Fakeparametercollisions1ababselfabPostHeaderParameters; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Fakeparametercollisions1ababselfabPostQueryParameters; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Fakeparametercollisions1ababselfabPostCookieParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Fakeparametercollisions1ababselfabPostPathParameters; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Parameters; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Fakeparametercollisions1ababselfabPostResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Fakeparametercollisions1ababselfab; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class Fakeparametercollisions1ababselfabPost { + private static class PostProvider { + private static final String method = "post"; + + public static Fakeparametercollisions1ababselfabPostResponses.EndpointResponse post( + PostRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + @Nullable SerializedRequestBody serializedRequestBody; + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + if (request.requestBody != null) { + serializedRequestBody = new Fakeparametercollisions1ababselfabPostRequestBody.Fakeparametercollisions1ababselfabPostRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + bodyPublisher = serializedRequestBody.bodyPublisher; + } + + if (request.headerParameters != null) { + var headersSerializer = new Parameters.HeaderParametersSerializer(); + Map> serializedHeaders = headersSerializer.serialize(request.headerParameters); + headers.putAll(serializedHeaders); + } + + if (request.cookieParameters != null) { + var cookieSerializer = new Parameters.CookieParametersSerializer(); + String serializedCookie = cookieSerializer.serialize(request.cookieParameters); + var cookieHeaderValues = headers.getOrDefault("Cookie", new ArrayList<>()); + cookieHeaderValues.add(serializedCookie); + } + + var pathSerializer = new Parameters.PathParametersSerializer(); + String updatedPath = pathSerializer.serialize(request.pathParameters, Fakeparametercollisions1ababselfab.path); + + var querySerializer = new Parameters.QueryParametersSerializer(); + @Nullable Map queryMap = null; + if (request.queryParameters != null) { + queryMap = querySerializer.getQueryMap(request.queryParameters); + } + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + updatedPath; + if (queryMap != null) { + url = url + querySerializer.serialize(queryMap); + } + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new Fakeparametercollisions1ababselfabPostResponses.Fakeparametercollisions1ababselfabPostResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PostOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default Fakeparametercollisions1ababselfabPostResponses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface ParameterCollisionsOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default Fakeparametercollisions1ababselfabPostResponses.EndpointResponse parameterCollisions(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Post extends ApiClient implements PostOperation { + public Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PostRequest { + public Fakeparametercollisions1ababselfabPostPathParameters.Fakeparametercollisions1ababselfabPostPathParametersMap pathParameters; + public Fakeparametercollisions1ababselfabPostRequestBody.@Nullable SealedRequestBody requestBody; + public Fakeparametercollisions1ababselfabPostHeaderParameters.@Nullable Fakeparametercollisions1ababselfabPostHeaderParametersMap headerParameters; + public Fakeparametercollisions1ababselfabPostQueryParameters.@Nullable Fakeparametercollisions1ababselfabPostQueryParametersMap queryParameters; + public Fakeparametercollisions1ababselfabPostCookieParameters.@Nullable Fakeparametercollisions1ababselfabPostCookieParametersMap cookieParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + + public PostRequest( + Fakeparametercollisions1ababselfabPostPathParameters.Fakeparametercollisions1ababselfabPostPathParametersMap pathParameters, + Fakeparametercollisions1ababselfabPostRequestBody.@Nullable SealedRequestBody requestBody, + Fakeparametercollisions1ababselfabPostHeaderParameters.@Nullable Fakeparametercollisions1ababselfabPostHeaderParametersMap headerParameters, + Fakeparametercollisions1ababselfabPostQueryParameters.@Nullable Fakeparametercollisions1ababselfabPostQueryParametersMap queryParameters, + Fakeparametercollisions1ababselfabPostCookieParameters.@Nullable Fakeparametercollisions1ababselfabPostCookieParametersMap cookieParameters, + RootServerInfo.@Nullable ServerIndex serverIndex, + @Nullable Duration timeout + ) { + this.pathParameters = pathParameters; + this.requestBody = requestBody; + this.headerParameters = headerParameters; + this.queryParameters = queryParameters; + this.cookieParameters = cookieParameters; + this.serverIndex = serverIndex; + this.timeout = timeout; + } + } + + public static class PostNullableRequest { + public Fakeparametercollisions1ababselfabPostPathParameters.@Nullable Fakeparametercollisions1ababselfabPostPathParametersMap pathParameters; + public Fakeparametercollisions1ababselfabPostRequestBody.@Nullable SealedRequestBody requestBody; + public Fakeparametercollisions1ababselfabPostHeaderParameters.@Nullable Fakeparametercollisions1ababselfabPostHeaderParametersMap headerParameters; + public Fakeparametercollisions1ababselfabPostQueryParameters.@Nullable Fakeparametercollisions1ababselfabPostQueryParametersMap queryParameters; + public Fakeparametercollisions1ababselfabPostCookieParameters.@Nullable Fakeparametercollisions1ababselfabPostCookieParametersMap cookieParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForRequestBody { + PostNullableRequest getInstance(); + T getBuilderAfterRequestBody(PostNullableRequest instance); + default T requestBody(Fakeparametercollisions1ababselfabPostRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public interface SetterForHeaderParameters { + PostNullableRequest getInstance(); + T getBuilderAfterHeaderParameters(PostNullableRequest instance); + default T headerParameters(Fakeparametercollisions1ababselfabPostHeaderParameters.Fakeparametercollisions1ababselfabPostHeaderParametersMap headerParameters) { + var instance = getInstance(); + instance.headerParameters = headerParameters; + return getBuilderAfterHeaderParameters(instance); + } + } + + public interface SetterForQueryParameters { + PostNullableRequest getInstance(); + T getBuilderAfterQueryParameters(PostNullableRequest instance); + default T queryParameters(Fakeparametercollisions1ababselfabPostQueryParameters.Fakeparametercollisions1ababselfabPostQueryParametersMap queryParameters) { + var instance = getInstance(); + instance.queryParameters = queryParameters; + return getBuilderAfterQueryParameters(instance); + } + } + + public interface SetterForCookieParameters { + PostNullableRequest getInstance(); + T getBuilderAfterCookieParameters(PostNullableRequest instance); + default T cookieParameters(Fakeparametercollisions1ababselfabPostCookieParameters.Fakeparametercollisions1ababselfabPostCookieParametersMap cookieParameters) { + var instance = getInstance(); + instance.cookieParameters = cookieParameters; + return getBuilderAfterCookieParameters(instance); + } + } + + public interface SetterForServerIndex { + PostNullableRequest getInstance(); + T getBuilderAfterServerIndex(PostNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PostNullableRequest getInstance(); + T getBuilderAfterTimeout(PostNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForPathParameters { + PostNullableRequest getInstance(); + T getBuilderAfterPathParameters(PostNullableRequest instance); + default T pathParameters(Fakeparametercollisions1ababselfabPostPathParameters.Fakeparametercollisions1ababselfabPostPathParametersMap pathParameters) { + var instance = getInstance(); + instance.pathParameters = pathParameters; + return getBuilderAfterPathParameters(instance); + } + } + + public static class Post0RequestBuilder implements SetterForRequestBody, SetterForHeaderParameters, SetterForQueryParameters, SetterForCookieParameters, SetterForServerIndex, SetterForTimeout { + private final PostNullableRequest instance; + + public Post0RequestBuilder(PostNullableRequest instance) { + this.instance = instance; + } + + public PostRequest build() { + var pathParameters = instance.pathParameters; + if (pathParameters == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new PostRequest( + pathParameters, + instance.requestBody, + instance.headerParameters, + instance.queryParameters, + instance.cookieParameters, + instance.serverIndex, + instance.timeout + ); + } + + public PostNullableRequest getInstance() { + return instance; + } + + public Post0RequestBuilder getBuilderAfterRequestBody(PostNullableRequest instance) { + return this; + } + + public Post0RequestBuilder getBuilderAfterHeaderParameters(PostNullableRequest instance) { + return this; + } + + public Post0RequestBuilder getBuilderAfterQueryParameters(PostNullableRequest instance) { + return this; + } + + public Post0RequestBuilder getBuilderAfterCookieParameters(PostNullableRequest instance) { + return this; + } + + public Post0RequestBuilder getBuilderAfterServerIndex(PostNullableRequest instance) { + return this; + } + + public Post0RequestBuilder getBuilderAfterTimeout(PostNullableRequest instance) { + return this; + } + } + public static class PostRequestBuilder implements SetterForPathParameters { + private final PostNullableRequest instance; + + public PostRequestBuilder() { + this.instance = new PostNullableRequest(); + } + + public PostNullableRequest getInstance() { + return instance; + } + + public Post0RequestBuilder getBuilderAfterPathParameters(PostNullableRequest instance) { + return new Post0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/Post.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/Post.java deleted file mode 100644 index 6f8f32dcdab..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/Post.java +++ /dev/null @@ -1,282 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.RequestBody; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.HeaderParameters; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.QueryParameters; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.CookieParameters; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.PathParameters; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Parameters; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Fakeparametercollisions1ababselfab; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Post { - private static class PostProvider { - private static final String method = "post"; - - public static Responses.EndpointResponse post( - PostRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - @Nullable SerializedRequestBody serializedRequestBody; - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - if (request.requestBody != null) { - serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - bodyPublisher = serializedRequestBody.bodyPublisher; - } - - if (request.headerParameters != null) { - var headersSerializer = new Parameters.HeaderParametersSerializer(); - Map> serializedHeaders = headersSerializer.serialize(request.headerParameters); - headers.putAll(serializedHeaders); - } - - if (request.cookieParameters != null) { - var cookieSerializer = new Parameters.CookieParametersSerializer(); - String serializedCookie = cookieSerializer.serialize(request.cookieParameters); - var cookieHeaderValues = headers.getOrDefault("Cookie", new ArrayList<>()); - cookieHeaderValues.add(serializedCookie); - } - - var pathSerializer = new Parameters.PathParametersSerializer(); - String updatedPath = pathSerializer.serialize(request.pathParameters, Fakeparametercollisions1ababselfab.path); - - var querySerializer = new Parameters.QueryParametersSerializer(); - @Nullable Map queryMap = null; - if (request.queryParameters != null) { - queryMap = querySerializer.getQueryMap(request.queryParameters); - } - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + updatedPath; - if (queryMap != null) { - url = url + querySerializer.serialize(queryMap); - } - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PostOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Post1 extends ApiClient implements PostOperation { - public Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PostRequest { - public PathParameters.PathParametersMap pathParameters; - public RequestBody.@Nullable SealedRequestBody requestBody; - public HeaderParameters.@Nullable HeaderParametersMap headerParameters; - public QueryParameters.@Nullable QueryParametersMap queryParameters; - public CookieParameters.@Nullable CookieParametersMap cookieParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - - public PostRequest( - PathParameters.PathParametersMap pathParameters, - RequestBody.@Nullable SealedRequestBody requestBody, - HeaderParameters.@Nullable HeaderParametersMap headerParameters, - QueryParameters.@Nullable QueryParametersMap queryParameters, - CookieParameters.@Nullable CookieParametersMap cookieParameters, - RootServerInfo.@Nullable ServerIndex serverIndex, - @Nullable Duration timeout - ) { - this.pathParameters = pathParameters; - this.requestBody = requestBody; - this.headerParameters = headerParameters; - this.queryParameters = queryParameters; - this.cookieParameters = cookieParameters; - this.serverIndex = serverIndex; - this.timeout = timeout; - } - } - - public static class PostNullableRequest { - public PathParameters.@Nullable PathParametersMap pathParameters; - public RequestBody.@Nullable SealedRequestBody requestBody; - public HeaderParameters.@Nullable HeaderParametersMap headerParameters; - public QueryParameters.@Nullable QueryParametersMap queryParameters; - public CookieParameters.@Nullable CookieParametersMap cookieParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForRequestBody { - PostNullableRequest getInstance(); - T getBuilderAfterRequestBody(PostNullableRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public interface SetterForHeaderParameters { - PostNullableRequest getInstance(); - T getBuilderAfterHeaderParameters(PostNullableRequest instance); - default T headerParameters(HeaderParameters.HeaderParametersMap headerParameters) { - var instance = getInstance(); - instance.headerParameters = headerParameters; - return getBuilderAfterHeaderParameters(instance); - } - } - - public interface SetterForQueryParameters { - PostNullableRequest getInstance(); - T getBuilderAfterQueryParameters(PostNullableRequest instance); - default T queryParameters(QueryParameters.QueryParametersMap queryParameters) { - var instance = getInstance(); - instance.queryParameters = queryParameters; - return getBuilderAfterQueryParameters(instance); - } - } - - public interface SetterForCookieParameters { - PostNullableRequest getInstance(); - T getBuilderAfterCookieParameters(PostNullableRequest instance); - default T cookieParameters(CookieParameters.CookieParametersMap cookieParameters) { - var instance = getInstance(); - instance.cookieParameters = cookieParameters; - return getBuilderAfterCookieParameters(instance); - } - } - - public interface SetterForServerIndex { - PostNullableRequest getInstance(); - T getBuilderAfterServerIndex(PostNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PostNullableRequest getInstance(); - T getBuilderAfterTimeout(PostNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForPathParameters { - PostNullableRequest getInstance(); - T getBuilderAfterPathParameters(PostNullableRequest instance); - default T pathParameters(PathParameters.PathParametersMap pathParameters) { - var instance = getInstance(); - instance.pathParameters = pathParameters; - return getBuilderAfterPathParameters(instance); - } - } - - public static class Post0RequestBuilder implements SetterForRequestBody, SetterForHeaderParameters, SetterForQueryParameters, SetterForCookieParameters, SetterForServerIndex, SetterForTimeout { - private final PostNullableRequest instance; - - public Post0RequestBuilder(PostNullableRequest instance) { - this.instance = instance; - } - - public PostRequest build() { - var pathParameters = instance.pathParameters; - if (pathParameters == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new PostRequest( - pathParameters, - instance.requestBody, - instance.headerParameters, - instance.queryParameters, - instance.cookieParameters, - instance.serverIndex, - instance.timeout - ); - } - - public PostNullableRequest getInstance() { - return instance; - } - - public Post0RequestBuilder getBuilderAfterRequestBody(PostNullableRequest instance) { - return this; - } - - public Post0RequestBuilder getBuilderAfterHeaderParameters(PostNullableRequest instance) { - return this; - } - - public Post0RequestBuilder getBuilderAfterQueryParameters(PostNullableRequest instance) { - return this; - } - - public Post0RequestBuilder getBuilderAfterCookieParameters(PostNullableRequest instance) { - return this; - } - - public Post0RequestBuilder getBuilderAfterServerIndex(PostNullableRequest instance) { - return this; - } - - public Post0RequestBuilder getBuilderAfterTimeout(PostNullableRequest instance) { - return this; - } - } - public static class PostRequestBuilder implements SetterForPathParameters { - private final PostNullableRequest instance; - - public PostRequestBuilder() { - this.instance = new PostNullableRequest(); - } - - public PostNullableRequest getInstance() { - return instance; - } - - public Post0RequestBuilder getBuilderAfterPathParameters(PostNullableRequest instance) { - return new Post0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/CookieParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/CookieParameters.java deleted file mode 100644 index da9545c05c8..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/CookieParameters.java +++ /dev/null @@ -1,286 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter14.Schema14; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter15.Schema15; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter16.Schema16; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter17.Schema17; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter18.Schema18; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class CookieParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class CookieParametersMap extends FrozenMap<@Nullable Object> { - protected CookieParametersMap(FrozenMap<@Nullable Object> m) { - super(m); - } - public static final Set requiredKeys = Set.of(); - public static final Set optionalKeys = Set.of( - "1", - "aB", - "Ab", - "A-B", - "self" - ); - public static CookieParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return CookieParameters1.getInstance().validate(arg, configuration); - } - - public String aB() throws UnsetPropertyException { - String key = "aB"; - throwIfKeyNotPresent(key); - @Nullable Object value = get(key); - if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for aB"); - } - return (String) value; - } - - public String Ab() throws UnsetPropertyException { - String key = "Ab"; - throwIfKeyNotPresent(key); - @Nullable Object value = get(key); - if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for Ab"); - } - return (String) value; - } - - public String self() throws UnsetPropertyException { - String key = "self"; - throwIfKeyNotPresent(key); - @Nullable Object value = get(key); - if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for self"); - } - return (String) value; - } - } - - public interface SetterForSchema1 { - Map getInstance(); - T getBuilderAfterSchema1(Map instance); - - default T positive1(String value) { - var instance = getInstance(); - instance.put("1", value); - return getBuilderAfterSchema1(instance); - } - } - - public interface SetterForAB { - Map getInstance(); - T getBuilderAfterAB(Map instance); - - default T aB(String value) { - var instance = getInstance(); - instance.put("aB", value); - return getBuilderAfterAB(instance); - } - } - - public interface SetterForAb { - Map getInstance(); - T getBuilderAfterAb(Map instance); - - default T Ab(String value) { - var instance = getInstance(); - instance.put("Ab", value); - return getBuilderAfterAb(instance); - } - } - - public interface SetterForAB1 { - Map getInstance(); - T getBuilderAfterAB1(Map instance); - - default T aHyphenMinusB(String value) { - var instance = getInstance(); - instance.put("A-B", value); - return getBuilderAfterAB1(instance); - } - } - - public interface SetterForSelf { - Map getInstance(); - T getBuilderAfterSelf(Map instance); - - default T self(String value) { - var instance = getInstance(); - instance.put("self", value); - return getBuilderAfterSelf(instance); - } - } - - public static class CookieParametersMapBuilder implements GenericBuilder>, SetterForSchema1, SetterForAB, SetterForAb, SetterForAB1, SetterForSelf { - private final Map instance; - private static final Set knownKeys = Set.of( - "1", - "aB", - "Ab", - "A-B", - "self" - ); - public Set getKnownKeys() { - return knownKeys; - } - public CookieParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map build() { - return instance; - } - public Map getInstance() { - return instance; - } - public CookieParametersMapBuilder getBuilderAfterSchema1(Map instance) { - return this; - } - public CookieParametersMapBuilder getBuilderAfterAB(Map instance) { - return this; - } - public CookieParametersMapBuilder getBuilderAfterAb(Map instance) { - return this; - } - public CookieParametersMapBuilder getBuilderAfterAB1(Map instance) { - return this; - } - public CookieParametersMapBuilder getBuilderAfterSelf(Map instance) { - return this; - } - } - - - public sealed interface CookieParameters1Boxed permits CookieParameters1BoxedMap { - @Nullable Object getData(); - } - - public record CookieParameters1BoxedMap(CookieParametersMap data) implements CookieParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class CookieParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable CookieParameters1 instance = null; - - protected CookieParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("1", Schema14.Schema141.class), - new PropertyEntry("aB", Schema15.Schema151.class), - new PropertyEntry("Ab", Schema16.Schema161.class), - new PropertyEntry("A-B", Schema18.Schema181.class), - new PropertyEntry("self", Schema17.Schema171.class) - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static CookieParameters1 getInstance() { - if (instance == null) { - instance = new CookieParameters1(); - } - return instance; - } - - public CookieParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, propertyInstance); - } - FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); - return new CookieParametersMap(castProperties); - } - - public CookieParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public CookieParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new CookieParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public CookieParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostCookieParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostCookieParameters.java new file mode 100644 index 00000000000..23e6be4ba01 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostCookieParameters.java @@ -0,0 +1,286 @@ +package org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter14.Schema14; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter15.Schema15; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter16.Schema16; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter17.Schema17; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter18.Schema18; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class Fakeparametercollisions1ababselfabPostCookieParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class Fakeparametercollisions1ababselfabPostadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable Fakeparametercollisions1ababselfabPostadditionalProperties instance = null; + public static Fakeparametercollisions1ababselfabPostadditionalProperties getInstance() { + if (instance == null) { + instance = new Fakeparametercollisions1ababselfabPostadditionalProperties(); + } + return instance; + } + } + + + public static class Fakeparametercollisions1ababselfabPostCookieParametersMap extends FrozenMap<@Nullable Object> { + protected Fakeparametercollisions1ababselfabPostCookieParametersMap(FrozenMap<@Nullable Object> m) { + super(m); + } + public static final Set requiredKeys = Set.of(); + public static final Set optionalKeys = Set.of( + "1", + "aB", + "Ab", + "A-B", + "self" + ); + public static Fakeparametercollisions1ababselfabPostCookieParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return Fakeparametercollisions1ababselfabPostCookieParameters1.getInstance().validate(arg, configuration); + } + + public String aB() throws UnsetPropertyException { + String key = "aB"; + throwIfKeyNotPresent(key); + @Nullable Object value = get(key); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for aB"); + } + return (String) value; + } + + public String Ab() throws UnsetPropertyException { + String key = "Ab"; + throwIfKeyNotPresent(key); + @Nullable Object value = get(key); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for Ab"); + } + return (String) value; + } + + public String self() throws UnsetPropertyException { + String key = "self"; + throwIfKeyNotPresent(key); + @Nullable Object value = get(key); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for self"); + } + return (String) value; + } + } + + public interface SetterForFakeparametercollisions1ababselfabPost1 { + Map getInstance(); + T getBuilderAfterFakeparametercollisions1ababselfabPost1(Map instance); + + default T positive1(String value) { + var instance = getInstance(); + instance.put("1", value); + return getBuilderAfterFakeparametercollisions1ababselfabPost1(instance); + } + } + + public interface SetterForFakeparametercollisions1ababselfabPostaB { + Map getInstance(); + T getBuilderAfterFakeparametercollisions1ababselfabPostaB(Map instance); + + default T aB(String value) { + var instance = getInstance(); + instance.put("aB", value); + return getBuilderAfterFakeparametercollisions1ababselfabPostaB(instance); + } + } + + public interface SetterForFakeparametercollisions1ababselfabPostAb { + Map getInstance(); + T getBuilderAfterFakeparametercollisions1ababselfabPostAb(Map instance); + + default T Ab(String value) { + var instance = getInstance(); + instance.put("Ab", value); + return getBuilderAfterFakeparametercollisions1ababselfabPostAb(instance); + } + } + + public interface SetterForFakeparametercollisions1ababselfabPostAB { + Map getInstance(); + T getBuilderAfterFakeparametercollisions1ababselfabPostAB(Map instance); + + default T aHyphenMinusB(String value) { + var instance = getInstance(); + instance.put("A-B", value); + return getBuilderAfterFakeparametercollisions1ababselfabPostAB(instance); + } + } + + public interface SetterForFakeparametercollisions1ababselfabPostself { + Map getInstance(); + T getBuilderAfterFakeparametercollisions1ababselfabPostself(Map instance); + + default T self(String value) { + var instance = getInstance(); + instance.put("self", value); + return getBuilderAfterFakeparametercollisions1ababselfabPostself(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostCookieParametersMapBuilder implements GenericBuilder>, SetterForFakeparametercollisions1ababselfabPost1, SetterForFakeparametercollisions1ababselfabPostaB, SetterForFakeparametercollisions1ababselfabPostAb, SetterForFakeparametercollisions1ababselfabPostAB, SetterForFakeparametercollisions1ababselfabPostself { + private final Map instance; + private static final Set knownKeys = Set.of( + "1", + "aB", + "Ab", + "A-B", + "self" + ); + public Set getKnownKeys() { + return knownKeys; + } + public Fakeparametercollisions1ababselfabPostCookieParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map build() { + return instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostCookieParametersMapBuilder getBuilderAfterFakeparametercollisions1ababselfabPost1(Map instance) { + return this; + } + public Fakeparametercollisions1ababselfabPostCookieParametersMapBuilder getBuilderAfterFakeparametercollisions1ababselfabPostaB(Map instance) { + return this; + } + public Fakeparametercollisions1ababselfabPostCookieParametersMapBuilder getBuilderAfterFakeparametercollisions1ababselfabPostAb(Map instance) { + return this; + } + public Fakeparametercollisions1ababselfabPostCookieParametersMapBuilder getBuilderAfterFakeparametercollisions1ababselfabPostAB(Map instance) { + return this; + } + public Fakeparametercollisions1ababselfabPostCookieParametersMapBuilder getBuilderAfterFakeparametercollisions1ababselfabPostself(Map instance) { + return this; + } + } + + + public sealed interface Fakeparametercollisions1ababselfabPostCookieParameters1Boxed permits Fakeparametercollisions1ababselfabPostCookieParameters1BoxedMap { + @Nullable Object getData(); + } + + public record Fakeparametercollisions1ababselfabPostCookieParameters1BoxedMap(Fakeparametercollisions1ababselfabPostCookieParametersMap data) implements Fakeparametercollisions1ababselfabPostCookieParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class Fakeparametercollisions1ababselfabPostCookieParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable Fakeparametercollisions1ababselfabPostCookieParameters1 instance = null; + + protected Fakeparametercollisions1ababselfabPostCookieParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("1", Schema14.Schema141.class), + new PropertyEntry("aB", Schema15.Schema151.class), + new PropertyEntry("Ab", Schema16.Schema161.class), + new PropertyEntry("A-B", Schema18.Schema181.class), + new PropertyEntry("self", Schema17.Schema171.class) + )) + .additionalProperties(Fakeparametercollisions1ababselfabPostadditionalProperties.class) + ); + } + + public static Fakeparametercollisions1ababselfabPostCookieParameters1 getInstance() { + if (instance == null) { + instance = new Fakeparametercollisions1ababselfabPostCookieParameters1(); + } + return instance; + } + + public Fakeparametercollisions1ababselfabPostCookieParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + properties.put(propertyName, propertyInstance); + } + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); + return new Fakeparametercollisions1ababselfabPostCookieParametersMap(castProperties); + } + + public Fakeparametercollisions1ababselfabPostCookieParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public Fakeparametercollisions1ababselfabPostCookieParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new Fakeparametercollisions1ababselfabPostCookieParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public Fakeparametercollisions1ababselfabPostCookieParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostHeaderParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostHeaderParameters.java new file mode 100644 index 00000000000..2effb73792e --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostHeaderParameters.java @@ -0,0 +1,258 @@ +package org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter5.Schema5; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter6.Schema6; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter7.Schema7; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter8.Schema8; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class Fakeparametercollisions1ababselfabPostHeaderParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class Fakeparametercollisions1ababselfabPostadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable Fakeparametercollisions1ababselfabPostadditionalProperties instance = null; + public static Fakeparametercollisions1ababselfabPostadditionalProperties getInstance() { + if (instance == null) { + instance = new Fakeparametercollisions1ababselfabPostadditionalProperties(); + } + return instance; + } + } + + + public static class Fakeparametercollisions1ababselfabPostHeaderParametersMap extends FrozenMap<@Nullable Object> { + protected Fakeparametercollisions1ababselfabPostHeaderParametersMap(FrozenMap<@Nullable Object> m) { + super(m); + } + public static final Set requiredKeys = Set.of(); + public static final Set optionalKeys = Set.of( + "1", + "aB", + "A-B", + "self" + ); + public static Fakeparametercollisions1ababselfabPostHeaderParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return Fakeparametercollisions1ababselfabPostHeaderParameters1.getInstance().validate(arg, configuration); + } + + public String aB() throws UnsetPropertyException { + String key = "aB"; + throwIfKeyNotPresent(key); + @Nullable Object value = get(key); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for aB"); + } + return (String) value; + } + + public String self() throws UnsetPropertyException { + String key = "self"; + throwIfKeyNotPresent(key); + @Nullable Object value = get(key); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for self"); + } + return (String) value; + } + } + + public interface SetterForFakeparametercollisions1ababselfabPost1 { + Map getInstance(); + T getBuilderAfterFakeparametercollisions1ababselfabPost1(Map instance); + + default T positive1(String value) { + var instance = getInstance(); + instance.put("1", value); + return getBuilderAfterFakeparametercollisions1ababselfabPost1(instance); + } + } + + public interface SetterForFakeparametercollisions1ababselfabPostaB { + Map getInstance(); + T getBuilderAfterFakeparametercollisions1ababselfabPostaB(Map instance); + + default T aB(String value) { + var instance = getInstance(); + instance.put("aB", value); + return getBuilderAfterFakeparametercollisions1ababselfabPostaB(instance); + } + } + + public interface SetterForFakeparametercollisions1ababselfabPostAB { + Map getInstance(); + T getBuilderAfterFakeparametercollisions1ababselfabPostAB(Map instance); + + default T aHyphenMinusB(String value) { + var instance = getInstance(); + instance.put("A-B", value); + return getBuilderAfterFakeparametercollisions1ababselfabPostAB(instance); + } + } + + public interface SetterForFakeparametercollisions1ababselfabPostself { + Map getInstance(); + T getBuilderAfterFakeparametercollisions1ababselfabPostself(Map instance); + + default T self(String value) { + var instance = getInstance(); + instance.put("self", value); + return getBuilderAfterFakeparametercollisions1ababselfabPostself(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostHeaderParametersMapBuilder implements GenericBuilder>, SetterForFakeparametercollisions1ababselfabPost1, SetterForFakeparametercollisions1ababselfabPostaB, SetterForFakeparametercollisions1ababselfabPostAB, SetterForFakeparametercollisions1ababselfabPostself { + private final Map instance; + private static final Set knownKeys = Set.of( + "1", + "aB", + "A-B", + "self" + ); + public Set getKnownKeys() { + return knownKeys; + } + public Fakeparametercollisions1ababselfabPostHeaderParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map build() { + return instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostHeaderParametersMapBuilder getBuilderAfterFakeparametercollisions1ababselfabPost1(Map instance) { + return this; + } + public Fakeparametercollisions1ababselfabPostHeaderParametersMapBuilder getBuilderAfterFakeparametercollisions1ababselfabPostaB(Map instance) { + return this; + } + public Fakeparametercollisions1ababselfabPostHeaderParametersMapBuilder getBuilderAfterFakeparametercollisions1ababselfabPostAB(Map instance) { + return this; + } + public Fakeparametercollisions1ababselfabPostHeaderParametersMapBuilder getBuilderAfterFakeparametercollisions1ababselfabPostself(Map instance) { + return this; + } + } + + + public sealed interface Fakeparametercollisions1ababselfabPostHeaderParameters1Boxed permits Fakeparametercollisions1ababselfabPostHeaderParameters1BoxedMap { + @Nullable Object getData(); + } + + public record Fakeparametercollisions1ababselfabPostHeaderParameters1BoxedMap(Fakeparametercollisions1ababselfabPostHeaderParametersMap data) implements Fakeparametercollisions1ababselfabPostHeaderParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class Fakeparametercollisions1ababselfabPostHeaderParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable Fakeparametercollisions1ababselfabPostHeaderParameters1 instance = null; + + protected Fakeparametercollisions1ababselfabPostHeaderParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("1", Schema5.Schema51.class), + new PropertyEntry("aB", Schema6.Schema61.class), + new PropertyEntry("A-B", Schema8.Schema81.class), + new PropertyEntry("self", Schema7.Schema71.class) + )) + .additionalProperties(Fakeparametercollisions1ababselfabPostadditionalProperties.class) + ); + } + + public static Fakeparametercollisions1ababselfabPostHeaderParameters1 getInstance() { + if (instance == null) { + instance = new Fakeparametercollisions1ababselfabPostHeaderParameters1(); + } + return instance; + } + + public Fakeparametercollisions1ababselfabPostHeaderParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + properties.put(propertyName, propertyInstance); + } + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); + return new Fakeparametercollisions1ababselfabPostHeaderParametersMap(castProperties); + } + + public Fakeparametercollisions1ababselfabPostHeaderParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public Fakeparametercollisions1ababselfabPostHeaderParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new Fakeparametercollisions1ababselfabPostHeaderParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public Fakeparametercollisions1ababselfabPostHeaderParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostPathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostPathParameters.java new file mode 100644 index 00000000000..83039b2ef64 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostPathParameters.java @@ -0,0 +1,819 @@ +package org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter10.Schema10; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter11.Schema11; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter12.Schema12; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter13.Schema13; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter9.Schema9; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class Fakeparametercollisions1ababselfabPostPathParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class Fakeparametercollisions1ababselfabPostadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable Fakeparametercollisions1ababselfabPostadditionalProperties instance = null; + public static Fakeparametercollisions1ababselfabPostadditionalProperties getInstance() { + if (instance == null) { + instance = new Fakeparametercollisions1ababselfabPostadditionalProperties(); + } + return instance; + } + } + + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap extends FrozenMap<@Nullable Object> { + protected Fakeparametercollisions1ababselfabPostPathParametersMap(FrozenMap<@Nullable Object> m) { + super(m); + } + public static final Set requiredKeys = Set.of( + "1", + "A-B", + "Ab", + "aB", + "self" + ); + public static final Set optionalKeys = Set.of(); + public static Fakeparametercollisions1ababselfabPostPathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return Fakeparametercollisions1ababselfabPostPathParameters1.getInstance().validate(arg, configuration); + } + + public String Ab() { + @Nullable Object value = get("Ab"); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for Ab"); + } + return (String) value; + } + + public String aB() { + @Nullable Object value = get("aB"); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for aB"); + } + return (String) value; + } + + public String self() { + @Nullable Object value = get("self"); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for self"); + } + return (String) value; + } + } + + public interface SetterForFakeparametercollisions1ababselfabPost1 { + Map getInstance(); + T getBuilderAfterFakeparametercollisions1ababselfabPost1(Map instance); + + default T positive1(String value) { + var instance = getInstance(); + instance.put("1", value); + return getBuilderAfterFakeparametercollisions1ababselfabPost1(instance); + } + } + + public interface SetterForFakeparametercollisions1ababselfabPostAB { + Map getInstance(); + T getBuilderAfterFakeparametercollisions1ababselfabPostAB(Map instance); + + default T aHyphenMinusB(String value) { + var instance = getInstance(); + instance.put("A-B", value); + return getBuilderAfterFakeparametercollisions1ababselfabPostAB(instance); + } + } + + public interface SetterForFakeparametercollisions1ababselfabPostAb { + Map getInstance(); + T getBuilderAfterFakeparametercollisions1ababselfabPostAb(Map instance); + + default T Ab(String value) { + var instance = getInstance(); + instance.put("Ab", value); + return getBuilderAfterFakeparametercollisions1ababselfabPostAb(instance); + } + } + + public interface SetterForFakeparametercollisions1ababselfabPostaB { + Map getInstance(); + T getBuilderAfterFakeparametercollisions1ababselfabPostaB(Map instance); + + default T aB(String value) { + var instance = getInstance(); + instance.put("aB", value); + return getBuilderAfterFakeparametercollisions1ababselfabPostaB(instance); + } + } + + public interface SetterForFakeparametercollisions1ababselfabPostself { + Map getInstance(); + T getBuilderAfterFakeparametercollisions1ababselfabPostself(Map instance); + + default T self(String value) { + var instance = getInstance(); + instance.put("self", value); + return getBuilderAfterFakeparametercollisions1ababselfabPostself(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap00000Builder implements GenericBuilder> { + private final Map instance; + private static final Set knownKeys = Set.of( + "1", + "A-B", + "Ab", + "aB", + "self" + ); + public Set getKnownKeys() { + return knownKeys; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap00000Builder(Map instance) { + this.instance = instance; + } + public Map build() { + return instance; + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap00001Builder implements SetterForFakeparametercollisions1ababselfabPostself { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap00001Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap00000Builder getBuilderAfterFakeparametercollisions1ababselfabPostself(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap00000Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap00010Builder implements SetterForFakeparametercollisions1ababselfabPostaB { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap00010Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap00000Builder getBuilderAfterFakeparametercollisions1ababselfabPostaB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap00000Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap00011Builder implements SetterForFakeparametercollisions1ababselfabPostaB, SetterForFakeparametercollisions1ababselfabPostself { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap00011Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap00001Builder getBuilderAfterFakeparametercollisions1ababselfabPostaB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap00001Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap00010Builder getBuilderAfterFakeparametercollisions1ababselfabPostself(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap00010Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap00100Builder implements SetterForFakeparametercollisions1ababselfabPostAb { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap00100Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap00000Builder getBuilderAfterFakeparametercollisions1ababselfabPostAb(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap00000Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap00101Builder implements SetterForFakeparametercollisions1ababselfabPostAb, SetterForFakeparametercollisions1ababselfabPostself { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap00101Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap00001Builder getBuilderAfterFakeparametercollisions1ababselfabPostAb(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap00001Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap00100Builder getBuilderAfterFakeparametercollisions1ababselfabPostself(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap00100Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap00110Builder implements SetterForFakeparametercollisions1ababselfabPostAb, SetterForFakeparametercollisions1ababselfabPostaB { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap00110Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap00010Builder getBuilderAfterFakeparametercollisions1ababselfabPostAb(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap00010Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap00100Builder getBuilderAfterFakeparametercollisions1ababselfabPostaB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap00100Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap00111Builder implements SetterForFakeparametercollisions1ababselfabPostAb, SetterForFakeparametercollisions1ababselfabPostaB, SetterForFakeparametercollisions1ababselfabPostself { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap00111Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap00011Builder getBuilderAfterFakeparametercollisions1ababselfabPostAb(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap00011Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap00101Builder getBuilderAfterFakeparametercollisions1ababselfabPostaB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap00101Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap00110Builder getBuilderAfterFakeparametercollisions1ababselfabPostself(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap00110Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap01000Builder implements SetterForFakeparametercollisions1ababselfabPostAB { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap01000Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap00000Builder getBuilderAfterFakeparametercollisions1ababselfabPostAB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap00000Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap01001Builder implements SetterForFakeparametercollisions1ababselfabPostAB, SetterForFakeparametercollisions1ababselfabPostself { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap01001Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap00001Builder getBuilderAfterFakeparametercollisions1ababselfabPostAB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap00001Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap01000Builder getBuilderAfterFakeparametercollisions1ababselfabPostself(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap01000Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap01010Builder implements SetterForFakeparametercollisions1ababselfabPostAB, SetterForFakeparametercollisions1ababselfabPostaB { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap01010Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap00010Builder getBuilderAfterFakeparametercollisions1ababselfabPostAB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap00010Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap01000Builder getBuilderAfterFakeparametercollisions1ababselfabPostaB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap01000Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap01011Builder implements SetterForFakeparametercollisions1ababselfabPostAB, SetterForFakeparametercollisions1ababselfabPostaB, SetterForFakeparametercollisions1ababselfabPostself { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap01011Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap00011Builder getBuilderAfterFakeparametercollisions1ababselfabPostAB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap00011Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap01001Builder getBuilderAfterFakeparametercollisions1ababselfabPostaB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap01001Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap01010Builder getBuilderAfterFakeparametercollisions1ababselfabPostself(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap01010Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap01100Builder implements SetterForFakeparametercollisions1ababselfabPostAB, SetterForFakeparametercollisions1ababselfabPostAb { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap01100Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap00100Builder getBuilderAfterFakeparametercollisions1ababselfabPostAB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap00100Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap01000Builder getBuilderAfterFakeparametercollisions1ababselfabPostAb(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap01000Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap01101Builder implements SetterForFakeparametercollisions1ababselfabPostAB, SetterForFakeparametercollisions1ababselfabPostAb, SetterForFakeparametercollisions1ababselfabPostself { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap01101Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap00101Builder getBuilderAfterFakeparametercollisions1ababselfabPostAB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap00101Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap01001Builder getBuilderAfterFakeparametercollisions1ababselfabPostAb(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap01001Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap01100Builder getBuilderAfterFakeparametercollisions1ababselfabPostself(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap01100Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap01110Builder implements SetterForFakeparametercollisions1ababselfabPostAB, SetterForFakeparametercollisions1ababselfabPostAb, SetterForFakeparametercollisions1ababselfabPostaB { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap01110Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap00110Builder getBuilderAfterFakeparametercollisions1ababselfabPostAB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap00110Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap01010Builder getBuilderAfterFakeparametercollisions1ababselfabPostAb(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap01010Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap01100Builder getBuilderAfterFakeparametercollisions1ababselfabPostaB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap01100Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap01111Builder implements SetterForFakeparametercollisions1ababselfabPostAB, SetterForFakeparametercollisions1ababselfabPostAb, SetterForFakeparametercollisions1ababselfabPostaB, SetterForFakeparametercollisions1ababselfabPostself { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap01111Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap00111Builder getBuilderAfterFakeparametercollisions1ababselfabPostAB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap00111Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap01011Builder getBuilderAfterFakeparametercollisions1ababselfabPostAb(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap01011Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap01101Builder getBuilderAfterFakeparametercollisions1ababselfabPostaB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap01101Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap01110Builder getBuilderAfterFakeparametercollisions1ababselfabPostself(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap01110Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap10000Builder implements SetterForFakeparametercollisions1ababselfabPost1 { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap10000Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap00000Builder getBuilderAfterFakeparametercollisions1ababselfabPost1(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap00000Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap10001Builder implements SetterForFakeparametercollisions1ababselfabPost1, SetterForFakeparametercollisions1ababselfabPostself { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap10001Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap00001Builder getBuilderAfterFakeparametercollisions1ababselfabPost1(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap00001Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap10000Builder getBuilderAfterFakeparametercollisions1ababselfabPostself(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap10000Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap10010Builder implements SetterForFakeparametercollisions1ababselfabPost1, SetterForFakeparametercollisions1ababselfabPostaB { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap10010Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap00010Builder getBuilderAfterFakeparametercollisions1ababselfabPost1(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap00010Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap10000Builder getBuilderAfterFakeparametercollisions1ababselfabPostaB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap10000Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap10011Builder implements SetterForFakeparametercollisions1ababselfabPost1, SetterForFakeparametercollisions1ababselfabPostaB, SetterForFakeparametercollisions1ababselfabPostself { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap10011Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap00011Builder getBuilderAfterFakeparametercollisions1ababselfabPost1(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap00011Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap10001Builder getBuilderAfterFakeparametercollisions1ababselfabPostaB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap10001Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap10010Builder getBuilderAfterFakeparametercollisions1ababselfabPostself(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap10010Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap10100Builder implements SetterForFakeparametercollisions1ababselfabPost1, SetterForFakeparametercollisions1ababselfabPostAb { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap10100Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap00100Builder getBuilderAfterFakeparametercollisions1ababselfabPost1(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap00100Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap10000Builder getBuilderAfterFakeparametercollisions1ababselfabPostAb(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap10000Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap10101Builder implements SetterForFakeparametercollisions1ababselfabPost1, SetterForFakeparametercollisions1ababselfabPostAb, SetterForFakeparametercollisions1ababselfabPostself { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap10101Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap00101Builder getBuilderAfterFakeparametercollisions1ababselfabPost1(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap00101Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap10001Builder getBuilderAfterFakeparametercollisions1ababselfabPostAb(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap10001Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap10100Builder getBuilderAfterFakeparametercollisions1ababselfabPostself(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap10100Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap10110Builder implements SetterForFakeparametercollisions1ababselfabPost1, SetterForFakeparametercollisions1ababselfabPostAb, SetterForFakeparametercollisions1ababselfabPostaB { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap10110Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap00110Builder getBuilderAfterFakeparametercollisions1ababselfabPost1(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap00110Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap10010Builder getBuilderAfterFakeparametercollisions1ababselfabPostAb(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap10010Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap10100Builder getBuilderAfterFakeparametercollisions1ababselfabPostaB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap10100Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap10111Builder implements SetterForFakeparametercollisions1ababselfabPost1, SetterForFakeparametercollisions1ababselfabPostAb, SetterForFakeparametercollisions1ababselfabPostaB, SetterForFakeparametercollisions1ababselfabPostself { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap10111Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap00111Builder getBuilderAfterFakeparametercollisions1ababselfabPost1(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap00111Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap10011Builder getBuilderAfterFakeparametercollisions1ababselfabPostAb(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap10011Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap10101Builder getBuilderAfterFakeparametercollisions1ababselfabPostaB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap10101Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap10110Builder getBuilderAfterFakeparametercollisions1ababselfabPostself(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap10110Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap11000Builder implements SetterForFakeparametercollisions1ababselfabPost1, SetterForFakeparametercollisions1ababselfabPostAB { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap11000Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap01000Builder getBuilderAfterFakeparametercollisions1ababselfabPost1(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap01000Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap10000Builder getBuilderAfterFakeparametercollisions1ababselfabPostAB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap10000Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap11001Builder implements SetterForFakeparametercollisions1ababselfabPost1, SetterForFakeparametercollisions1ababselfabPostAB, SetterForFakeparametercollisions1ababselfabPostself { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap11001Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap01001Builder getBuilderAfterFakeparametercollisions1ababselfabPost1(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap01001Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap10001Builder getBuilderAfterFakeparametercollisions1ababselfabPostAB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap10001Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap11000Builder getBuilderAfterFakeparametercollisions1ababselfabPostself(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap11000Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap11010Builder implements SetterForFakeparametercollisions1ababselfabPost1, SetterForFakeparametercollisions1ababselfabPostAB, SetterForFakeparametercollisions1ababselfabPostaB { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap11010Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap01010Builder getBuilderAfterFakeparametercollisions1ababselfabPost1(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap01010Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap10010Builder getBuilderAfterFakeparametercollisions1ababselfabPostAB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap10010Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap11000Builder getBuilderAfterFakeparametercollisions1ababselfabPostaB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap11000Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap11011Builder implements SetterForFakeparametercollisions1ababselfabPost1, SetterForFakeparametercollisions1ababselfabPostAB, SetterForFakeparametercollisions1ababselfabPostaB, SetterForFakeparametercollisions1ababselfabPostself { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap11011Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap01011Builder getBuilderAfterFakeparametercollisions1ababselfabPost1(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap01011Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap10011Builder getBuilderAfterFakeparametercollisions1ababselfabPostAB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap10011Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap11001Builder getBuilderAfterFakeparametercollisions1ababselfabPostaB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap11001Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap11010Builder getBuilderAfterFakeparametercollisions1ababselfabPostself(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap11010Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap11100Builder implements SetterForFakeparametercollisions1ababselfabPost1, SetterForFakeparametercollisions1ababselfabPostAB, SetterForFakeparametercollisions1ababselfabPostAb { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap11100Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap01100Builder getBuilderAfterFakeparametercollisions1ababselfabPost1(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap01100Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap10100Builder getBuilderAfterFakeparametercollisions1ababselfabPostAB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap10100Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap11000Builder getBuilderAfterFakeparametercollisions1ababselfabPostAb(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap11000Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap11101Builder implements SetterForFakeparametercollisions1ababselfabPost1, SetterForFakeparametercollisions1ababselfabPostAB, SetterForFakeparametercollisions1ababselfabPostAb, SetterForFakeparametercollisions1ababselfabPostself { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap11101Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap01101Builder getBuilderAfterFakeparametercollisions1ababselfabPost1(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap01101Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap10101Builder getBuilderAfterFakeparametercollisions1ababselfabPostAB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap10101Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap11001Builder getBuilderAfterFakeparametercollisions1ababselfabPostAb(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap11001Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap11100Builder getBuilderAfterFakeparametercollisions1ababselfabPostself(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap11100Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMap11110Builder implements SetterForFakeparametercollisions1ababselfabPost1, SetterForFakeparametercollisions1ababselfabPostAB, SetterForFakeparametercollisions1ababselfabPostAb, SetterForFakeparametercollisions1ababselfabPostaB { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMap11110Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap01110Builder getBuilderAfterFakeparametercollisions1ababselfabPost1(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap01110Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap10110Builder getBuilderAfterFakeparametercollisions1ababselfabPostAB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap10110Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap11010Builder getBuilderAfterFakeparametercollisions1ababselfabPostAb(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap11010Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap11100Builder getBuilderAfterFakeparametercollisions1ababselfabPostaB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap11100Builder(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostPathParametersMapBuilder implements SetterForFakeparametercollisions1ababselfabPost1, SetterForFakeparametercollisions1ababselfabPostAB, SetterForFakeparametercollisions1ababselfabPostAb, SetterForFakeparametercollisions1ababselfabPostaB, SetterForFakeparametercollisions1ababselfabPostself { + private final Map instance; + public Fakeparametercollisions1ababselfabPostPathParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostPathParametersMap01111Builder getBuilderAfterFakeparametercollisions1ababselfabPost1(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap01111Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap10111Builder getBuilderAfterFakeparametercollisions1ababselfabPostAB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap10111Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap11011Builder getBuilderAfterFakeparametercollisions1ababselfabPostAb(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap11011Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap11101Builder getBuilderAfterFakeparametercollisions1ababselfabPostaB(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap11101Builder(instance); + } + public Fakeparametercollisions1ababselfabPostPathParametersMap11110Builder getBuilderAfterFakeparametercollisions1ababselfabPostself(Map instance) { + return new Fakeparametercollisions1ababselfabPostPathParametersMap11110Builder(instance); + } + } + + + public sealed interface Fakeparametercollisions1ababselfabPostPathParameters1Boxed permits Fakeparametercollisions1ababselfabPostPathParameters1BoxedMap { + @Nullable Object getData(); + } + + public record Fakeparametercollisions1ababselfabPostPathParameters1BoxedMap(Fakeparametercollisions1ababselfabPostPathParametersMap data) implements Fakeparametercollisions1ababselfabPostPathParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class Fakeparametercollisions1ababselfabPostPathParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable Fakeparametercollisions1ababselfabPostPathParameters1 instance = null; + + protected Fakeparametercollisions1ababselfabPostPathParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("1", Schema9.Schema91.class), + new PropertyEntry("aB", Schema10.Schema101.class), + new PropertyEntry("Ab", Schema11.Schema111.class), + new PropertyEntry("A-B", Schema13.Schema131.class), + new PropertyEntry("self", Schema12.Schema121.class) + )) + .required(Set.of( + "1", + "A-B", + "Ab", + "aB", + "self" + )) + .additionalProperties(Fakeparametercollisions1ababselfabPostadditionalProperties.class) + ); + } + + public static Fakeparametercollisions1ababselfabPostPathParameters1 getInstance() { + if (instance == null) { + instance = new Fakeparametercollisions1ababselfabPostPathParameters1(); + } + return instance; + } + + public Fakeparametercollisions1ababselfabPostPathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + properties.put(propertyName, propertyInstance); + } + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); + return new Fakeparametercollisions1ababselfabPostPathParametersMap(castProperties); + } + + public Fakeparametercollisions1ababselfabPostPathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public Fakeparametercollisions1ababselfabPostPathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new Fakeparametercollisions1ababselfabPostPathParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public Fakeparametercollisions1ababselfabPostPathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostQueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostQueryParameters.java new file mode 100644 index 00000000000..eb8ec9f9eff --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostQueryParameters.java @@ -0,0 +1,286 @@ +package org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter0.Schema0; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter1.Schema1; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter2.Schema2; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter3.Schema3; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter4.Schema4; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class Fakeparametercollisions1ababselfabPostQueryParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class Fakeparametercollisions1ababselfabPostadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable Fakeparametercollisions1ababselfabPostadditionalProperties instance = null; + public static Fakeparametercollisions1ababselfabPostadditionalProperties getInstance() { + if (instance == null) { + instance = new Fakeparametercollisions1ababselfabPostadditionalProperties(); + } + return instance; + } + } + + + public static class Fakeparametercollisions1ababselfabPostQueryParametersMap extends FrozenMap<@Nullable Object> { + protected Fakeparametercollisions1ababselfabPostQueryParametersMap(FrozenMap<@Nullable Object> m) { + super(m); + } + public static final Set requiredKeys = Set.of(); + public static final Set optionalKeys = Set.of( + "1", + "aB", + "Ab", + "A-B", + "self" + ); + public static Fakeparametercollisions1ababselfabPostQueryParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return Fakeparametercollisions1ababselfabPostQueryParameters1.getInstance().validate(arg, configuration); + } + + public String aB() throws UnsetPropertyException { + String key = "aB"; + throwIfKeyNotPresent(key); + @Nullable Object value = get(key); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for aB"); + } + return (String) value; + } + + public String Ab() throws UnsetPropertyException { + String key = "Ab"; + throwIfKeyNotPresent(key); + @Nullable Object value = get(key); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for Ab"); + } + return (String) value; + } + + public String self() throws UnsetPropertyException { + String key = "self"; + throwIfKeyNotPresent(key); + @Nullable Object value = get(key); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for self"); + } + return (String) value; + } + } + + public interface SetterForFakeparametercollisions1ababselfabPost1 { + Map getInstance(); + T getBuilderAfterFakeparametercollisions1ababselfabPost1(Map instance); + + default T positive1(String value) { + var instance = getInstance(); + instance.put("1", value); + return getBuilderAfterFakeparametercollisions1ababselfabPost1(instance); + } + } + + public interface SetterForFakeparametercollisions1ababselfabPostaB { + Map getInstance(); + T getBuilderAfterFakeparametercollisions1ababselfabPostaB(Map instance); + + default T aB(String value) { + var instance = getInstance(); + instance.put("aB", value); + return getBuilderAfterFakeparametercollisions1ababselfabPostaB(instance); + } + } + + public interface SetterForFakeparametercollisions1ababselfabPostAb { + Map getInstance(); + T getBuilderAfterFakeparametercollisions1ababselfabPostAb(Map instance); + + default T Ab(String value) { + var instance = getInstance(); + instance.put("Ab", value); + return getBuilderAfterFakeparametercollisions1ababselfabPostAb(instance); + } + } + + public interface SetterForFakeparametercollisions1ababselfabPostAB { + Map getInstance(); + T getBuilderAfterFakeparametercollisions1ababselfabPostAB(Map instance); + + default T aHyphenMinusB(String value) { + var instance = getInstance(); + instance.put("A-B", value); + return getBuilderAfterFakeparametercollisions1ababselfabPostAB(instance); + } + } + + public interface SetterForFakeparametercollisions1ababselfabPostself { + Map getInstance(); + T getBuilderAfterFakeparametercollisions1ababselfabPostself(Map instance); + + default T self(String value) { + var instance = getInstance(); + instance.put("self", value); + return getBuilderAfterFakeparametercollisions1ababselfabPostself(instance); + } + } + + public static class Fakeparametercollisions1ababselfabPostQueryParametersMapBuilder implements GenericBuilder>, SetterForFakeparametercollisions1ababselfabPost1, SetterForFakeparametercollisions1ababselfabPostaB, SetterForFakeparametercollisions1ababselfabPostAb, SetterForFakeparametercollisions1ababselfabPostAB, SetterForFakeparametercollisions1ababselfabPostself { + private final Map instance; + private static final Set knownKeys = Set.of( + "1", + "aB", + "Ab", + "A-B", + "self" + ); + public Set getKnownKeys() { + return knownKeys; + } + public Fakeparametercollisions1ababselfabPostQueryParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map build() { + return instance; + } + public Map getInstance() { + return instance; + } + public Fakeparametercollisions1ababselfabPostQueryParametersMapBuilder getBuilderAfterFakeparametercollisions1ababselfabPost1(Map instance) { + return this; + } + public Fakeparametercollisions1ababselfabPostQueryParametersMapBuilder getBuilderAfterFakeparametercollisions1ababselfabPostaB(Map instance) { + return this; + } + public Fakeparametercollisions1ababselfabPostQueryParametersMapBuilder getBuilderAfterFakeparametercollisions1ababselfabPostAb(Map instance) { + return this; + } + public Fakeparametercollisions1ababselfabPostQueryParametersMapBuilder getBuilderAfterFakeparametercollisions1ababselfabPostAB(Map instance) { + return this; + } + public Fakeparametercollisions1ababselfabPostQueryParametersMapBuilder getBuilderAfterFakeparametercollisions1ababselfabPostself(Map instance) { + return this; + } + } + + + public sealed interface Fakeparametercollisions1ababselfabPostQueryParameters1Boxed permits Fakeparametercollisions1ababselfabPostQueryParameters1BoxedMap { + @Nullable Object getData(); + } + + public record Fakeparametercollisions1ababselfabPostQueryParameters1BoxedMap(Fakeparametercollisions1ababselfabPostQueryParametersMap data) implements Fakeparametercollisions1ababselfabPostQueryParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class Fakeparametercollisions1ababselfabPostQueryParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable Fakeparametercollisions1ababselfabPostQueryParameters1 instance = null; + + protected Fakeparametercollisions1ababselfabPostQueryParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("1", Schema0.Schema01.class), + new PropertyEntry("aB", Schema1.Schema11.class), + new PropertyEntry("Ab", Schema2.Schema21.class), + new PropertyEntry("A-B", Schema4.Schema41.class), + new PropertyEntry("self", Schema3.Schema31.class) + )) + .additionalProperties(Fakeparametercollisions1ababselfabPostadditionalProperties.class) + ); + } + + public static Fakeparametercollisions1ababselfabPostQueryParameters1 getInstance() { + if (instance == null) { + instance = new Fakeparametercollisions1ababselfabPostQueryParameters1(); + } + return instance; + } + + public Fakeparametercollisions1ababselfabPostQueryParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + properties.put(propertyName, propertyInstance); + } + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); + return new Fakeparametercollisions1ababselfabPostQueryParametersMap(castProperties); + } + + public Fakeparametercollisions1ababselfabPostQueryParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public Fakeparametercollisions1ababselfabPostQueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new Fakeparametercollisions1ababselfabPostQueryParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public Fakeparametercollisions1ababselfabPostQueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostRequestBody.java new file mode 100644 index 00000000000..82857193702 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostRequestBody.java @@ -0,0 +1,53 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.requestbody.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class Fakeparametercollisions1ababselfabPostRequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class Fakeparametercollisions1ababselfabPostRequestBody1 extends RequestBodySerializer { + public Fakeparametercollisions1ababselfabPostRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ), + false + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } + } + + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "application/json"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostResponses.java new file mode 100644 index 00000000000..b5e3bc67446 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/Fakeparametercollisions1ababselfabPostResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post; + +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.responses.Fakeparametercollisions1ababselfabPostCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class Fakeparametercollisions1ababselfabPostResponses { + public sealed interface EndpointResponse permits EndpointFakeparametercollisions1ababselfabPostCode200Response {} + + public record EndpointFakeparametercollisions1ababselfabPostCode200Response( + HttpResponse response, + Fakeparametercollisions1ababselfabPostCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakeparametercollisions1ababselfabPostCode200ResponseDeserializer {} + + public static final class StatusFakeparametercollisions1ababselfabPostCode200ResponseDeserializer extends Fakeparametercollisions1ababselfabPostCode200Response.Fakeparametercollisions1ababselfabPostCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class Fakeparametercollisions1ababselfabPostResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public Fakeparametercollisions1ababselfabPostResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakeparametercollisions1ababselfabPostCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakeparametercollisions1ababselfabPostCode200ResponseDeserializer castDeserializer = (StatusFakeparametercollisions1ababselfabPostCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakeparametercollisions1ababselfabPostCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/HeaderParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/HeaderParameters.java deleted file mode 100644 index 39fa1cd2444..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/HeaderParameters.java +++ /dev/null @@ -1,258 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter5.Schema5; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter6.Schema6; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter7.Schema7; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter8.Schema8; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class HeaderParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class HeaderParametersMap extends FrozenMap<@Nullable Object> { - protected HeaderParametersMap(FrozenMap<@Nullable Object> m) { - super(m); - } - public static final Set requiredKeys = Set.of(); - public static final Set optionalKeys = Set.of( - "1", - "aB", - "A-B", - "self" - ); - public static HeaderParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return HeaderParameters1.getInstance().validate(arg, configuration); - } - - public String aB() throws UnsetPropertyException { - String key = "aB"; - throwIfKeyNotPresent(key); - @Nullable Object value = get(key); - if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for aB"); - } - return (String) value; - } - - public String self() throws UnsetPropertyException { - String key = "self"; - throwIfKeyNotPresent(key); - @Nullable Object value = get(key); - if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for self"); - } - return (String) value; - } - } - - public interface SetterForSchema1 { - Map getInstance(); - T getBuilderAfterSchema1(Map instance); - - default T positive1(String value) { - var instance = getInstance(); - instance.put("1", value); - return getBuilderAfterSchema1(instance); - } - } - - public interface SetterForAB { - Map getInstance(); - T getBuilderAfterAB(Map instance); - - default T aB(String value) { - var instance = getInstance(); - instance.put("aB", value); - return getBuilderAfterAB(instance); - } - } - - public interface SetterForAB1 { - Map getInstance(); - T getBuilderAfterAB1(Map instance); - - default T aHyphenMinusB(String value) { - var instance = getInstance(); - instance.put("A-B", value); - return getBuilderAfterAB1(instance); - } - } - - public interface SetterForSelf { - Map getInstance(); - T getBuilderAfterSelf(Map instance); - - default T self(String value) { - var instance = getInstance(); - instance.put("self", value); - return getBuilderAfterSelf(instance); - } - } - - public static class HeaderParametersMapBuilder implements GenericBuilder>, SetterForSchema1, SetterForAB, SetterForAB1, SetterForSelf { - private final Map instance; - private static final Set knownKeys = Set.of( - "1", - "aB", - "A-B", - "self" - ); - public Set getKnownKeys() { - return knownKeys; - } - public HeaderParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map build() { - return instance; - } - public Map getInstance() { - return instance; - } - public HeaderParametersMapBuilder getBuilderAfterSchema1(Map instance) { - return this; - } - public HeaderParametersMapBuilder getBuilderAfterAB(Map instance) { - return this; - } - public HeaderParametersMapBuilder getBuilderAfterAB1(Map instance) { - return this; - } - public HeaderParametersMapBuilder getBuilderAfterSelf(Map instance) { - return this; - } - } - - - public sealed interface HeaderParameters1Boxed permits HeaderParameters1BoxedMap { - @Nullable Object getData(); - } - - public record HeaderParameters1BoxedMap(HeaderParametersMap data) implements HeaderParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class HeaderParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable HeaderParameters1 instance = null; - - protected HeaderParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("1", Schema5.Schema51.class), - new PropertyEntry("aB", Schema6.Schema61.class), - new PropertyEntry("A-B", Schema8.Schema81.class), - new PropertyEntry("self", Schema7.Schema71.class) - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static HeaderParameters1 getInstance() { - if (instance == null) { - instance = new HeaderParameters1(); - } - return instance; - } - - public HeaderParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, propertyInstance); - } - FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); - return new HeaderParametersMap(castProperties); - } - - public HeaderParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public HeaderParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new HeaderParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public HeaderParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/PathParameters.java deleted file mode 100644 index 49acde7c086..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/PathParameters.java +++ /dev/null @@ -1,819 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter10.Schema10; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter11.Schema11; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter12.Schema12; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter13.Schema13; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter9.Schema9; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class PathParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class PathParametersMap extends FrozenMap<@Nullable Object> { - protected PathParametersMap(FrozenMap<@Nullable Object> m) { - super(m); - } - public static final Set requiredKeys = Set.of( - "1", - "A-B", - "Ab", - "aB", - "self" - ); - public static final Set optionalKeys = Set.of(); - public static PathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return PathParameters1.getInstance().validate(arg, configuration); - } - - public String Ab() { - @Nullable Object value = get("Ab"); - if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for Ab"); - } - return (String) value; - } - - public String aB() { - @Nullable Object value = get("aB"); - if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for aB"); - } - return (String) value; - } - - public String self() { - @Nullable Object value = get("self"); - if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for self"); - } - return (String) value; - } - } - - public interface SetterForSchema1 { - Map getInstance(); - T getBuilderAfterSchema1(Map instance); - - default T positive1(String value) { - var instance = getInstance(); - instance.put("1", value); - return getBuilderAfterSchema1(instance); - } - } - - public interface SetterForAB1 { - Map getInstance(); - T getBuilderAfterAB1(Map instance); - - default T aHyphenMinusB(String value) { - var instance = getInstance(); - instance.put("A-B", value); - return getBuilderAfterAB1(instance); - } - } - - public interface SetterForAb { - Map getInstance(); - T getBuilderAfterAb(Map instance); - - default T Ab(String value) { - var instance = getInstance(); - instance.put("Ab", value); - return getBuilderAfterAb(instance); - } - } - - public interface SetterForAB { - Map getInstance(); - T getBuilderAfterAB(Map instance); - - default T aB(String value) { - var instance = getInstance(); - instance.put("aB", value); - return getBuilderAfterAB(instance); - } - } - - public interface SetterForSelf { - Map getInstance(); - T getBuilderAfterSelf(Map instance); - - default T self(String value) { - var instance = getInstance(); - instance.put("self", value); - return getBuilderAfterSelf(instance); - } - } - - public static class PathParametersMap00000Builder implements GenericBuilder> { - private final Map instance; - private static final Set knownKeys = Set.of( - "1", - "A-B", - "Ab", - "aB", - "self" - ); - public Set getKnownKeys() { - return knownKeys; - } - public PathParametersMap00000Builder(Map instance) { - this.instance = instance; - } - public Map build() { - return instance; - } - } - - public static class PathParametersMap00001Builder implements SetterForSelf { - private final Map instance; - public PathParametersMap00001Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap00000Builder getBuilderAfterSelf(Map instance) { - return new PathParametersMap00000Builder(instance); - } - } - - public static class PathParametersMap00010Builder implements SetterForAB { - private final Map instance; - public PathParametersMap00010Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap00000Builder getBuilderAfterAB(Map instance) { - return new PathParametersMap00000Builder(instance); - } - } - - public static class PathParametersMap00011Builder implements SetterForAB, SetterForSelf { - private final Map instance; - public PathParametersMap00011Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap00001Builder getBuilderAfterAB(Map instance) { - return new PathParametersMap00001Builder(instance); - } - public PathParametersMap00010Builder getBuilderAfterSelf(Map instance) { - return new PathParametersMap00010Builder(instance); - } - } - - public static class PathParametersMap00100Builder implements SetterForAb { - private final Map instance; - public PathParametersMap00100Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap00000Builder getBuilderAfterAb(Map instance) { - return new PathParametersMap00000Builder(instance); - } - } - - public static class PathParametersMap00101Builder implements SetterForAb, SetterForSelf { - private final Map instance; - public PathParametersMap00101Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap00001Builder getBuilderAfterAb(Map instance) { - return new PathParametersMap00001Builder(instance); - } - public PathParametersMap00100Builder getBuilderAfterSelf(Map instance) { - return new PathParametersMap00100Builder(instance); - } - } - - public static class PathParametersMap00110Builder implements SetterForAb, SetterForAB { - private final Map instance; - public PathParametersMap00110Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap00010Builder getBuilderAfterAb(Map instance) { - return new PathParametersMap00010Builder(instance); - } - public PathParametersMap00100Builder getBuilderAfterAB(Map instance) { - return new PathParametersMap00100Builder(instance); - } - } - - public static class PathParametersMap00111Builder implements SetterForAb, SetterForAB, SetterForSelf { - private final Map instance; - public PathParametersMap00111Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap00011Builder getBuilderAfterAb(Map instance) { - return new PathParametersMap00011Builder(instance); - } - public PathParametersMap00101Builder getBuilderAfterAB(Map instance) { - return new PathParametersMap00101Builder(instance); - } - public PathParametersMap00110Builder getBuilderAfterSelf(Map instance) { - return new PathParametersMap00110Builder(instance); - } - } - - public static class PathParametersMap01000Builder implements SetterForAB1 { - private final Map instance; - public PathParametersMap01000Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap00000Builder getBuilderAfterAB1(Map instance) { - return new PathParametersMap00000Builder(instance); - } - } - - public static class PathParametersMap01001Builder implements SetterForAB1, SetterForSelf { - private final Map instance; - public PathParametersMap01001Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap00001Builder getBuilderAfterAB1(Map instance) { - return new PathParametersMap00001Builder(instance); - } - public PathParametersMap01000Builder getBuilderAfterSelf(Map instance) { - return new PathParametersMap01000Builder(instance); - } - } - - public static class PathParametersMap01010Builder implements SetterForAB1, SetterForAB { - private final Map instance; - public PathParametersMap01010Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap00010Builder getBuilderAfterAB1(Map instance) { - return new PathParametersMap00010Builder(instance); - } - public PathParametersMap01000Builder getBuilderAfterAB(Map instance) { - return new PathParametersMap01000Builder(instance); - } - } - - public static class PathParametersMap01011Builder implements SetterForAB1, SetterForAB, SetterForSelf { - private final Map instance; - public PathParametersMap01011Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap00011Builder getBuilderAfterAB1(Map instance) { - return new PathParametersMap00011Builder(instance); - } - public PathParametersMap01001Builder getBuilderAfterAB(Map instance) { - return new PathParametersMap01001Builder(instance); - } - public PathParametersMap01010Builder getBuilderAfterSelf(Map instance) { - return new PathParametersMap01010Builder(instance); - } - } - - public static class PathParametersMap01100Builder implements SetterForAB1, SetterForAb { - private final Map instance; - public PathParametersMap01100Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap00100Builder getBuilderAfterAB1(Map instance) { - return new PathParametersMap00100Builder(instance); - } - public PathParametersMap01000Builder getBuilderAfterAb(Map instance) { - return new PathParametersMap01000Builder(instance); - } - } - - public static class PathParametersMap01101Builder implements SetterForAB1, SetterForAb, SetterForSelf { - private final Map instance; - public PathParametersMap01101Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap00101Builder getBuilderAfterAB1(Map instance) { - return new PathParametersMap00101Builder(instance); - } - public PathParametersMap01001Builder getBuilderAfterAb(Map instance) { - return new PathParametersMap01001Builder(instance); - } - public PathParametersMap01100Builder getBuilderAfterSelf(Map instance) { - return new PathParametersMap01100Builder(instance); - } - } - - public static class PathParametersMap01110Builder implements SetterForAB1, SetterForAb, SetterForAB { - private final Map instance; - public PathParametersMap01110Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap00110Builder getBuilderAfterAB1(Map instance) { - return new PathParametersMap00110Builder(instance); - } - public PathParametersMap01010Builder getBuilderAfterAb(Map instance) { - return new PathParametersMap01010Builder(instance); - } - public PathParametersMap01100Builder getBuilderAfterAB(Map instance) { - return new PathParametersMap01100Builder(instance); - } - } - - public static class PathParametersMap01111Builder implements SetterForAB1, SetterForAb, SetterForAB, SetterForSelf { - private final Map instance; - public PathParametersMap01111Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap00111Builder getBuilderAfterAB1(Map instance) { - return new PathParametersMap00111Builder(instance); - } - public PathParametersMap01011Builder getBuilderAfterAb(Map instance) { - return new PathParametersMap01011Builder(instance); - } - public PathParametersMap01101Builder getBuilderAfterAB(Map instance) { - return new PathParametersMap01101Builder(instance); - } - public PathParametersMap01110Builder getBuilderAfterSelf(Map instance) { - return new PathParametersMap01110Builder(instance); - } - } - - public static class PathParametersMap10000Builder implements SetterForSchema1 { - private final Map instance; - public PathParametersMap10000Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap00000Builder getBuilderAfterSchema1(Map instance) { - return new PathParametersMap00000Builder(instance); - } - } - - public static class PathParametersMap10001Builder implements SetterForSchema1, SetterForSelf { - private final Map instance; - public PathParametersMap10001Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap00001Builder getBuilderAfterSchema1(Map instance) { - return new PathParametersMap00001Builder(instance); - } - public PathParametersMap10000Builder getBuilderAfterSelf(Map instance) { - return new PathParametersMap10000Builder(instance); - } - } - - public static class PathParametersMap10010Builder implements SetterForSchema1, SetterForAB { - private final Map instance; - public PathParametersMap10010Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap00010Builder getBuilderAfterSchema1(Map instance) { - return new PathParametersMap00010Builder(instance); - } - public PathParametersMap10000Builder getBuilderAfterAB(Map instance) { - return new PathParametersMap10000Builder(instance); - } - } - - public static class PathParametersMap10011Builder implements SetterForSchema1, SetterForAB, SetterForSelf { - private final Map instance; - public PathParametersMap10011Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap00011Builder getBuilderAfterSchema1(Map instance) { - return new PathParametersMap00011Builder(instance); - } - public PathParametersMap10001Builder getBuilderAfterAB(Map instance) { - return new PathParametersMap10001Builder(instance); - } - public PathParametersMap10010Builder getBuilderAfterSelf(Map instance) { - return new PathParametersMap10010Builder(instance); - } - } - - public static class PathParametersMap10100Builder implements SetterForSchema1, SetterForAb { - private final Map instance; - public PathParametersMap10100Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap00100Builder getBuilderAfterSchema1(Map instance) { - return new PathParametersMap00100Builder(instance); - } - public PathParametersMap10000Builder getBuilderAfterAb(Map instance) { - return new PathParametersMap10000Builder(instance); - } - } - - public static class PathParametersMap10101Builder implements SetterForSchema1, SetterForAb, SetterForSelf { - private final Map instance; - public PathParametersMap10101Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap00101Builder getBuilderAfterSchema1(Map instance) { - return new PathParametersMap00101Builder(instance); - } - public PathParametersMap10001Builder getBuilderAfterAb(Map instance) { - return new PathParametersMap10001Builder(instance); - } - public PathParametersMap10100Builder getBuilderAfterSelf(Map instance) { - return new PathParametersMap10100Builder(instance); - } - } - - public static class PathParametersMap10110Builder implements SetterForSchema1, SetterForAb, SetterForAB { - private final Map instance; - public PathParametersMap10110Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap00110Builder getBuilderAfterSchema1(Map instance) { - return new PathParametersMap00110Builder(instance); - } - public PathParametersMap10010Builder getBuilderAfterAb(Map instance) { - return new PathParametersMap10010Builder(instance); - } - public PathParametersMap10100Builder getBuilderAfterAB(Map instance) { - return new PathParametersMap10100Builder(instance); - } - } - - public static class PathParametersMap10111Builder implements SetterForSchema1, SetterForAb, SetterForAB, SetterForSelf { - private final Map instance; - public PathParametersMap10111Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap00111Builder getBuilderAfterSchema1(Map instance) { - return new PathParametersMap00111Builder(instance); - } - public PathParametersMap10011Builder getBuilderAfterAb(Map instance) { - return new PathParametersMap10011Builder(instance); - } - public PathParametersMap10101Builder getBuilderAfterAB(Map instance) { - return new PathParametersMap10101Builder(instance); - } - public PathParametersMap10110Builder getBuilderAfterSelf(Map instance) { - return new PathParametersMap10110Builder(instance); - } - } - - public static class PathParametersMap11000Builder implements SetterForSchema1, SetterForAB1 { - private final Map instance; - public PathParametersMap11000Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap01000Builder getBuilderAfterSchema1(Map instance) { - return new PathParametersMap01000Builder(instance); - } - public PathParametersMap10000Builder getBuilderAfterAB1(Map instance) { - return new PathParametersMap10000Builder(instance); - } - } - - public static class PathParametersMap11001Builder implements SetterForSchema1, SetterForAB1, SetterForSelf { - private final Map instance; - public PathParametersMap11001Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap01001Builder getBuilderAfterSchema1(Map instance) { - return new PathParametersMap01001Builder(instance); - } - public PathParametersMap10001Builder getBuilderAfterAB1(Map instance) { - return new PathParametersMap10001Builder(instance); - } - public PathParametersMap11000Builder getBuilderAfterSelf(Map instance) { - return new PathParametersMap11000Builder(instance); - } - } - - public static class PathParametersMap11010Builder implements SetterForSchema1, SetterForAB1, SetterForAB { - private final Map instance; - public PathParametersMap11010Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap01010Builder getBuilderAfterSchema1(Map instance) { - return new PathParametersMap01010Builder(instance); - } - public PathParametersMap10010Builder getBuilderAfterAB1(Map instance) { - return new PathParametersMap10010Builder(instance); - } - public PathParametersMap11000Builder getBuilderAfterAB(Map instance) { - return new PathParametersMap11000Builder(instance); - } - } - - public static class PathParametersMap11011Builder implements SetterForSchema1, SetterForAB1, SetterForAB, SetterForSelf { - private final Map instance; - public PathParametersMap11011Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap01011Builder getBuilderAfterSchema1(Map instance) { - return new PathParametersMap01011Builder(instance); - } - public PathParametersMap10011Builder getBuilderAfterAB1(Map instance) { - return new PathParametersMap10011Builder(instance); - } - public PathParametersMap11001Builder getBuilderAfterAB(Map instance) { - return new PathParametersMap11001Builder(instance); - } - public PathParametersMap11010Builder getBuilderAfterSelf(Map instance) { - return new PathParametersMap11010Builder(instance); - } - } - - public static class PathParametersMap11100Builder implements SetterForSchema1, SetterForAB1, SetterForAb { - private final Map instance; - public PathParametersMap11100Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap01100Builder getBuilderAfterSchema1(Map instance) { - return new PathParametersMap01100Builder(instance); - } - public PathParametersMap10100Builder getBuilderAfterAB1(Map instance) { - return new PathParametersMap10100Builder(instance); - } - public PathParametersMap11000Builder getBuilderAfterAb(Map instance) { - return new PathParametersMap11000Builder(instance); - } - } - - public static class PathParametersMap11101Builder implements SetterForSchema1, SetterForAB1, SetterForAb, SetterForSelf { - private final Map instance; - public PathParametersMap11101Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap01101Builder getBuilderAfterSchema1(Map instance) { - return new PathParametersMap01101Builder(instance); - } - public PathParametersMap10101Builder getBuilderAfterAB1(Map instance) { - return new PathParametersMap10101Builder(instance); - } - public PathParametersMap11001Builder getBuilderAfterAb(Map instance) { - return new PathParametersMap11001Builder(instance); - } - public PathParametersMap11100Builder getBuilderAfterSelf(Map instance) { - return new PathParametersMap11100Builder(instance); - } - } - - public static class PathParametersMap11110Builder implements SetterForSchema1, SetterForAB1, SetterForAb, SetterForAB { - private final Map instance; - public PathParametersMap11110Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public PathParametersMap01110Builder getBuilderAfterSchema1(Map instance) { - return new PathParametersMap01110Builder(instance); - } - public PathParametersMap10110Builder getBuilderAfterAB1(Map instance) { - return new PathParametersMap10110Builder(instance); - } - public PathParametersMap11010Builder getBuilderAfterAb(Map instance) { - return new PathParametersMap11010Builder(instance); - } - public PathParametersMap11100Builder getBuilderAfterAB(Map instance) { - return new PathParametersMap11100Builder(instance); - } - } - - public static class PathParametersMapBuilder implements SetterForSchema1, SetterForAB1, SetterForAb, SetterForAB, SetterForSelf { - private final Map instance; - public PathParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map getInstance() { - return instance; - } - public PathParametersMap01111Builder getBuilderAfterSchema1(Map instance) { - return new PathParametersMap01111Builder(instance); - } - public PathParametersMap10111Builder getBuilderAfterAB1(Map instance) { - return new PathParametersMap10111Builder(instance); - } - public PathParametersMap11011Builder getBuilderAfterAb(Map instance) { - return new PathParametersMap11011Builder(instance); - } - public PathParametersMap11101Builder getBuilderAfterAB(Map instance) { - return new PathParametersMap11101Builder(instance); - } - public PathParametersMap11110Builder getBuilderAfterSelf(Map instance) { - return new PathParametersMap11110Builder(instance); - } - } - - - public sealed interface PathParameters1Boxed permits PathParameters1BoxedMap { - @Nullable Object getData(); - } - - public record PathParameters1BoxedMap(PathParametersMap data) implements PathParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable PathParameters1 instance = null; - - protected PathParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("1", Schema9.Schema91.class), - new PropertyEntry("aB", Schema10.Schema101.class), - new PropertyEntry("Ab", Schema11.Schema111.class), - new PropertyEntry("A-B", Schema13.Schema131.class), - new PropertyEntry("self", Schema12.Schema121.class) - )) - .required(Set.of( - "1", - "A-B", - "Ab", - "aB", - "self" - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static PathParameters1 getInstance() { - if (instance == null) { - instance = new PathParameters1(); - } - return instance; - } - - public PathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, propertyInstance); - } - FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); - return new PathParametersMap(castProperties); - } - - public PathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new PathParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/QueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/QueryParameters.java deleted file mode 100644 index 99e5b99540f..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/QueryParameters.java +++ /dev/null @@ -1,286 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter0.Schema0; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter1.Schema1; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter2.Schema2; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter3.Schema3; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.parameters.parameter4.Schema4; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class QueryParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class QueryParametersMap extends FrozenMap<@Nullable Object> { - protected QueryParametersMap(FrozenMap<@Nullable Object> m) { - super(m); - } - public static final Set requiredKeys = Set.of(); - public static final Set optionalKeys = Set.of( - "1", - "aB", - "Ab", - "A-B", - "self" - ); - public static QueryParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return QueryParameters1.getInstance().validate(arg, configuration); - } - - public String aB() throws UnsetPropertyException { - String key = "aB"; - throwIfKeyNotPresent(key); - @Nullable Object value = get(key); - if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for aB"); - } - return (String) value; - } - - public String Ab() throws UnsetPropertyException { - String key = "Ab"; - throwIfKeyNotPresent(key); - @Nullable Object value = get(key); - if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for Ab"); - } - return (String) value; - } - - public String self() throws UnsetPropertyException { - String key = "self"; - throwIfKeyNotPresent(key); - @Nullable Object value = get(key); - if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for self"); - } - return (String) value; - } - } - - public interface SetterForSchema1 { - Map getInstance(); - T getBuilderAfterSchema1(Map instance); - - default T positive1(String value) { - var instance = getInstance(); - instance.put("1", value); - return getBuilderAfterSchema1(instance); - } - } - - public interface SetterForAB { - Map getInstance(); - T getBuilderAfterAB(Map instance); - - default T aB(String value) { - var instance = getInstance(); - instance.put("aB", value); - return getBuilderAfterAB(instance); - } - } - - public interface SetterForAb { - Map getInstance(); - T getBuilderAfterAb(Map instance); - - default T Ab(String value) { - var instance = getInstance(); - instance.put("Ab", value); - return getBuilderAfterAb(instance); - } - } - - public interface SetterForAB1 { - Map getInstance(); - T getBuilderAfterAB1(Map instance); - - default T aHyphenMinusB(String value) { - var instance = getInstance(); - instance.put("A-B", value); - return getBuilderAfterAB1(instance); - } - } - - public interface SetterForSelf { - Map getInstance(); - T getBuilderAfterSelf(Map instance); - - default T self(String value) { - var instance = getInstance(); - instance.put("self", value); - return getBuilderAfterSelf(instance); - } - } - - public static class QueryParametersMapBuilder implements GenericBuilder>, SetterForSchema1, SetterForAB, SetterForAb, SetterForAB1, SetterForSelf { - private final Map instance; - private static final Set knownKeys = Set.of( - "1", - "aB", - "Ab", - "A-B", - "self" - ); - public Set getKnownKeys() { - return knownKeys; - } - public QueryParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map build() { - return instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMapBuilder getBuilderAfterSchema1(Map instance) { - return this; - } - public QueryParametersMapBuilder getBuilderAfterAB(Map instance) { - return this; - } - public QueryParametersMapBuilder getBuilderAfterAb(Map instance) { - return this; - } - public QueryParametersMapBuilder getBuilderAfterAB1(Map instance) { - return this; - } - public QueryParametersMapBuilder getBuilderAfterSelf(Map instance) { - return this; - } - } - - - public sealed interface QueryParameters1Boxed permits QueryParameters1BoxedMap { - @Nullable Object getData(); - } - - public record QueryParameters1BoxedMap(QueryParametersMap data) implements QueryParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable QueryParameters1 instance = null; - - protected QueryParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("1", Schema0.Schema01.class), - new PropertyEntry("aB", Schema1.Schema11.class), - new PropertyEntry("Ab", Schema2.Schema21.class), - new PropertyEntry("A-B", Schema4.Schema41.class), - new PropertyEntry("self", Schema3.Schema31.class) - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static QueryParameters1 getInstance() { - if (instance == null) { - instance = new QueryParameters1(); - } - return instance; - } - - public QueryParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, propertyInstance); - } - FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); - return new QueryParametersMap(castProperties); - } - - public QueryParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public QueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new QueryParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public QueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/RequestBody.java deleted file mode 100644 index a51c3ec8a0d..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/RequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.requestbody.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ), - false - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } - } - - public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} - public record ApplicationjsonRequestBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "application/json"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/Responses.java deleted file mode 100644 index 63bb9a16183..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post; - -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/responses/Code200Response.java deleted file mode 100644 index 7cda67e481f..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/responses/Code200Response.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/responses/Fakeparametercollisions1ababselfabPostCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/responses/Fakeparametercollisions1ababselfabPostCode200Response.java new file mode 100644 index 00000000000..372e5b1d702 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeparametercollisions1ababselfab/post/responses/Fakeparametercollisions1ababselfabPostCode200Response.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakeparametercollisions1ababselfab.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class Fakeparametercollisions1ababselfabPostCode200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class Fakeparametercollisions1ababselfabPostCode200Response1 extends ResponseDeserializer { + public Fakeparametercollisions1ababselfabPostCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/FakepemcontenttypeGet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/FakepemcontenttypeGet.java new file mode 100644 index 00000000000..5c627fe0093 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/FakepemcontenttypeGet.java @@ -0,0 +1,152 @@ +package org.openapijsonschematools.client.paths.fakepemcontenttype; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.fakepemcontenttype.get.FakepemcontenttypeGetRequestBody; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakepemcontenttype.get.FakepemcontenttypeGetResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Fakepemcontenttype; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakepemcontenttypeGet { + private static class GetProvider { + private static final String method = "get"; + + public static FakepemcontenttypeGetResponses.EndpointResponse get( + GetRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + @Nullable SerializedRequestBody serializedRequestBody; + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + if (request.requestBody != null) { + serializedRequestBody = new FakepemcontenttypeGetRequestBody.FakepemcontenttypeGetRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + bodyPublisher = serializedRequestBody.bodyPublisher; + } + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakepemcontenttype.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakepemcontenttypeGetResponses.FakepemcontenttypeGetResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface GetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakepemcontenttypeGetResponses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface PemContentTypeOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakepemcontenttypeGetResponses.EndpointResponse pemContentType(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Get extends ApiClient implements GetOperation { + public Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class GetRequest { + public FakepemcontenttypeGetRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForRequestBody { + GetRequest getInstance(); + T getBuilderAfterRequestBody(GetRequest instance); + default T requestBody(FakepemcontenttypeGetRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public interface SetterForServerIndex { + GetRequest getInstance(); + T getBuilderAfterServerIndex(GetRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + GetRequest getInstance(); + T getBuilderAfterTimeout(GetRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class GetRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { + private final GetRequest instance; + + public GetRequestBuilder() { + this.instance = new GetRequest(); + } + + public GetRequest build() { + return instance; + } + + public GetRequest getInstance() { + return instance; + } + + public GetRequestBuilder getBuilderAfterRequestBody(GetRequest instance) { + return this; + } + + public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { + return this; + } + + public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/Get.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/Get.java deleted file mode 100644 index 76762c2106d..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/Get.java +++ /dev/null @@ -1,143 +0,0 @@ -package org.openapijsonschematools.client.paths.fakepemcontenttype; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.fakepemcontenttype.get.RequestBody; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakepemcontenttype.get.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Fakepemcontenttype; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Get { - private static class GetProvider { - private static final String method = "get"; - - public static Responses.EndpointResponse get( - GetRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - @Nullable SerializedRequestBody serializedRequestBody; - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - if (request.requestBody != null) { - serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - bodyPublisher = serializedRequestBody.bodyPublisher; - } - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakepemcontenttype.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface GetOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Get1 extends ApiClient implements GetOperation { - public Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class GetRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForRequestBody { - GetRequest getInstance(); - T getBuilderAfterRequestBody(GetRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public interface SetterForServerIndex { - GetRequest getInstance(); - T getBuilderAfterServerIndex(GetRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - GetRequest getInstance(); - T getBuilderAfterTimeout(GetRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class GetRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { - private final GetRequest instance; - - public GetRequestBuilder() { - this.instance = new GetRequest(); - } - - public GetRequest build() { - return instance; - } - - public GetRequest getInstance() { - return instance; - } - - public GetRequestBuilder getBuilderAfterRequestBody(GetRequest instance) { - return this; - } - - public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { - return this; - } - - public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/FakepemcontenttypeGetRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/FakepemcontenttypeGetRequestBody.java new file mode 100644 index 00000000000..d038f5837c5 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/FakepemcontenttypeGetRequestBody.java @@ -0,0 +1,53 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.fakepemcontenttype.get; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakepemcontenttype.get.requestbody.content.applicationxpemfile.ApplicationxpemfileSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class FakepemcontenttypeGetRequestBody { + public sealed interface SealedMediaType permits ApplicationxpemfileMediaType {} + + public record ApplicationxpemfileMediaType(ApplicationxpemfileSchema.ApplicationxpemfileSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationxpemfileMediaType() { + this(ApplicationxpemfileSchema.ApplicationxpemfileSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class FakepemcontenttypeGetRequestBody1 extends RequestBodySerializer { + public FakepemcontenttypeGetRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/x-pem-file", new ApplicationxpemfileMediaType()) + ), + false + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + ApplicationxpemfileRequestBody requestBody0 = (ApplicationxpemfileRequestBody) requestBody; + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } + } + + public sealed interface SealedRequestBody permits ApplicationxpemfileRequestBody {} + public record ApplicationxpemfileRequestBody(ApplicationxpemfileSchema.StringJsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "application/x-pem-file"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/FakepemcontenttypeGetResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/FakepemcontenttypeGetResponses.java new file mode 100644 index 00000000000..e5e32aacfe3 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/FakepemcontenttypeGetResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakepemcontenttype.get; + +import org.openapijsonschematools.client.paths.fakepemcontenttype.get.responses.FakepemcontenttypeGetCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakepemcontenttypeGetResponses { + public sealed interface EndpointResponse permits EndpointFakepemcontenttypeGetCode200Response {} + + public record EndpointFakepemcontenttypeGetCode200Response( + HttpResponse response, + FakepemcontenttypeGetCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakepemcontenttypeGetCode200ResponseDeserializer {} + + public static final class StatusFakepemcontenttypeGetCode200ResponseDeserializer extends FakepemcontenttypeGetCode200Response.FakepemcontenttypeGetCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakepemcontenttypeGetResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakepemcontenttypeGetResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakepemcontenttypeGetCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakepemcontenttypeGetCode200ResponseDeserializer castDeserializer = (StatusFakepemcontenttypeGetCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakepemcontenttypeGetCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/RequestBody.java deleted file mode 100644 index 1f480bb4f6c..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/RequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.fakepemcontenttype.get; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakepemcontenttype.get.requestbody.content.applicationxpemfile.ApplicationxpemfileSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits ApplicationxpemfileMediaType {} - - public record ApplicationxpemfileMediaType(ApplicationxpemfileSchema.ApplicationxpemfileSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationxpemfileMediaType() { - this(ApplicationxpemfileSchema.ApplicationxpemfileSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/x-pem-file", new ApplicationxpemfileMediaType()) - ), - false - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - ApplicationxpemfileRequestBody requestBody0 = (ApplicationxpemfileRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } - } - - public sealed interface SealedRequestBody permits ApplicationxpemfileRequestBody {} - public record ApplicationxpemfileRequestBody(ApplicationxpemfileSchema.StringJsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "application/x-pem-file"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/Responses.java deleted file mode 100644 index c0cddd94174..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakepemcontenttype.get; - -import org.openapijsonschematools.client.paths.fakepemcontenttype.get.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/responses/Code200Response.java deleted file mode 100644 index 499c915f8f3..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/responses/Code200Response.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakepemcontenttype.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakepemcontenttype.get.responses.code200response.content.applicationxpemfile.ApplicationxpemfileSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationxpemfileMediaType {} - - public record ApplicationxpemfileMediaType(ApplicationxpemfileSchema.ApplicationxpemfileSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationxpemfileMediaType() { - this(ApplicationxpemfileSchema.ApplicationxpemfileSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationxpemfileResponseBody {} - public record ApplicationxpemfileResponseBody(ApplicationxpemfileSchema.StringJsonSchema1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/x-pem-file", new ApplicationxpemfileMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationxpemfileMediaType thisMediaType = (ApplicationxpemfileMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationxpemfileResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/responses/FakepemcontenttypeGetCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/responses/FakepemcontenttypeGetCode200Response.java new file mode 100644 index 00000000000..b8af4640702 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepemcontenttype/get/responses/FakepemcontenttypeGetCode200Response.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakepemcontenttype.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakepemcontenttype.get.responses.code200response.content.applicationxpemfile.ApplicationxpemfileSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakepemcontenttypeGetCode200Response { + public sealed interface SealedMediaType permits ApplicationxpemfileMediaType {} + + public record ApplicationxpemfileMediaType(ApplicationxpemfileSchema.ApplicationxpemfileSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationxpemfileMediaType() { + this(ApplicationxpemfileSchema.ApplicationxpemfileSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationxpemfileResponseBody {} + public record ApplicationxpemfileResponseBody(ApplicationxpemfileSchema.StringJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class FakepemcontenttypeGetCode200Response1 extends ResponseDeserializer { + public FakepemcontenttypeGetCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/x-pem-file", new ApplicationxpemfileMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationxpemfileMediaType thisMediaType = (ApplicationxpemfileMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationxpemfileResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/FakepetiduploadimagewithrequiredfilePost.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/FakepetiduploadimagewithrequiredfilePost.java new file mode 100644 index 00000000000..647c538f1b2 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/FakepetiduploadimagewithrequiredfilePost.java @@ -0,0 +1,243 @@ +package org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.FakepetiduploadimagewithrequiredfilePostRequestBody; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.FakepetiduploadimagewithrequiredfilePostSecurityInfo; +import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.FakepetiduploadimagewithrequiredfilePostPathParameters; +import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.Parameters; +import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.FakepetiduploadimagewithrequiredfilePostResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Fakepetiduploadimagewithrequiredfile; +import org.openapijsonschematools.client.securityrequirementobjects.SecurityRequirementObject; +import org.openapijsonschematools.client.securityrequirementobjects.AuthApplier; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakepetiduploadimagewithrequiredfilePost { + private static class PostProvider extends AuthApplier { + private static final String method = "post"; + + public static FakepetiduploadimagewithrequiredfilePostResponses.EndpointResponse post( + PostRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + @Nullable SerializedRequestBody serializedRequestBody; + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + if (request.requestBody != null) { + serializedRequestBody = new FakepetiduploadimagewithrequiredfilePostRequestBody.FakepetiduploadimagewithrequiredfilePostRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + bodyPublisher = serializedRequestBody.bodyPublisher; + } + + var pathSerializer = new Parameters.PathParametersSerializer(); + String updatedPath = pathSerializer.serialize(request.pathParameters, Fakepetiduploadimagewithrequiredfile.path); + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + SecurityRequirementObject securityRequirementObject = apiConfiguration.getSecurityRequirementObject(request.securityIndex); + updateParamsForAuth( + securityRequirementObject, + headers, + updatedPath, + method, + bodyPublisher, + queryMap, + apiConfiguration + ); + + String url = host + updatedPath; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakepetiduploadimagewithrequiredfilePostResponses.FakepetiduploadimagewithrequiredfilePostResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PostOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakepetiduploadimagewithrequiredfilePostResponses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface UploadFileWithRequiredFileOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakepetiduploadimagewithrequiredfilePostResponses.EndpointResponse uploadFileWithRequiredFile(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Post extends ApiClient implements PostOperation { + public Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PostRequest { + public FakepetiduploadimagewithrequiredfilePostPathParameters.FakepetiduploadimagewithrequiredfilePostPathParametersMap pathParameters; + public FakepetiduploadimagewithrequiredfilePostRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public FakepetiduploadimagewithrequiredfilePostSecurityInfo.@Nullable SecurityIndex securityIndex; + public @Nullable Duration timeout; + + public PostRequest( + FakepetiduploadimagewithrequiredfilePostPathParameters.FakepetiduploadimagewithrequiredfilePostPathParametersMap pathParameters, + FakepetiduploadimagewithrequiredfilePostRequestBody.@Nullable SealedRequestBody requestBody, + RootServerInfo.@Nullable ServerIndex serverIndex, + FakepetiduploadimagewithrequiredfilePostSecurityInfo.@Nullable SecurityIndex securityIndex, + @Nullable Duration timeout + ) { + this.pathParameters = pathParameters; + this.requestBody = requestBody; + this.serverIndex = serverIndex; + this.securityIndex = securityIndex; + this.timeout = timeout; + } + } + + public static class PostNullableRequest { + public FakepetiduploadimagewithrequiredfilePostPathParameters.@Nullable FakepetiduploadimagewithrequiredfilePostPathParametersMap pathParameters; + public FakepetiduploadimagewithrequiredfilePostRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public FakepetiduploadimagewithrequiredfilePostSecurityInfo.@Nullable SecurityIndex securityIndex; + public @Nullable Duration timeout; + } + + public interface SetterForRequestBody { + PostNullableRequest getInstance(); + T getBuilderAfterRequestBody(PostNullableRequest instance); + default T requestBody(FakepetiduploadimagewithrequiredfilePostRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public interface SetterForServerIndex { + PostNullableRequest getInstance(); + T getBuilderAfterServerIndex(PostNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForSecurityIndex { + PostNullableRequest getInstance(); + T getBuilderAfterSecurityIndex(PostNullableRequest instance); + default T securityIndex(FakepetiduploadimagewithrequiredfilePostSecurityInfo.SecurityIndex securityIndex) { + var instance = getInstance(); + instance.securityIndex = securityIndex; + return getBuilderAfterSecurityIndex(instance); + } + } + + public interface SetterForTimeout { + PostNullableRequest getInstance(); + T getBuilderAfterTimeout(PostNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForPathParameters { + PostNullableRequest getInstance(); + T getBuilderAfterPathParameters(PostNullableRequest instance); + default T pathParameters(FakepetiduploadimagewithrequiredfilePostPathParameters.FakepetiduploadimagewithrequiredfilePostPathParametersMap pathParameters) { + var instance = getInstance(); + instance.pathParameters = pathParameters; + return getBuilderAfterPathParameters(instance); + } + } + + public static class Post0RequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForSecurityIndex, SetterForTimeout { + private final PostNullableRequest instance; + + public Post0RequestBuilder(PostNullableRequest instance) { + this.instance = instance; + } + + public PostRequest build() { + var pathParameters = instance.pathParameters; + if (pathParameters == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new PostRequest( + pathParameters, + instance.requestBody, + instance.serverIndex, + instance.securityIndex, + instance.timeout + ); + } + + public PostNullableRequest getInstance() { + return instance; + } + + public Post0RequestBuilder getBuilderAfterRequestBody(PostNullableRequest instance) { + return this; + } + + public Post0RequestBuilder getBuilderAfterServerIndex(PostNullableRequest instance) { + return this; + } + + public Post0RequestBuilder getBuilderAfterSecurityIndex(PostNullableRequest instance) { + return this; + } + + public Post0RequestBuilder getBuilderAfterTimeout(PostNullableRequest instance) { + return this; + } + } + public static class PostRequestBuilder implements SetterForPathParameters { + private final PostNullableRequest instance; + + public PostRequestBuilder() { + this.instance = new PostNullableRequest(); + } + + public PostNullableRequest getInstance() { + return instance; + } + + public Post0RequestBuilder getBuilderAfterPathParameters(PostNullableRequest instance) { + return new Post0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/Post.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/Post.java deleted file mode 100644 index bc14ed14094..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/Post.java +++ /dev/null @@ -1,234 +0,0 @@ -package org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.RequestBody; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.FakepetiduploadimagewithrequiredfilePostSecurityInfo; -import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.PathParameters; -import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.Parameters; -import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Fakepetiduploadimagewithrequiredfile; -import org.openapijsonschematools.client.securityrequirementobjects.SecurityRequirementObject; -import org.openapijsonschematools.client.securityrequirementobjects.AuthApplier; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Post { - private static class PostProvider extends AuthApplier { - private static final String method = "post"; - - public static Responses.EndpointResponse post( - PostRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - @Nullable SerializedRequestBody serializedRequestBody; - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - if (request.requestBody != null) { - serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - bodyPublisher = serializedRequestBody.bodyPublisher; - } - - var pathSerializer = new Parameters.PathParametersSerializer(); - String updatedPath = pathSerializer.serialize(request.pathParameters, Fakepetiduploadimagewithrequiredfile.path); - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - SecurityRequirementObject securityRequirementObject = apiConfiguration.getSecurityRequirementObject(request.securityIndex); - updateParamsForAuth( - securityRequirementObject, - headers, - updatedPath, - method, - bodyPublisher, - queryMap, - apiConfiguration - ); - - String url = host + updatedPath; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PostOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Post1 extends ApiClient implements PostOperation { - public Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PostRequest { - public PathParameters.PathParametersMap pathParameters; - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public FakepetiduploadimagewithrequiredfilePostSecurityInfo.@Nullable SecurityIndex securityIndex; - public @Nullable Duration timeout; - - public PostRequest( - PathParameters.PathParametersMap pathParameters, - RequestBody.@Nullable SealedRequestBody requestBody, - RootServerInfo.@Nullable ServerIndex serverIndex, - FakepetiduploadimagewithrequiredfilePostSecurityInfo.@Nullable SecurityIndex securityIndex, - @Nullable Duration timeout - ) { - this.pathParameters = pathParameters; - this.requestBody = requestBody; - this.serverIndex = serverIndex; - this.securityIndex = securityIndex; - this.timeout = timeout; - } - } - - public static class PostNullableRequest { - public PathParameters.@Nullable PathParametersMap pathParameters; - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public FakepetiduploadimagewithrequiredfilePostSecurityInfo.@Nullable SecurityIndex securityIndex; - public @Nullable Duration timeout; - } - - public interface SetterForRequestBody { - PostNullableRequest getInstance(); - T getBuilderAfterRequestBody(PostNullableRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public interface SetterForServerIndex { - PostNullableRequest getInstance(); - T getBuilderAfterServerIndex(PostNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForSecurityIndex { - PostNullableRequest getInstance(); - T getBuilderAfterSecurityIndex(PostNullableRequest instance); - default T securityIndex(FakepetiduploadimagewithrequiredfilePostSecurityInfo.SecurityIndex securityIndex) { - var instance = getInstance(); - instance.securityIndex = securityIndex; - return getBuilderAfterSecurityIndex(instance); - } - } - - public interface SetterForTimeout { - PostNullableRequest getInstance(); - T getBuilderAfterTimeout(PostNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForPathParameters { - PostNullableRequest getInstance(); - T getBuilderAfterPathParameters(PostNullableRequest instance); - default T pathParameters(PathParameters.PathParametersMap pathParameters) { - var instance = getInstance(); - instance.pathParameters = pathParameters; - return getBuilderAfterPathParameters(instance); - } - } - - public static class Post0RequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForSecurityIndex, SetterForTimeout { - private final PostNullableRequest instance; - - public Post0RequestBuilder(PostNullableRequest instance) { - this.instance = instance; - } - - public PostRequest build() { - var pathParameters = instance.pathParameters; - if (pathParameters == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new PostRequest( - pathParameters, - instance.requestBody, - instance.serverIndex, - instance.securityIndex, - instance.timeout - ); - } - - public PostNullableRequest getInstance() { - return instance; - } - - public Post0RequestBuilder getBuilderAfterRequestBody(PostNullableRequest instance) { - return this; - } - - public Post0RequestBuilder getBuilderAfterServerIndex(PostNullableRequest instance) { - return this; - } - - public Post0RequestBuilder getBuilderAfterSecurityIndex(PostNullableRequest instance) { - return this; - } - - public Post0RequestBuilder getBuilderAfterTimeout(PostNullableRequest instance) { - return this; - } - } - public static class PostRequestBuilder implements SetterForPathParameters { - private final PostNullableRequest instance; - - public PostRequestBuilder() { - this.instance = new PostNullableRequest(); - } - - public PostNullableRequest getInstance() { - return instance; - } - - public Post0RequestBuilder getBuilderAfterPathParameters(PostNullableRequest instance) { - return new Post0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostPathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostPathParameters.java new file mode 100644 index 00000000000..f34f4be8277 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostPathParameters.java @@ -0,0 +1,223 @@ +package org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.parameters.parameter0.Schema0; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class FakepetiduploadimagewithrequiredfilePostPathParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class FakepetiduploadimagewithrequiredfilePostadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable FakepetiduploadimagewithrequiredfilePostadditionalProperties instance = null; + public static FakepetiduploadimagewithrequiredfilePostadditionalProperties getInstance() { + if (instance == null) { + instance = new FakepetiduploadimagewithrequiredfilePostadditionalProperties(); + } + return instance; + } + } + + + public static class FakepetiduploadimagewithrequiredfilePostPathParametersMap extends FrozenMap { + protected FakepetiduploadimagewithrequiredfilePostPathParametersMap(FrozenMap m) { + super(m); + } + public static final Set requiredKeys = Set.of( + "petId" + ); + public static final Set optionalKeys = Set.of(); + public static FakepetiduploadimagewithrequiredfilePostPathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return FakepetiduploadimagewithrequiredfilePostPathParameters1.getInstance().validate(arg, configuration); + } + + public Number petId() { + try { + return getOrThrow("version"); + } catch (UnsetPropertyException e) { + throw new RuntimeException(e); + } + } + } + + public interface SetterForFakepetiduploadimagewithrequiredfilePostpetId { + Map getInstance(); + T getBuilderAfterFakepetiduploadimagewithrequiredfilePostpetId(Map instance); + + default T petId(int value) { + var instance = getInstance(); + instance.put("petId", value); + return getBuilderAfterFakepetiduploadimagewithrequiredfilePostpetId(instance); + } + + default T petId(float value) { + var instance = getInstance(); + instance.put("petId", value); + return getBuilderAfterFakepetiduploadimagewithrequiredfilePostpetId(instance); + } + + default T petId(long value) { + var instance = getInstance(); + instance.put("petId", value); + return getBuilderAfterFakepetiduploadimagewithrequiredfilePostpetId(instance); + } + + default T petId(double value) { + var instance = getInstance(); + instance.put("petId", value); + return getBuilderAfterFakepetiduploadimagewithrequiredfilePostpetId(instance); + } + } + + public static class FakepetiduploadimagewithrequiredfilePostPathParametersMap0Builder implements GenericBuilder> { + private final Map instance; + private static final Set knownKeys = Set.of( + "petId" + ); + public Set getKnownKeys() { + return knownKeys; + } + public FakepetiduploadimagewithrequiredfilePostPathParametersMap0Builder(Map instance) { + this.instance = instance; + } + public Map build() { + return instance; + } + } + + public static class FakepetiduploadimagewithrequiredfilePostPathParametersMapBuilder implements SetterForFakepetiduploadimagewithrequiredfilePostpetId { + private final Map instance; + public FakepetiduploadimagewithrequiredfilePostPathParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map getInstance() { + return instance; + } + public FakepetiduploadimagewithrequiredfilePostPathParametersMap0Builder getBuilderAfterFakepetiduploadimagewithrequiredfilePostpetId(Map instance) { + return new FakepetiduploadimagewithrequiredfilePostPathParametersMap0Builder(instance); + } + } + + + public sealed interface FakepetiduploadimagewithrequiredfilePostPathParameters1Boxed permits FakepetiduploadimagewithrequiredfilePostPathParameters1BoxedMap { + @Nullable Object getData(); + } + + public record FakepetiduploadimagewithrequiredfilePostPathParameters1BoxedMap(FakepetiduploadimagewithrequiredfilePostPathParametersMap data) implements FakepetiduploadimagewithrequiredfilePostPathParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class FakepetiduploadimagewithrequiredfilePostPathParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable FakepetiduploadimagewithrequiredfilePostPathParameters1 instance = null; + + protected FakepetiduploadimagewithrequiredfilePostPathParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("petId", Schema0.Schema01.class) + )) + .required(Set.of( + "petId" + )) + .additionalProperties(FakepetiduploadimagewithrequiredfilePostadditionalProperties.class) + ); + } + + public static FakepetiduploadimagewithrequiredfilePostPathParameters1 getInstance() { + if (instance == null) { + instance = new FakepetiduploadimagewithrequiredfilePostPathParameters1(); + } + return instance; + } + + public FakepetiduploadimagewithrequiredfilePostPathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Number)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (Number) propertyInstance); + } + FrozenMap castProperties = new FrozenMap<>(properties); + return new FakepetiduploadimagewithrequiredfilePostPathParametersMap(castProperties); + } + + public FakepetiduploadimagewithrequiredfilePostPathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public FakepetiduploadimagewithrequiredfilePostPathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new FakepetiduploadimagewithrequiredfilePostPathParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public FakepetiduploadimagewithrequiredfilePostPathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostRequestBody.java new file mode 100644 index 00000000000..347b2154b24 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostRequestBody.java @@ -0,0 +1,53 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.requestbody.content.multipartformdata.MultipartformdataSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class FakepetiduploadimagewithrequiredfilePostRequestBody { + public sealed interface SealedMediaType permits MultipartformdataMediaType {} + + public record MultipartformdataMediaType(MultipartformdataSchema.MultipartformdataSchema1 schema) implements SealedMediaType, MediaType { + public MultipartformdataMediaType() { + this(MultipartformdataSchema.MultipartformdataSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class FakepetiduploadimagewithrequiredfilePostRequestBody1 extends RequestBodySerializer { + public FakepetiduploadimagewithrequiredfilePostRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("multipart/form-data", new MultipartformdataMediaType()) + ), + false + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + MultipartformdataRequestBody requestBody0 = (MultipartformdataRequestBody) requestBody; + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } + } + + public sealed interface SealedRequestBody permits MultipartformdataRequestBody {} + public record MultipartformdataRequestBody(MultipartformdataSchema.MultipartformdataSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "multipart/form-data"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostResponses.java new file mode 100644 index 00000000000..94855836183 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/FakepetiduploadimagewithrequiredfilePostResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post; + +import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.responses.FakepetiduploadimagewithrequiredfilePostCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakepetiduploadimagewithrequiredfilePostResponses { + public sealed interface EndpointResponse permits EndpointFakepetiduploadimagewithrequiredfilePostCode200Response {} + + public record EndpointFakepetiduploadimagewithrequiredfilePostCode200Response( + HttpResponse response, + FakepetiduploadimagewithrequiredfilePostCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakepetiduploadimagewithrequiredfilePostCode200ResponseDeserializer {} + + public static final class StatusFakepetiduploadimagewithrequiredfilePostCode200ResponseDeserializer extends FakepetiduploadimagewithrequiredfilePostCode200Response.FakepetiduploadimagewithrequiredfilePostCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakepetiduploadimagewithrequiredfilePostResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakepetiduploadimagewithrequiredfilePostResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakepetiduploadimagewithrequiredfilePostCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakepetiduploadimagewithrequiredfilePostCode200ResponseDeserializer castDeserializer = (StatusFakepetiduploadimagewithrequiredfilePostCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakepetiduploadimagewithrequiredfilePostCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/PathParameters.java deleted file mode 100644 index 2ea4c671fcc..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/PathParameters.java +++ /dev/null @@ -1,223 +0,0 @@ -package org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.parameters.parameter0.Schema0; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class PathParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class PathParametersMap extends FrozenMap { - protected PathParametersMap(FrozenMap m) { - super(m); - } - public static final Set requiredKeys = Set.of( - "petId" - ); - public static final Set optionalKeys = Set.of(); - public static PathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return PathParameters1.getInstance().validate(arg, configuration); - } - - public Number petId() { - try { - return getOrThrow("version"); - } catch (UnsetPropertyException e) { - throw new RuntimeException(e); - } - } - } - - public interface SetterForPetId { - Map getInstance(); - T getBuilderAfterPetId(Map instance); - - default T petId(int value) { - var instance = getInstance(); - instance.put("petId", value); - return getBuilderAfterPetId(instance); - } - - default T petId(float value) { - var instance = getInstance(); - instance.put("petId", value); - return getBuilderAfterPetId(instance); - } - - default T petId(long value) { - var instance = getInstance(); - instance.put("petId", value); - return getBuilderAfterPetId(instance); - } - - default T petId(double value) { - var instance = getInstance(); - instance.put("petId", value); - return getBuilderAfterPetId(instance); - } - } - - public static class PathParametersMap0Builder implements GenericBuilder> { - private final Map instance; - private static final Set knownKeys = Set.of( - "petId" - ); - public Set getKnownKeys() { - return knownKeys; - } - public PathParametersMap0Builder(Map instance) { - this.instance = instance; - } - public Map build() { - return instance; - } - } - - public static class PathParametersMapBuilder implements SetterForPetId { - private final Map instance; - public PathParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map getInstance() { - return instance; - } - public PathParametersMap0Builder getBuilderAfterPetId(Map instance) { - return new PathParametersMap0Builder(instance); - } - } - - - public sealed interface PathParameters1Boxed permits PathParameters1BoxedMap { - @Nullable Object getData(); - } - - public record PathParameters1BoxedMap(PathParametersMap data) implements PathParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable PathParameters1 instance = null; - - protected PathParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("petId", Schema0.Schema01.class) - )) - .required(Set.of( - "petId" - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static PathParameters1 getInstance() { - if (instance == null) { - instance = new PathParameters1(); - } - return instance; - } - - public PathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - if (!(propertyInstance instanceof Number)) { - throw new RuntimeException("Invalid instantiated value"); - } - properties.put(propertyName, (Number) propertyInstance); - } - FrozenMap castProperties = new FrozenMap<>(properties); - return new PathParametersMap(castProperties); - } - - public PathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new PathParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/RequestBody.java deleted file mode 100644 index 0788c7362cb..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/RequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.requestbody.content.multipartformdata.MultipartformdataSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits MultipartformdataMediaType {} - - public record MultipartformdataMediaType(MultipartformdataSchema.MultipartformdataSchema1 schema) implements SealedMediaType, MediaType { - public MultipartformdataMediaType() { - this(MultipartformdataSchema.MultipartformdataSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("multipart/form-data", new MultipartformdataMediaType()) - ), - false - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - MultipartformdataRequestBody requestBody0 = (MultipartformdataRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } - } - - public sealed interface SealedRequestBody permits MultipartformdataRequestBody {} - public record MultipartformdataRequestBody(MultipartformdataSchema.MultipartformdataSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "multipart/form-data"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/Responses.java deleted file mode 100644 index ae1b734dfce..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post; - -import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/responses/Code200Response.java deleted file mode 100644 index e12ad3e1ff1..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/responses/Code200Response.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.ApiResponseSchema1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/responses/FakepetiduploadimagewithrequiredfilePostCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/responses/FakepetiduploadimagewithrequiredfilePostCode200Response.java new file mode 100644 index 00000000000..6cd3b657919 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakepetiduploadimagewithrequiredfile/post/responses/FakepetiduploadimagewithrequiredfilePostCode200Response.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakepetiduploadimagewithrequiredfile.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakepetiduploadimagewithrequiredfilePostCode200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.ApiResponseSchema1Boxed body) implements SealedResponseBody { } + + public static class FakepetiduploadimagewithrequiredfilePostCode200Response1 extends ResponseDeserializer { + public FakepetiduploadimagewithrequiredfilePostCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/FakequeryparamwithjsoncontenttypeGet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/FakequeryparamwithjsoncontenttypeGet.java new file mode 100644 index 00000000000..8f85d6a9c9e --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/FakequeryparamwithjsoncontenttypeGet.java @@ -0,0 +1,180 @@ +package org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.FakequeryparamwithjsoncontenttypeGetQueryParameters; +import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.Parameters; +import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.FakequeryparamwithjsoncontenttypeGetResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.paths.Fakequeryparamwithjsoncontenttype; + +import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakequeryparamwithjsoncontenttypeGet { + private static class GetProvider { + private static final String method = "get"; + + public static FakequeryparamwithjsoncontenttypeGetResponses.EndpointResponse get( + GetRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + + var querySerializer = new Parameters.QueryParametersSerializer(); + @Nullable Map queryMap = querySerializer.getQueryMap(request.queryParameters); + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakequeryparamwithjsoncontenttype.path; + if (queryMap != null) { + url = url + querySerializer.serialize(queryMap); + } + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakequeryparamwithjsoncontenttypeGetResponses.FakequeryparamwithjsoncontenttypeGetResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface GetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakequeryparamwithjsoncontenttypeGetResponses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface QueryParamWithJsonContentTypeOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakequeryparamwithjsoncontenttypeGetResponses.EndpointResponse queryParamWithJsonContentType(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Get extends ApiClient implements GetOperation { + public Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class GetRequest { + public FakequeryparamwithjsoncontenttypeGetQueryParameters.FakequeryparamwithjsoncontenttypeGetQueryParametersMap queryParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + + public GetRequest( + FakequeryparamwithjsoncontenttypeGetQueryParameters.FakequeryparamwithjsoncontenttypeGetQueryParametersMap queryParameters, + RootServerInfo.@Nullable ServerIndex serverIndex, + @Nullable Duration timeout + ) { + this.queryParameters = queryParameters; + this.serverIndex = serverIndex; + this.timeout = timeout; + } + } + + public static class GetNullableRequest { + public FakequeryparamwithjsoncontenttypeGetQueryParameters.@Nullable FakequeryparamwithjsoncontenttypeGetQueryParametersMap queryParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + GetNullableRequest getInstance(); + T getBuilderAfterServerIndex(GetNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + GetNullableRequest getInstance(); + T getBuilderAfterTimeout(GetNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForQueryParameters { + GetNullableRequest getInstance(); + T getBuilderAfterQueryParameters(GetNullableRequest instance); + default T queryParameters(FakequeryparamwithjsoncontenttypeGetQueryParameters.FakequeryparamwithjsoncontenttypeGetQueryParametersMap queryParameters) { + var instance = getInstance(); + instance.queryParameters = queryParameters; + return getBuilderAfterQueryParameters(instance); + } + } + + public static class Get0RequestBuilder implements SetterForServerIndex, SetterForTimeout { + private final GetNullableRequest instance; + + public Get0RequestBuilder(GetNullableRequest instance) { + this.instance = instance; + } + + public GetRequest build() { + var queryParameters = instance.queryParameters; + if (queryParameters == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new GetRequest( + queryParameters, + instance.serverIndex, + instance.timeout + ); + } + + public GetNullableRequest getInstance() { + return instance; + } + + public Get0RequestBuilder getBuilderAfterServerIndex(GetNullableRequest instance) { + return this; + } + + public Get0RequestBuilder getBuilderAfterTimeout(GetNullableRequest instance) { + return this; + } + } + public static class GetRequestBuilder implements SetterForQueryParameters { + private final GetNullableRequest instance; + + public GetRequestBuilder() { + this.instance = new GetNullableRequest(); + } + + public GetNullableRequest getInstance() { + return instance; + } + + public Get0RequestBuilder getBuilderAfterQueryParameters(GetNullableRequest instance) { + return new Get0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/Get.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/Get.java deleted file mode 100644 index 1d2525666c8..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/Get.java +++ /dev/null @@ -1,171 +0,0 @@ -package org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.QueryParameters; -import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.Parameters; -import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.paths.Fakequeryparamwithjsoncontenttype; - -import java.io.IOException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Get { - private static class GetProvider { - private static final String method = "get"; - - public static Responses.EndpointResponse get( - GetRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - - var querySerializer = new Parameters.QueryParametersSerializer(); - @Nullable Map queryMap = querySerializer.getQueryMap(request.queryParameters); - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakequeryparamwithjsoncontenttype.path; - if (queryMap != null) { - url = url + querySerializer.serialize(queryMap); - } - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface GetOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Get1 extends ApiClient implements GetOperation { - public Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class GetRequest { - public QueryParameters.QueryParametersMap queryParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - - public GetRequest( - QueryParameters.QueryParametersMap queryParameters, - RootServerInfo.@Nullable ServerIndex serverIndex, - @Nullable Duration timeout - ) { - this.queryParameters = queryParameters; - this.serverIndex = serverIndex; - this.timeout = timeout; - } - } - - public static class GetNullableRequest { - public QueryParameters.@Nullable QueryParametersMap queryParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - GetNullableRequest getInstance(); - T getBuilderAfterServerIndex(GetNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - GetNullableRequest getInstance(); - T getBuilderAfterTimeout(GetNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForQueryParameters { - GetNullableRequest getInstance(); - T getBuilderAfterQueryParameters(GetNullableRequest instance); - default T queryParameters(QueryParameters.QueryParametersMap queryParameters) { - var instance = getInstance(); - instance.queryParameters = queryParameters; - return getBuilderAfterQueryParameters(instance); - } - } - - public static class Get0RequestBuilder implements SetterForServerIndex, SetterForTimeout { - private final GetNullableRequest instance; - - public Get0RequestBuilder(GetNullableRequest instance) { - this.instance = instance; - } - - public GetRequest build() { - var queryParameters = instance.queryParameters; - if (queryParameters == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new GetRequest( - queryParameters, - instance.serverIndex, - instance.timeout - ); - } - - public GetNullableRequest getInstance() { - return instance; - } - - public Get0RequestBuilder getBuilderAfterServerIndex(GetNullableRequest instance) { - return this; - } - - public Get0RequestBuilder getBuilderAfterTimeout(GetNullableRequest instance) { - return this; - } - } - public static class GetRequestBuilder implements SetterForQueryParameters { - private final GetNullableRequest instance; - - public GetRequestBuilder() { - this.instance = new GetNullableRequest(); - } - - public GetNullableRequest getInstance() { - return instance; - } - - public Get0RequestBuilder getBuilderAfterQueryParameters(GetNullableRequest instance) { - return new Get0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/FakequeryparamwithjsoncontenttypeGetQueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/FakequeryparamwithjsoncontenttypeGetQueryParameters.java new file mode 100644 index 00000000000..9594438f817 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/FakequeryparamwithjsoncontenttypeGetQueryParameters.java @@ -0,0 +1,253 @@ +package org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.parameters.parameter0.content.applicationjson.Schema0; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class FakequeryparamwithjsoncontenttypeGetQueryParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class FakequeryparamwithjsoncontenttypeGetadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable FakequeryparamwithjsoncontenttypeGetadditionalProperties instance = null; + public static FakequeryparamwithjsoncontenttypeGetadditionalProperties getInstance() { + if (instance == null) { + instance = new FakequeryparamwithjsoncontenttypeGetadditionalProperties(); + } + return instance; + } + } + + + public static class FakequeryparamwithjsoncontenttypeGetQueryParametersMap extends FrozenMap<@Nullable Object> { + protected FakequeryparamwithjsoncontenttypeGetQueryParametersMap(FrozenMap<@Nullable Object> m) { + super(m); + } + public static final Set requiredKeys = Set.of( + "someParam" + ); + public static final Set optionalKeys = Set.of(); + public static FakequeryparamwithjsoncontenttypeGetQueryParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return FakequeryparamwithjsoncontenttypeGetQueryParameters1.getInstance().validate(arg, configuration); + } + + public @Nullable Object someParam() { + try { + return getOrThrow("version"); + } catch (UnsetPropertyException e) { + throw new RuntimeException(e); + } + } + } + + public interface SetterForFakequeryparamwithjsoncontenttypeGetsomeParam { + Map getInstance(); + T getBuilderAfterFakequeryparamwithjsoncontenttypeGetsomeParam(Map instance); + + default T someParam(Void value) { + var instance = getInstance(); + instance.put("someParam", null); + return getBuilderAfterFakequeryparamwithjsoncontenttypeGetsomeParam(instance); + } + + default T someParam(boolean value) { + var instance = getInstance(); + instance.put("someParam", value); + return getBuilderAfterFakequeryparamwithjsoncontenttypeGetsomeParam(instance); + } + + default T someParam(String value) { + var instance = getInstance(); + instance.put("someParam", value); + return getBuilderAfterFakequeryparamwithjsoncontenttypeGetsomeParam(instance); + } + + default T someParam(int value) { + var instance = getInstance(); + instance.put("someParam", value); + return getBuilderAfterFakequeryparamwithjsoncontenttypeGetsomeParam(instance); + } + + default T someParam(float value) { + var instance = getInstance(); + instance.put("someParam", value); + return getBuilderAfterFakequeryparamwithjsoncontenttypeGetsomeParam(instance); + } + + default T someParam(long value) { + var instance = getInstance(); + instance.put("someParam", value); + return getBuilderAfterFakequeryparamwithjsoncontenttypeGetsomeParam(instance); + } + + default T someParam(double value) { + var instance = getInstance(); + instance.put("someParam", value); + return getBuilderAfterFakequeryparamwithjsoncontenttypeGetsomeParam(instance); + } + + default T someParam(List value) { + var instance = getInstance(); + instance.put("someParam", value); + return getBuilderAfterFakequeryparamwithjsoncontenttypeGetsomeParam(instance); + } + + default T someParam(Map value) { + var instance = getInstance(); + instance.put("someParam", value); + return getBuilderAfterFakequeryparamwithjsoncontenttypeGetsomeParam(instance); + } + } + + public static class FakequeryparamwithjsoncontenttypeGetQueryParametersMap0Builder implements GenericBuilder> { + private final Map instance; + private static final Set knownKeys = Set.of( + "someParam" + ); + public Set getKnownKeys() { + return knownKeys; + } + public FakequeryparamwithjsoncontenttypeGetQueryParametersMap0Builder(Map instance) { + this.instance = instance; + } + public Map build() { + return instance; + } + } + + public static class FakequeryparamwithjsoncontenttypeGetQueryParametersMapBuilder implements SetterForFakequeryparamwithjsoncontenttypeGetsomeParam { + private final Map instance; + public FakequeryparamwithjsoncontenttypeGetQueryParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map getInstance() { + return instance; + } + public FakequeryparamwithjsoncontenttypeGetQueryParametersMap0Builder getBuilderAfterFakequeryparamwithjsoncontenttypeGetsomeParam(Map instance) { + return new FakequeryparamwithjsoncontenttypeGetQueryParametersMap0Builder(instance); + } + } + + + public sealed interface FakequeryparamwithjsoncontenttypeGetQueryParameters1Boxed permits FakequeryparamwithjsoncontenttypeGetQueryParameters1BoxedMap { + @Nullable Object getData(); + } + + public record FakequeryparamwithjsoncontenttypeGetQueryParameters1BoxedMap(FakequeryparamwithjsoncontenttypeGetQueryParametersMap data) implements FakequeryparamwithjsoncontenttypeGetQueryParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class FakequeryparamwithjsoncontenttypeGetQueryParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable FakequeryparamwithjsoncontenttypeGetQueryParameters1 instance = null; + + protected FakequeryparamwithjsoncontenttypeGetQueryParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("someParam", Schema0.Schema01.class) + )) + .required(Set.of( + "someParam" + )) + .additionalProperties(FakequeryparamwithjsoncontenttypeGetadditionalProperties.class) + ); + } + + public static FakequeryparamwithjsoncontenttypeGetQueryParameters1 getInstance() { + if (instance == null) { + instance = new FakequeryparamwithjsoncontenttypeGetQueryParameters1(); + } + return instance; + } + + public FakequeryparamwithjsoncontenttypeGetQueryParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Object)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (@Nullable Object) propertyInstance); + } + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); + return new FakequeryparamwithjsoncontenttypeGetQueryParametersMap(castProperties); + } + + public FakequeryparamwithjsoncontenttypeGetQueryParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public FakequeryparamwithjsoncontenttypeGetQueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new FakequeryparamwithjsoncontenttypeGetQueryParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public FakequeryparamwithjsoncontenttypeGetQueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/FakequeryparamwithjsoncontenttypeGetResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/FakequeryparamwithjsoncontenttypeGetResponses.java new file mode 100644 index 00000000000..ad96c808b19 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/FakequeryparamwithjsoncontenttypeGetResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get; + +import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.responses.FakequeryparamwithjsoncontenttypeGetCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakequeryparamwithjsoncontenttypeGetResponses { + public sealed interface EndpointResponse permits EndpointFakequeryparamwithjsoncontenttypeGetCode200Response {} + + public record EndpointFakequeryparamwithjsoncontenttypeGetCode200Response( + HttpResponse response, + FakequeryparamwithjsoncontenttypeGetCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakequeryparamwithjsoncontenttypeGetCode200ResponseDeserializer {} + + public static final class StatusFakequeryparamwithjsoncontenttypeGetCode200ResponseDeserializer extends FakequeryparamwithjsoncontenttypeGetCode200Response.FakequeryparamwithjsoncontenttypeGetCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakequeryparamwithjsoncontenttypeGetResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakequeryparamwithjsoncontenttypeGetResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakequeryparamwithjsoncontenttypeGetCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakequeryparamwithjsoncontenttypeGetCode200ResponseDeserializer castDeserializer = (StatusFakequeryparamwithjsoncontenttypeGetCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakequeryparamwithjsoncontenttypeGetCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/QueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/QueryParameters.java deleted file mode 100644 index ae8606df9a8..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/QueryParameters.java +++ /dev/null @@ -1,253 +0,0 @@ -package org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.parameters.parameter0.content.applicationjson.Schema0; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class QueryParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class QueryParametersMap extends FrozenMap<@Nullable Object> { - protected QueryParametersMap(FrozenMap<@Nullable Object> m) { - super(m); - } - public static final Set requiredKeys = Set.of( - "someParam" - ); - public static final Set optionalKeys = Set.of(); - public static QueryParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return QueryParameters1.getInstance().validate(arg, configuration); - } - - public @Nullable Object someParam() { - try { - return getOrThrow("version"); - } catch (UnsetPropertyException e) { - throw new RuntimeException(e); - } - } - } - - public interface SetterForSomeParam { - Map getInstance(); - T getBuilderAfterSomeParam(Map instance); - - default T someParam(Void value) { - var instance = getInstance(); - instance.put("someParam", null); - return getBuilderAfterSomeParam(instance); - } - - default T someParam(boolean value) { - var instance = getInstance(); - instance.put("someParam", value); - return getBuilderAfterSomeParam(instance); - } - - default T someParam(String value) { - var instance = getInstance(); - instance.put("someParam", value); - return getBuilderAfterSomeParam(instance); - } - - default T someParam(int value) { - var instance = getInstance(); - instance.put("someParam", value); - return getBuilderAfterSomeParam(instance); - } - - default T someParam(float value) { - var instance = getInstance(); - instance.put("someParam", value); - return getBuilderAfterSomeParam(instance); - } - - default T someParam(long value) { - var instance = getInstance(); - instance.put("someParam", value); - return getBuilderAfterSomeParam(instance); - } - - default T someParam(double value) { - var instance = getInstance(); - instance.put("someParam", value); - return getBuilderAfterSomeParam(instance); - } - - default T someParam(List value) { - var instance = getInstance(); - instance.put("someParam", value); - return getBuilderAfterSomeParam(instance); - } - - default T someParam(Map value) { - var instance = getInstance(); - instance.put("someParam", value); - return getBuilderAfterSomeParam(instance); - } - } - - public static class QueryParametersMap0Builder implements GenericBuilder> { - private final Map instance; - private static final Set knownKeys = Set.of( - "someParam" - ); - public Set getKnownKeys() { - return knownKeys; - } - public QueryParametersMap0Builder(Map instance) { - this.instance = instance; - } - public Map build() { - return instance; - } - } - - public static class QueryParametersMapBuilder implements SetterForSomeParam { - private final Map instance; - public QueryParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map getInstance() { - return instance; - } - public QueryParametersMap0Builder getBuilderAfterSomeParam(Map instance) { - return new QueryParametersMap0Builder(instance); - } - } - - - public sealed interface QueryParameters1Boxed permits QueryParameters1BoxedMap { - @Nullable Object getData(); - } - - public record QueryParameters1BoxedMap(QueryParametersMap data) implements QueryParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable QueryParameters1 instance = null; - - protected QueryParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("someParam", Schema0.Schema01.class) - )) - .required(Set.of( - "someParam" - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static QueryParameters1 getInstance() { - if (instance == null) { - instance = new QueryParameters1(); - } - return instance; - } - - public QueryParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - if (!(propertyInstance instanceof Object)) { - throw new RuntimeException("Invalid instantiated value"); - } - properties.put(propertyName, (@Nullable Object) propertyInstance); - } - FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); - return new QueryParametersMap(castProperties); - } - - public QueryParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public QueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new QueryParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public QueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/Responses.java deleted file mode 100644 index 67fcc96df1a..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get; - -import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/responses/Code200Response.java deleted file mode 100644 index 1c25969ab61..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/responses/Code200Response.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/responses/FakequeryparamwithjsoncontenttypeGetCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/responses/FakequeryparamwithjsoncontenttypeGetCode200Response.java new file mode 100644 index 00000000000..c7368eb4fc1 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakequeryparamwithjsoncontenttype/get/responses/FakequeryparamwithjsoncontenttypeGetCode200Response.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakequeryparamwithjsoncontenttype.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakequeryparamwithjsoncontenttypeGetCode200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class FakequeryparamwithjsoncontenttypeGetCode200Response1 extends ResponseDeserializer { + public FakequeryparamwithjsoncontenttypeGetCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/FakeredirectionGet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/FakeredirectionGet.java new file mode 100644 index 00000000000..f73a54d32b6 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/FakeredirectionGet.java @@ -0,0 +1,124 @@ +package org.openapijsonschematools.client.paths.fakeredirection; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeredirection.get.FakeredirectionGetResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.paths.Fakeredirection; + +import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakeredirectionGet { + private static class GetProvider { + private static final String method = "get"; + + public static FakeredirectionGetResponses.EndpointResponse get( + GetRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakeredirection.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakeredirectionGetResponses.FakeredirectionGetResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface GetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakeredirectionGetResponses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface RedirectionOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakeredirectionGetResponses.EndpointResponse redirection(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Get extends ApiClient implements GetOperation { + public Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class GetRequest { + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + GetRequest getInstance(); + T getBuilderAfterServerIndex(GetRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + GetRequest getInstance(); + T getBuilderAfterTimeout(GetRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class GetRequestBuilder implements SetterForServerIndex, SetterForTimeout { + private final GetRequest instance; + + public GetRequestBuilder() { + this.instance = new GetRequest(); + } + + public GetRequest build() { + return instance; + } + + public GetRequest getInstance() { + return instance; + } + + public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { + return this; + } + + public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/Get.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/Get.java deleted file mode 100644 index 79bfed8fe0c..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/Get.java +++ /dev/null @@ -1,115 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeredirection; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakeredirection.get.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.paths.Fakeredirection; - -import java.io.IOException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Get { - private static class GetProvider { - private static final String method = "get"; - - public static Responses.EndpointResponse get( - GetRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakeredirection.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface GetOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Get1 extends ApiClient implements GetOperation { - public Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class GetRequest { - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - GetRequest getInstance(); - T getBuilderAfterServerIndex(GetRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - GetRequest getInstance(); - T getBuilderAfterTimeout(GetRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class GetRequestBuilder implements SetterForServerIndex, SetterForTimeout { - private final GetRequest instance; - - public GetRequestBuilder() { - this.instance = new GetRequest(); - } - - public GetRequest build() { - return instance; - } - - public GetRequest getInstance() { - return instance; - } - - public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { - return this; - } - - public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/FakeredirectionGetResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/FakeredirectionGetResponses.java new file mode 100644 index 00000000000..6928c6ba66e --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/FakeredirectionGetResponses.java @@ -0,0 +1,79 @@ +package org.openapijsonschematools.client.paths.fakeredirection.get; + +import org.openapijsonschematools.client.paths.fakeredirection.get.responses.FakeredirectionGetCode303Response; +import org.openapijsonschematools.client.paths.fakeredirection.get.responses.FakeredirectionGetCode3XXResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakeredirectionGetResponses { + public sealed interface EndpointResponse permits EndpointFakeredirectionGetCode3XXResponse, EndpointFakeredirectionGetCode303Response {} + + public record EndpointFakeredirectionGetCode3XXResponse( + HttpResponse response, + Void body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public record EndpointFakeredirectionGetCode303Response( + HttpResponse response, + Void body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakeredirectionGetCode303ResponseDeserializer {} + + public static final class StatusFakeredirectionGetCode303ResponseDeserializer extends FakeredirectionGetCode303Response.FakeredirectionGetCode303Response1 implements StatusCodeResponseDeserializer { + } + public sealed interface WildcardCodeResponseDeserializer permits WildcardFakeredirectionGetCode3XXResponseDeserializer {} + + public static final class WildcardFakeredirectionGetCode3XXResponseDeserializer extends FakeredirectionGetCode3XXResponse.FakeredirectionGetCode3XXResponse1 implements WildcardCodeResponseDeserializer { + } + + public static final class FakeredirectionGetResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + private final Map wildcardCodeToResponseDeserializer; + public FakeredirectionGetResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("303", new StatusFakeredirectionGetCode303ResponseDeserializer()) + ); + this.wildcardCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("3", new WildcardFakeredirectionGetCode3XXResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer != null) { + StatusFakeredirectionGetCode303ResponseDeserializer castDeserializer = (StatusFakeredirectionGetCode303ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakeredirectionGetCode303Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + @Nullable WildcardCodeResponseDeserializer wildcardCodeDeserializer = wildcardCodeToResponseDeserializer.get(statusCode); + if (wildcardCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + WildcardFakeredirectionGetCode3XXResponseDeserializer castDeserializer = (WildcardFakeredirectionGetCode3XXResponseDeserializer) wildcardCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + throw new FakeredirectionGetCode3XXResponse.ResponseApiException( + "Received error statusCode response from server", + response, + deserializedResponse + ); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/Responses.java deleted file mode 100644 index addd1e3384e..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/Responses.java +++ /dev/null @@ -1,79 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeredirection.get; - -import org.openapijsonschematools.client.paths.fakeredirection.get.responses.Code303Response; -import org.openapijsonschematools.client.paths.fakeredirection.get.responses.Code3XXResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode3XXResponse, EndpointCode303Response {} - - public record EndpointCode3XXResponse( - HttpResponse response, - Void body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public record EndpointCode303Response( - HttpResponse response, - Void body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode303ResponseDeserializer {} - - public static final class StatusCode303ResponseDeserializer extends Code303Response.Code303Response1 implements StatusCodeResponseDeserializer { - } - public sealed interface WildcardCodeResponseDeserializer permits WildcardCode3XXResponseDeserializer {} - - public static final class WildcardCode3XXResponseDeserializer extends Code3XXResponse.Code3XXResponse1 implements WildcardCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - private final Map wildcardCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("303", new StatusCode303ResponseDeserializer()) - ); - this.wildcardCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("3", new WildcardCode3XXResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer != null) { - StatusCode303ResponseDeserializer castDeserializer = (StatusCode303ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode303Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - @Nullable WildcardCodeResponseDeserializer wildcardCodeDeserializer = wildcardCodeToResponseDeserializer.get(statusCode); - if (wildcardCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - WildcardCode3XXResponseDeserializer castDeserializer = (WildcardCode3XXResponseDeserializer) wildcardCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - throw new Code3XXResponse.ResponseApiException( - "Received error statusCode response from server", - response, - deserializedResponse - ); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/responses/Code303Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/responses/Code303Response.java deleted file mode 100644 index 80bbe5222cf..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/responses/Code303Response.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeredirection.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; - -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code303Response { - - public static class Code303Response1 extends ResponseDeserializer { - public Code303Response1() { - super( - MapUtils.makeMap( - ) - ); - } - - @Override - protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { - return null; - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/responses/Code3XXResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/responses/Code3XXResponse.java deleted file mode 100644 index fc5125abeca..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/responses/Code3XXResponse.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeredirection.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; - -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code3XXResponse { - - public static class Code3XXResponse1 extends ResponseDeserializer { - public Code3XXResponse1() { - super( - MapUtils.makeMap( - ) - ); - } - - @Override - protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { - return null; - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/responses/FakeredirectionGetCode303Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/responses/FakeredirectionGetCode303Response.java new file mode 100644 index 00000000000..8feee1d93ad --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/responses/FakeredirectionGetCode303Response.java @@ -0,0 +1,45 @@ +package org.openapijsonschematools.client.paths.fakeredirection.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakeredirectionGetCode303Response { + + public static class FakeredirectionGetCode303Response1 extends ResponseDeserializer { + public FakeredirectionGetCode303Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/responses/FakeredirectionGetCode3XXResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/responses/FakeredirectionGetCode3XXResponse.java new file mode 100644 index 00000000000..c2e9f302411 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeredirection/get/responses/FakeredirectionGetCode3XXResponse.java @@ -0,0 +1,45 @@ +package org.openapijsonschematools.client.paths.fakeredirection.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakeredirectionGetCode3XXResponse { + + public static class FakeredirectionGetCode3XXResponse1 extends ResponseDeserializer { + public FakeredirectionGetCode3XXResponse1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/FakerefobjinqueryGet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/FakerefobjinqueryGet.java new file mode 100644 index 00000000000..a216fc1f1d3 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/FakerefobjinqueryGet.java @@ -0,0 +1,148 @@ +package org.openapijsonschematools.client.paths.fakerefobjinquery; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.fakerefobjinquery.get.FakerefobjinqueryGetQueryParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakerefobjinquery.get.Parameters; +import org.openapijsonschematools.client.paths.fakerefobjinquery.get.FakerefobjinqueryGetResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.paths.Fakerefobjinquery; + +import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakerefobjinqueryGet { + private static class GetProvider { + private static final String method = "get"; + + public static FakerefobjinqueryGetResponses.EndpointResponse get( + GetRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + + var querySerializer = new Parameters.QueryParametersSerializer(); + @Nullable Map queryMap = null; + if (request.queryParameters != null) { + queryMap = querySerializer.getQueryMap(request.queryParameters); + } + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakerefobjinquery.path; + if (queryMap != null) { + url = url + querySerializer.serialize(queryMap); + } + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakerefobjinqueryGetResponses.FakerefobjinqueryGetResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface GetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakerefobjinqueryGetResponses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface RefObjectInQueryOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakerefobjinqueryGetResponses.EndpointResponse refObjectInQuery(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Get extends ApiClient implements GetOperation { + public Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class GetRequest { + public FakerefobjinqueryGetQueryParameters.@Nullable FakerefobjinqueryGetQueryParametersMap queryParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForQueryParameters { + GetRequest getInstance(); + T getBuilderAfterQueryParameters(GetRequest instance); + default T queryParameters(FakerefobjinqueryGetQueryParameters.FakerefobjinqueryGetQueryParametersMap queryParameters) { + var instance = getInstance(); + instance.queryParameters = queryParameters; + return getBuilderAfterQueryParameters(instance); + } + } + + public interface SetterForServerIndex { + GetRequest getInstance(); + T getBuilderAfterServerIndex(GetRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + GetRequest getInstance(); + T getBuilderAfterTimeout(GetRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class GetRequestBuilder implements SetterForQueryParameters, SetterForServerIndex, SetterForTimeout { + private final GetRequest instance; + + public GetRequestBuilder() { + this.instance = new GetRequest(); + } + + public GetRequest build() { + return instance; + } + + public GetRequest getInstance() { + return instance; + } + + public GetRequestBuilder getBuilderAfterQueryParameters(GetRequest instance) { + return this; + } + + public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { + return this; + } + + public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/Get.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/Get.java deleted file mode 100644 index d640b1e04c5..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/Get.java +++ /dev/null @@ -1,139 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefobjinquery; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.fakerefobjinquery.get.QueryParameters; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakerefobjinquery.get.Parameters; -import org.openapijsonschematools.client.paths.fakerefobjinquery.get.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.paths.Fakerefobjinquery; - -import java.io.IOException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Get { - private static class GetProvider { - private static final String method = "get"; - - public static Responses.EndpointResponse get( - GetRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - - var querySerializer = new Parameters.QueryParametersSerializer(); - @Nullable Map queryMap = null; - if (request.queryParameters != null) { - queryMap = querySerializer.getQueryMap(request.queryParameters); - } - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakerefobjinquery.path; - if (queryMap != null) { - url = url + querySerializer.serialize(queryMap); - } - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface GetOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Get1 extends ApiClient implements GetOperation { - public Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class GetRequest { - public QueryParameters.@Nullable QueryParametersMap queryParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForQueryParameters { - GetRequest getInstance(); - T getBuilderAfterQueryParameters(GetRequest instance); - default T queryParameters(QueryParameters.QueryParametersMap queryParameters) { - var instance = getInstance(); - instance.queryParameters = queryParameters; - return getBuilderAfterQueryParameters(instance); - } - } - - public interface SetterForServerIndex { - GetRequest getInstance(); - T getBuilderAfterServerIndex(GetRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - GetRequest getInstance(); - T getBuilderAfterTimeout(GetRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class GetRequestBuilder implements SetterForQueryParameters, SetterForServerIndex, SetterForTimeout { - private final GetRequest instance; - - public GetRequestBuilder() { - this.instance = new GetRequest(); - } - - public GetRequest build() { - return instance; - } - - public GetRequest getInstance() { - return instance; - } - - public GetRequestBuilder getBuilderAfterQueryParameters(GetRequest instance) { - return this; - } - - public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { - return this; - } - - public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/FakerefobjinqueryGetQueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/FakerefobjinqueryGetQueryParameters.java new file mode 100644 index 00000000000..f85cdfc3437 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/FakerefobjinqueryGetQueryParameters.java @@ -0,0 +1,191 @@ +package org.openapijsonschematools.client.paths.fakerefobjinquery.get; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.components.schemas.Foo; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class FakerefobjinqueryGetQueryParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class FakerefobjinqueryGetadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable FakerefobjinqueryGetadditionalProperties instance = null; + public static FakerefobjinqueryGetadditionalProperties getInstance() { + if (instance == null) { + instance = new FakerefobjinqueryGetadditionalProperties(); + } + return instance; + } + } + + + public static class FakerefobjinqueryGetQueryParametersMap extends FrozenMap { + protected FakerefobjinqueryGetQueryParametersMap(FrozenMap m) { + super(m); + } + public static final Set requiredKeys = Set.of(); + public static final Set optionalKeys = Set.of( + "mapBean" + ); + public static FakerefobjinqueryGetQueryParametersMap of(Map> arg, SchemaConfiguration configuration) throws ValidationException { + return FakerefobjinqueryGetQueryParameters1.getInstance().validate(arg, configuration); + } + + public Foo.FooMap mapBean() throws UnsetPropertyException { + return getOrThrow("mapBean"); + } + } + + public interface SetterForFakerefobjinqueryGetmapBean { + Map> getInstance(); + T getBuilderAfterFakerefobjinqueryGetmapBean(Map> instance); + + default T mapBean(Map value) { + var instance = getInstance(); + instance.put("mapBean", value); + return getBuilderAfterFakerefobjinqueryGetmapBean(instance); + } + } + + public static class FakerefobjinqueryGetQueryParametersMapBuilder implements GenericBuilder>>, SetterForFakerefobjinqueryGetmapBean { + private final Map> instance; + private static final Set knownKeys = Set.of( + "mapBean" + ); + public Set getKnownKeys() { + return knownKeys; + } + public FakerefobjinqueryGetQueryParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map> build() { + return instance; + } + public Map> getInstance() { + return instance; + } + public FakerefobjinqueryGetQueryParametersMapBuilder getBuilderAfterFakerefobjinqueryGetmapBean(Map> instance) { + return this; + } + } + + + public sealed interface FakerefobjinqueryGetQueryParameters1Boxed permits FakerefobjinqueryGetQueryParameters1BoxedMap { + @Nullable Object getData(); + } + + public record FakerefobjinqueryGetQueryParameters1BoxedMap(FakerefobjinqueryGetQueryParametersMap data) implements FakerefobjinqueryGetQueryParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class FakerefobjinqueryGetQueryParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable FakerefobjinqueryGetQueryParameters1 instance = null; + + protected FakerefobjinqueryGetQueryParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("mapBean", Foo.Foo1.class) + )) + .additionalProperties(FakerefobjinqueryGetadditionalProperties.class) + ); + } + + public static FakerefobjinqueryGetQueryParameters1 getInstance() { + if (instance == null) { + instance = new FakerefobjinqueryGetQueryParameters1(); + } + return instance; + } + + public FakerefobjinqueryGetQueryParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Foo.FooMap)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (Foo.FooMap) propertyInstance); + } + FrozenMap castProperties = new FrozenMap<>(properties); + return new FakerefobjinqueryGetQueryParametersMap(castProperties); + } + + public FakerefobjinqueryGetQueryParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public FakerefobjinqueryGetQueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new FakerefobjinqueryGetQueryParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public FakerefobjinqueryGetQueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/FakerefobjinqueryGetResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/FakerefobjinqueryGetResponses.java new file mode 100644 index 00000000000..18a07a581a2 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/FakerefobjinqueryGetResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakerefobjinquery.get; + +import org.openapijsonschematools.client.paths.fakerefobjinquery.get.responses.FakerefobjinqueryGetCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakerefobjinqueryGetResponses { + public sealed interface EndpointResponse permits EndpointFakerefobjinqueryGetCode200Response {} + + public record EndpointFakerefobjinqueryGetCode200Response( + HttpResponse response, + Void body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakerefobjinqueryGetCode200ResponseDeserializer {} + + public static final class StatusFakerefobjinqueryGetCode200ResponseDeserializer extends FakerefobjinqueryGetCode200Response.FakerefobjinqueryGetCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakerefobjinqueryGetResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakerefobjinqueryGetResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakerefobjinqueryGetCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakerefobjinqueryGetCode200ResponseDeserializer castDeserializer = (StatusFakerefobjinqueryGetCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakerefobjinqueryGetCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/QueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/QueryParameters.java deleted file mode 100644 index 287d01c12a6..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/QueryParameters.java +++ /dev/null @@ -1,191 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefobjinquery.get; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.components.schemas.Foo; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class QueryParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class QueryParametersMap extends FrozenMap { - protected QueryParametersMap(FrozenMap m) { - super(m); - } - public static final Set requiredKeys = Set.of(); - public static final Set optionalKeys = Set.of( - "mapBean" - ); - public static QueryParametersMap of(Map> arg, SchemaConfiguration configuration) throws ValidationException { - return QueryParameters1.getInstance().validate(arg, configuration); - } - - public Foo.FooMap mapBean() throws UnsetPropertyException { - return getOrThrow("mapBean"); - } - } - - public interface SetterForMapBean { - Map> getInstance(); - T getBuilderAfterMapBean(Map> instance); - - default T mapBean(Map value) { - var instance = getInstance(); - instance.put("mapBean", value); - return getBuilderAfterMapBean(instance); - } - } - - public static class QueryParametersMapBuilder implements GenericBuilder>>, SetterForMapBean { - private final Map> instance; - private static final Set knownKeys = Set.of( - "mapBean" - ); - public Set getKnownKeys() { - return knownKeys; - } - public QueryParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map> build() { - return instance; - } - public Map> getInstance() { - return instance; - } - public QueryParametersMapBuilder getBuilderAfterMapBean(Map> instance) { - return this; - } - } - - - public sealed interface QueryParameters1Boxed permits QueryParameters1BoxedMap { - @Nullable Object getData(); - } - - public record QueryParameters1BoxedMap(QueryParametersMap data) implements QueryParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable QueryParameters1 instance = null; - - protected QueryParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("mapBean", Foo.Foo1.class) - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static QueryParameters1 getInstance() { - if (instance == null) { - instance = new QueryParameters1(); - } - return instance; - } - - public QueryParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - if (!(propertyInstance instanceof Foo.FooMap)) { - throw new RuntimeException("Invalid instantiated value"); - } - properties.put(propertyName, (Foo.FooMap) propertyInstance); - } - FrozenMap castProperties = new FrozenMap<>(properties); - return new QueryParametersMap(castProperties); - } - - public QueryParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public QueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new QueryParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public QueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/Responses.java deleted file mode 100644 index fa40e5c878e..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefobjinquery.get; - -import org.openapijsonschematools.client.paths.fakerefobjinquery.get.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/responses/Code200Response.java deleted file mode 100644 index ef459550ec7..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/responses/Code200Response.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefobjinquery.get.responses; - -import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; - -public class Code200Response extends SuccessDescriptionOnly { - public static class Code200Response1 extends SuccessDescriptionOnly1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/responses/FakerefobjinqueryGetCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/responses/FakerefobjinqueryGetCode200Response.java new file mode 100644 index 00000000000..7ae25fb0e12 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefobjinquery/get/responses/FakerefobjinqueryGetCode200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.fakerefobjinquery.get.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class FakerefobjinqueryGetCode200Response extends SuccessDescriptionOnly { + public static class FakerefobjinqueryGetCode200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/FakerefsarraymodelPost.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/FakerefsarraymodelPost.java new file mode 100644 index 00000000000..07af16ea8b6 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/FakerefsarraymodelPost.java @@ -0,0 +1,152 @@ +package org.openapijsonschematools.client.paths.fakerefsarraymodel; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.fakerefsarraymodel.post.FakerefsarraymodelPostRequestBody; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakerefsarraymodel.post.FakerefsarraymodelPostResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Fakerefsarraymodel; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakerefsarraymodelPost { + private static class PostProvider { + private static final String method = "post"; + + public static FakerefsarraymodelPostResponses.EndpointResponse post( + PostRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + @Nullable SerializedRequestBody serializedRequestBody; + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + if (request.requestBody != null) { + serializedRequestBody = new FakerefsarraymodelPostRequestBody.FakerefsarraymodelPostRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + bodyPublisher = serializedRequestBody.bodyPublisher; + } + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakerefsarraymodel.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakerefsarraymodelPostResponses.FakerefsarraymodelPostResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PostOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakerefsarraymodelPostResponses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface ArrayModelOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakerefsarraymodelPostResponses.EndpointResponse arrayModel(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Post extends ApiClient implements PostOperation { + public Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PostRequest { + public FakerefsarraymodelPostRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForRequestBody { + PostRequest getInstance(); + T getBuilderAfterRequestBody(PostRequest instance); + default T requestBody(FakerefsarraymodelPostRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public interface SetterForServerIndex { + PostRequest getInstance(); + T getBuilderAfterServerIndex(PostRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PostRequest getInstance(); + T getBuilderAfterTimeout(PostRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class PostRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { + private final PostRequest instance; + + public PostRequestBuilder() { + this.instance = new PostRequest(); + } + + public PostRequest build() { + return instance; + } + + public PostRequest getInstance() { + return instance; + } + + public PostRequestBuilder getBuilderAfterRequestBody(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterServerIndex(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterTimeout(PostRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/Post.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/Post.java deleted file mode 100644 index 3b1dad9974c..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/Post.java +++ /dev/null @@ -1,143 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefsarraymodel; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.fakerefsarraymodel.post.RequestBody; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakerefsarraymodel.post.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Fakerefsarraymodel; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Post { - private static class PostProvider { - private static final String method = "post"; - - public static Responses.EndpointResponse post( - PostRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - @Nullable SerializedRequestBody serializedRequestBody; - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - if (request.requestBody != null) { - serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - bodyPublisher = serializedRequestBody.bodyPublisher; - } - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakerefsarraymodel.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PostOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Post1 extends ApiClient implements PostOperation { - public Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PostRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForRequestBody { - PostRequest getInstance(); - T getBuilderAfterRequestBody(PostRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public interface SetterForServerIndex { - PostRequest getInstance(); - T getBuilderAfterServerIndex(PostRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PostRequest getInstance(); - T getBuilderAfterTimeout(PostRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class PostRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { - private final PostRequest instance; - - public PostRequestBuilder() { - this.instance = new PostRequest(); - } - - public PostRequest build() { - return instance; - } - - public PostRequest getInstance() { - return instance; - } - - public PostRequestBuilder getBuilderAfterRequestBody(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterServerIndex(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterTimeout(PostRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/FakerefsarraymodelPostRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/FakerefsarraymodelPostRequestBody.java new file mode 100644 index 00000000000..fc08f67aafb --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/FakerefsarraymodelPostRequestBody.java @@ -0,0 +1,53 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.fakerefsarraymodel.post; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakerefsarraymodel.post.requestbody.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class FakerefsarraymodelPostRequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class FakerefsarraymodelPostRequestBody1 extends RequestBodySerializer { + public FakerefsarraymodelPostRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ), + false + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } + } + + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.AnimalFarm1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "application/json"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/FakerefsarraymodelPostResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/FakerefsarraymodelPostResponses.java new file mode 100644 index 00000000000..563a821044a --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/FakerefsarraymodelPostResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakerefsarraymodel.post; + +import org.openapijsonschematools.client.paths.fakerefsarraymodel.post.responses.FakerefsarraymodelPostCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakerefsarraymodelPostResponses { + public sealed interface EndpointResponse permits EndpointFakerefsarraymodelPostCode200Response {} + + public record EndpointFakerefsarraymodelPostCode200Response( + HttpResponse response, + FakerefsarraymodelPostCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakerefsarraymodelPostCode200ResponseDeserializer {} + + public static final class StatusFakerefsarraymodelPostCode200ResponseDeserializer extends FakerefsarraymodelPostCode200Response.FakerefsarraymodelPostCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakerefsarraymodelPostResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakerefsarraymodelPostResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakerefsarraymodelPostCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakerefsarraymodelPostCode200ResponseDeserializer castDeserializer = (StatusFakerefsarraymodelPostCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakerefsarraymodelPostCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/RequestBody.java deleted file mode 100644 index cd7db4c428b..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/RequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.fakerefsarraymodel.post; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakerefsarraymodel.post.requestbody.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ), - false - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } - } - - public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} - public record ApplicationjsonRequestBody(ApplicationjsonSchema.AnimalFarm1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "application/json"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/Responses.java deleted file mode 100644 index dbe304b8a0f..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefsarraymodel.post; - -import org.openapijsonschematools.client.paths.fakerefsarraymodel.post.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/responses/Code200Response.java deleted file mode 100644 index c6902020026..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/responses/Code200Response.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefsarraymodel.post.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakerefsarraymodel.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnimalFarm1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/responses/FakerefsarraymodelPostCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/responses/FakerefsarraymodelPostCode200Response.java new file mode 100644 index 00000000000..292fe11781b --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarraymodel/post/responses/FakerefsarraymodelPostCode200Response.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakerefsarraymodel.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakerefsarraymodel.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakerefsarraymodelPostCode200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnimalFarm1Boxed body) implements SealedResponseBody { } + + public static class FakerefsarraymodelPostCode200Response1 extends ResponseDeserializer { + public FakerefsarraymodelPostCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/FakerefsarrayofenumsPost.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/FakerefsarrayofenumsPost.java new file mode 100644 index 00000000000..2e562146fb3 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/FakerefsarrayofenumsPost.java @@ -0,0 +1,152 @@ +package org.openapijsonschematools.client.paths.fakerefsarrayofenums; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.fakerefsarrayofenums.post.FakerefsarrayofenumsPostRequestBody; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakerefsarrayofenums.post.FakerefsarrayofenumsPostResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Fakerefsarrayofenums; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakerefsarrayofenumsPost { + private static class PostProvider { + private static final String method = "post"; + + public static FakerefsarrayofenumsPostResponses.EndpointResponse post( + PostRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + @Nullable SerializedRequestBody serializedRequestBody; + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + if (request.requestBody != null) { + serializedRequestBody = new FakerefsarrayofenumsPostRequestBody.FakerefsarrayofenumsPostRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + bodyPublisher = serializedRequestBody.bodyPublisher; + } + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakerefsarrayofenums.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakerefsarrayofenumsPostResponses.FakerefsarrayofenumsPostResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PostOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakerefsarrayofenumsPostResponses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface ArrayOfEnumsOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakerefsarrayofenumsPostResponses.EndpointResponse arrayOfEnums(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Post extends ApiClient implements PostOperation { + public Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PostRequest { + public FakerefsarrayofenumsPostRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForRequestBody { + PostRequest getInstance(); + T getBuilderAfterRequestBody(PostRequest instance); + default T requestBody(FakerefsarrayofenumsPostRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public interface SetterForServerIndex { + PostRequest getInstance(); + T getBuilderAfterServerIndex(PostRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PostRequest getInstance(); + T getBuilderAfterTimeout(PostRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class PostRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { + private final PostRequest instance; + + public PostRequestBuilder() { + this.instance = new PostRequest(); + } + + public PostRequest build() { + return instance; + } + + public PostRequest getInstance() { + return instance; + } + + public PostRequestBuilder getBuilderAfterRequestBody(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterServerIndex(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterTimeout(PostRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/Post.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/Post.java deleted file mode 100644 index 13d1ccbab8f..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/Post.java +++ /dev/null @@ -1,143 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefsarrayofenums; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.fakerefsarrayofenums.post.RequestBody; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakerefsarrayofenums.post.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Fakerefsarrayofenums; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Post { - private static class PostProvider { - private static final String method = "post"; - - public static Responses.EndpointResponse post( - PostRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - @Nullable SerializedRequestBody serializedRequestBody; - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - if (request.requestBody != null) { - serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - bodyPublisher = serializedRequestBody.bodyPublisher; - } - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakerefsarrayofenums.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PostOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Post1 extends ApiClient implements PostOperation { - public Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PostRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForRequestBody { - PostRequest getInstance(); - T getBuilderAfterRequestBody(PostRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public interface SetterForServerIndex { - PostRequest getInstance(); - T getBuilderAfterServerIndex(PostRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PostRequest getInstance(); - T getBuilderAfterTimeout(PostRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class PostRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { - private final PostRequest instance; - - public PostRequestBuilder() { - this.instance = new PostRequest(); - } - - public PostRequest build() { - return instance; - } - - public PostRequest getInstance() { - return instance; - } - - public PostRequestBuilder getBuilderAfterRequestBody(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterServerIndex(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterTimeout(PostRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/FakerefsarrayofenumsPostRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/FakerefsarrayofenumsPostRequestBody.java new file mode 100644 index 00000000000..b613c14a273 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/FakerefsarrayofenumsPostRequestBody.java @@ -0,0 +1,53 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.fakerefsarrayofenums.post; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakerefsarrayofenums.post.requestbody.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class FakerefsarrayofenumsPostRequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class FakerefsarrayofenumsPostRequestBody1 extends RequestBodySerializer { + public FakerefsarrayofenumsPostRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ), + false + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } + } + + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.ArrayOfEnums1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "application/json"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/FakerefsarrayofenumsPostResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/FakerefsarrayofenumsPostResponses.java new file mode 100644 index 00000000000..5fa02b7fa60 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/FakerefsarrayofenumsPostResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakerefsarrayofenums.post; + +import org.openapijsonschematools.client.paths.fakerefsarrayofenums.post.responses.FakerefsarrayofenumsPostCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakerefsarrayofenumsPostResponses { + public sealed interface EndpointResponse permits EndpointFakerefsarrayofenumsPostCode200Response {} + + public record EndpointFakerefsarrayofenumsPostCode200Response( + HttpResponse response, + FakerefsarrayofenumsPostCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakerefsarrayofenumsPostCode200ResponseDeserializer {} + + public static final class StatusFakerefsarrayofenumsPostCode200ResponseDeserializer extends FakerefsarrayofenumsPostCode200Response.FakerefsarrayofenumsPostCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakerefsarrayofenumsPostResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakerefsarrayofenumsPostResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakerefsarrayofenumsPostCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakerefsarrayofenumsPostCode200ResponseDeserializer castDeserializer = (StatusFakerefsarrayofenumsPostCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakerefsarrayofenumsPostCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/RequestBody.java deleted file mode 100644 index b9c573e092d..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/RequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.fakerefsarrayofenums.post; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakerefsarrayofenums.post.requestbody.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ), - false - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } - } - - public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} - public record ApplicationjsonRequestBody(ApplicationjsonSchema.ArrayOfEnums1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "application/json"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/Responses.java deleted file mode 100644 index 4e054707d20..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefsarrayofenums.post; - -import org.openapijsonschematools.client.paths.fakerefsarrayofenums.post.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/responses/Code200Response.java deleted file mode 100644 index 9ee1287a9d1..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/responses/Code200Response.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefsarrayofenums.post.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakerefsarrayofenums.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.ArrayOfEnums1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/responses/FakerefsarrayofenumsPostCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/responses/FakerefsarrayofenumsPostCode200Response.java new file mode 100644 index 00000000000..5f83f4d05d1 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsarrayofenums/post/responses/FakerefsarrayofenumsPostCode200Response.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakerefsarrayofenums.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakerefsarrayofenums.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakerefsarrayofenumsPostCode200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.ArrayOfEnums1Boxed body) implements SealedResponseBody { } + + public static class FakerefsarrayofenumsPostCode200Response1 extends ResponseDeserializer { + public FakerefsarrayofenumsPostCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/FakerefsbooleanPost.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/FakerefsbooleanPost.java new file mode 100644 index 00000000000..48e40534184 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/FakerefsbooleanPost.java @@ -0,0 +1,152 @@ +package org.openapijsonschematools.client.paths.fakerefsboolean; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.fakerefsboolean.post.FakerefsbooleanPostRequestBody; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakerefsboolean.post.FakerefsbooleanPostResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Fakerefsboolean; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakerefsbooleanPost { + private static class PostProvider { + private static final String method = "post"; + + public static FakerefsbooleanPostResponses.EndpointResponse post( + PostRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + @Nullable SerializedRequestBody serializedRequestBody; + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + if (request.requestBody != null) { + serializedRequestBody = new FakerefsbooleanPostRequestBody.FakerefsbooleanPostRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + bodyPublisher = serializedRequestBody.bodyPublisher; + } + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakerefsboolean.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakerefsbooleanPostResponses.FakerefsbooleanPostResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PostOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakerefsbooleanPostResponses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface ModelBooleanOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakerefsbooleanPostResponses.EndpointResponse modelBoolean(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Post extends ApiClient implements PostOperation { + public Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PostRequest { + public FakerefsbooleanPostRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForRequestBody { + PostRequest getInstance(); + T getBuilderAfterRequestBody(PostRequest instance); + default T requestBody(FakerefsbooleanPostRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public interface SetterForServerIndex { + PostRequest getInstance(); + T getBuilderAfterServerIndex(PostRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PostRequest getInstance(); + T getBuilderAfterTimeout(PostRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class PostRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { + private final PostRequest instance; + + public PostRequestBuilder() { + this.instance = new PostRequest(); + } + + public PostRequest build() { + return instance; + } + + public PostRequest getInstance() { + return instance; + } + + public PostRequestBuilder getBuilderAfterRequestBody(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterServerIndex(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterTimeout(PostRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/Post.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/Post.java deleted file mode 100644 index 95db0847da6..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/Post.java +++ /dev/null @@ -1,143 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefsboolean; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.fakerefsboolean.post.RequestBody; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakerefsboolean.post.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Fakerefsboolean; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Post { - private static class PostProvider { - private static final String method = "post"; - - public static Responses.EndpointResponse post( - PostRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - @Nullable SerializedRequestBody serializedRequestBody; - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - if (request.requestBody != null) { - serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - bodyPublisher = serializedRequestBody.bodyPublisher; - } - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakerefsboolean.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PostOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Post1 extends ApiClient implements PostOperation { - public Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PostRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForRequestBody { - PostRequest getInstance(); - T getBuilderAfterRequestBody(PostRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public interface SetterForServerIndex { - PostRequest getInstance(); - T getBuilderAfterServerIndex(PostRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PostRequest getInstance(); - T getBuilderAfterTimeout(PostRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class PostRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { - private final PostRequest instance; - - public PostRequestBuilder() { - this.instance = new PostRequest(); - } - - public PostRequest build() { - return instance; - } - - public PostRequest getInstance() { - return instance; - } - - public PostRequestBuilder getBuilderAfterRequestBody(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterServerIndex(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterTimeout(PostRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/FakerefsbooleanPostRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/FakerefsbooleanPostRequestBody.java new file mode 100644 index 00000000000..1b369a99210 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/FakerefsbooleanPostRequestBody.java @@ -0,0 +1,53 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.fakerefsboolean.post; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakerefsboolean.post.requestbody.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class FakerefsbooleanPostRequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class FakerefsbooleanPostRequestBody1 extends RequestBodySerializer { + public FakerefsbooleanPostRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ), + false + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } + } + + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.BooleanJsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "application/json"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/FakerefsbooleanPostResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/FakerefsbooleanPostResponses.java new file mode 100644 index 00000000000..ad09fb08b97 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/FakerefsbooleanPostResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakerefsboolean.post; + +import org.openapijsonschematools.client.paths.fakerefsboolean.post.responses.FakerefsbooleanPostCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakerefsbooleanPostResponses { + public sealed interface EndpointResponse permits EndpointFakerefsbooleanPostCode200Response {} + + public record EndpointFakerefsbooleanPostCode200Response( + HttpResponse response, + FakerefsbooleanPostCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakerefsbooleanPostCode200ResponseDeserializer {} + + public static final class StatusFakerefsbooleanPostCode200ResponseDeserializer extends FakerefsbooleanPostCode200Response.FakerefsbooleanPostCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakerefsbooleanPostResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakerefsbooleanPostResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakerefsbooleanPostCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakerefsbooleanPostCode200ResponseDeserializer castDeserializer = (StatusFakerefsbooleanPostCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakerefsbooleanPostCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/RequestBody.java deleted file mode 100644 index 7d6c5aea5e6..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/RequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.fakerefsboolean.post; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakerefsboolean.post.requestbody.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ), - false - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } - } - - public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} - public record ApplicationjsonRequestBody(ApplicationjsonSchema.BooleanJsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "application/json"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/Responses.java deleted file mode 100644 index 755d4d97568..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefsboolean.post; - -import org.openapijsonschematools.client.paths.fakerefsboolean.post.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/responses/Code200Response.java deleted file mode 100644 index 2f85215f463..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/responses/Code200Response.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefsboolean.post.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakerefsboolean.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.BooleanJsonSchema1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/responses/FakerefsbooleanPostCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/responses/FakerefsbooleanPostCode200Response.java new file mode 100644 index 00000000000..8018c18af9e --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsboolean/post/responses/FakerefsbooleanPostCode200Response.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakerefsboolean.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakerefsboolean.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakerefsbooleanPostCode200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.BooleanJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class FakerefsbooleanPostCode200Response1 extends ResponseDeserializer { + public FakerefsbooleanPostCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/FakerefscomposedoneofnumberwithvalidationsPost.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/FakerefscomposedoneofnumberwithvalidationsPost.java new file mode 100644 index 00000000000..6b1f0e40677 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/FakerefscomposedoneofnumberwithvalidationsPost.java @@ -0,0 +1,152 @@ +package org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post.FakerefscomposedoneofnumberwithvalidationsPostRequestBody; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post.FakerefscomposedoneofnumberwithvalidationsPostResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Fakerefscomposedoneofnumberwithvalidations; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakerefscomposedoneofnumberwithvalidationsPost { + private static class PostProvider { + private static final String method = "post"; + + public static FakerefscomposedoneofnumberwithvalidationsPostResponses.EndpointResponse post( + PostRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + @Nullable SerializedRequestBody serializedRequestBody; + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + if (request.requestBody != null) { + serializedRequestBody = new FakerefscomposedoneofnumberwithvalidationsPostRequestBody.FakerefscomposedoneofnumberwithvalidationsPostRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + bodyPublisher = serializedRequestBody.bodyPublisher; + } + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakerefscomposedoneofnumberwithvalidations.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakerefscomposedoneofnumberwithvalidationsPostResponses.FakerefscomposedoneofnumberwithvalidationsPostResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PostOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakerefscomposedoneofnumberwithvalidationsPostResponses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface ComposedOneOfDifferentTypesOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakerefscomposedoneofnumberwithvalidationsPostResponses.EndpointResponse composedOneOfDifferentTypes(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Post extends ApiClient implements PostOperation { + public Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PostRequest { + public FakerefscomposedoneofnumberwithvalidationsPostRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForRequestBody { + PostRequest getInstance(); + T getBuilderAfterRequestBody(PostRequest instance); + default T requestBody(FakerefscomposedoneofnumberwithvalidationsPostRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public interface SetterForServerIndex { + PostRequest getInstance(); + T getBuilderAfterServerIndex(PostRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PostRequest getInstance(); + T getBuilderAfterTimeout(PostRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class PostRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { + private final PostRequest instance; + + public PostRequestBuilder() { + this.instance = new PostRequest(); + } + + public PostRequest build() { + return instance; + } + + public PostRequest getInstance() { + return instance; + } + + public PostRequestBuilder getBuilderAfterRequestBody(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterServerIndex(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterTimeout(PostRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/Post.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/Post.java deleted file mode 100644 index 97d3e46b39c..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/Post.java +++ /dev/null @@ -1,143 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post.RequestBody; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Fakerefscomposedoneofnumberwithvalidations; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Post { - private static class PostProvider { - private static final String method = "post"; - - public static Responses.EndpointResponse post( - PostRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - @Nullable SerializedRequestBody serializedRequestBody; - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - if (request.requestBody != null) { - serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - bodyPublisher = serializedRequestBody.bodyPublisher; - } - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakerefscomposedoneofnumberwithvalidations.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PostOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Post1 extends ApiClient implements PostOperation { - public Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PostRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForRequestBody { - PostRequest getInstance(); - T getBuilderAfterRequestBody(PostRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public interface SetterForServerIndex { - PostRequest getInstance(); - T getBuilderAfterServerIndex(PostRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PostRequest getInstance(); - T getBuilderAfterTimeout(PostRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class PostRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { - private final PostRequest instance; - - public PostRequestBuilder() { - this.instance = new PostRequest(); - } - - public PostRequest build() { - return instance; - } - - public PostRequest getInstance() { - return instance; - } - - public PostRequestBuilder getBuilderAfterRequestBody(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterServerIndex(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterTimeout(PostRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/FakerefscomposedoneofnumberwithvalidationsPostRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/FakerefscomposedoneofnumberwithvalidationsPostRequestBody.java new file mode 100644 index 00000000000..67f5d3bae90 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/FakerefscomposedoneofnumberwithvalidationsPostRequestBody.java @@ -0,0 +1,53 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post.requestbody.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class FakerefscomposedoneofnumberwithvalidationsPostRequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class FakerefscomposedoneofnumberwithvalidationsPostRequestBody1 extends RequestBodySerializer { + public FakerefscomposedoneofnumberwithvalidationsPostRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ), + false + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } + } + + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.ComposedOneOfDifferentTypes1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "application/json"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/FakerefscomposedoneofnumberwithvalidationsPostResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/FakerefscomposedoneofnumberwithvalidationsPostResponses.java new file mode 100644 index 00000000000..3e86f10d166 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/FakerefscomposedoneofnumberwithvalidationsPostResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post; + +import org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post.responses.FakerefscomposedoneofnumberwithvalidationsPostCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakerefscomposedoneofnumberwithvalidationsPostResponses { + public sealed interface EndpointResponse permits EndpointFakerefscomposedoneofnumberwithvalidationsPostCode200Response {} + + public record EndpointFakerefscomposedoneofnumberwithvalidationsPostCode200Response( + HttpResponse response, + FakerefscomposedoneofnumberwithvalidationsPostCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakerefscomposedoneofnumberwithvalidationsPostCode200ResponseDeserializer {} + + public static final class StatusFakerefscomposedoneofnumberwithvalidationsPostCode200ResponseDeserializer extends FakerefscomposedoneofnumberwithvalidationsPostCode200Response.FakerefscomposedoneofnumberwithvalidationsPostCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakerefscomposedoneofnumberwithvalidationsPostResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakerefscomposedoneofnumberwithvalidationsPostResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakerefscomposedoneofnumberwithvalidationsPostCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakerefscomposedoneofnumberwithvalidationsPostCode200ResponseDeserializer castDeserializer = (StatusFakerefscomposedoneofnumberwithvalidationsPostCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakerefscomposedoneofnumberwithvalidationsPostCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/RequestBody.java deleted file mode 100644 index 9c7d24a6e84..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/RequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post.requestbody.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ), - false - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } - } - - public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} - public record ApplicationjsonRequestBody(ApplicationjsonSchema.ComposedOneOfDifferentTypes1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "application/json"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/Responses.java deleted file mode 100644 index bdc96d2297e..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post; - -import org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/Code200Response.java deleted file mode 100644 index aa7d008cb6e..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/Code200Response.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.ComposedOneOfDifferentTypes1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/FakerefscomposedoneofnumberwithvalidationsPostCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/FakerefscomposedoneofnumberwithvalidationsPostCode200Response.java new file mode 100644 index 00000000000..f5b17537155 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefscomposedoneofnumberwithvalidations/post/responses/FakerefscomposedoneofnumberwithvalidationsPostCode200Response.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakerefscomposedoneofnumberwithvalidations.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakerefscomposedoneofnumberwithvalidationsPostCode200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.ComposedOneOfDifferentTypes1Boxed body) implements SealedResponseBody { } + + public static class FakerefscomposedoneofnumberwithvalidationsPostCode200Response1 extends ResponseDeserializer { + public FakerefscomposedoneofnumberwithvalidationsPostCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/FakerefsenumPost.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/FakerefsenumPost.java new file mode 100644 index 00000000000..83b9713931f --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/FakerefsenumPost.java @@ -0,0 +1,152 @@ +package org.openapijsonschematools.client.paths.fakerefsenum; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.fakerefsenum.post.FakerefsenumPostRequestBody; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakerefsenum.post.FakerefsenumPostResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Fakerefsenum; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakerefsenumPost { + private static class PostProvider { + private static final String method = "post"; + + public static FakerefsenumPostResponses.EndpointResponse post( + PostRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + @Nullable SerializedRequestBody serializedRequestBody; + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + if (request.requestBody != null) { + serializedRequestBody = new FakerefsenumPostRequestBody.FakerefsenumPostRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + bodyPublisher = serializedRequestBody.bodyPublisher; + } + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakerefsenum.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakerefsenumPostResponses.FakerefsenumPostResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PostOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakerefsenumPostResponses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface StringEnumOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakerefsenumPostResponses.EndpointResponse stringEnum(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Post extends ApiClient implements PostOperation { + public Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PostRequest { + public FakerefsenumPostRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForRequestBody { + PostRequest getInstance(); + T getBuilderAfterRequestBody(PostRequest instance); + default T requestBody(FakerefsenumPostRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public interface SetterForServerIndex { + PostRequest getInstance(); + T getBuilderAfterServerIndex(PostRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PostRequest getInstance(); + T getBuilderAfterTimeout(PostRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class PostRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { + private final PostRequest instance; + + public PostRequestBuilder() { + this.instance = new PostRequest(); + } + + public PostRequest build() { + return instance; + } + + public PostRequest getInstance() { + return instance; + } + + public PostRequestBuilder getBuilderAfterRequestBody(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterServerIndex(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterTimeout(PostRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/Post.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/Post.java deleted file mode 100644 index 02719172619..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/Post.java +++ /dev/null @@ -1,143 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefsenum; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.fakerefsenum.post.RequestBody; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakerefsenum.post.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Fakerefsenum; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Post { - private static class PostProvider { - private static final String method = "post"; - - public static Responses.EndpointResponse post( - PostRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - @Nullable SerializedRequestBody serializedRequestBody; - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - if (request.requestBody != null) { - serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - bodyPublisher = serializedRequestBody.bodyPublisher; - } - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakerefsenum.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PostOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Post1 extends ApiClient implements PostOperation { - public Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PostRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForRequestBody { - PostRequest getInstance(); - T getBuilderAfterRequestBody(PostRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public interface SetterForServerIndex { - PostRequest getInstance(); - T getBuilderAfterServerIndex(PostRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PostRequest getInstance(); - T getBuilderAfterTimeout(PostRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class PostRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { - private final PostRequest instance; - - public PostRequestBuilder() { - this.instance = new PostRequest(); - } - - public PostRequest build() { - return instance; - } - - public PostRequest getInstance() { - return instance; - } - - public PostRequestBuilder getBuilderAfterRequestBody(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterServerIndex(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterTimeout(PostRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/FakerefsenumPostRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/FakerefsenumPostRequestBody.java new file mode 100644 index 00000000000..0cd90ba6800 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/FakerefsenumPostRequestBody.java @@ -0,0 +1,53 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.fakerefsenum.post; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakerefsenum.post.requestbody.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class FakerefsenumPostRequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class FakerefsenumPostRequestBody1 extends RequestBodySerializer { + public FakerefsenumPostRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ), + false + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } + } + + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.StringEnum1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "application/json"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/FakerefsenumPostResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/FakerefsenumPostResponses.java new file mode 100644 index 00000000000..ca9be127a78 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/FakerefsenumPostResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakerefsenum.post; + +import org.openapijsonschematools.client.paths.fakerefsenum.post.responses.FakerefsenumPostCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakerefsenumPostResponses { + public sealed interface EndpointResponse permits EndpointFakerefsenumPostCode200Response {} + + public record EndpointFakerefsenumPostCode200Response( + HttpResponse response, + FakerefsenumPostCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakerefsenumPostCode200ResponseDeserializer {} + + public static final class StatusFakerefsenumPostCode200ResponseDeserializer extends FakerefsenumPostCode200Response.FakerefsenumPostCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakerefsenumPostResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakerefsenumPostResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakerefsenumPostCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakerefsenumPostCode200ResponseDeserializer castDeserializer = (StatusFakerefsenumPostCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakerefsenumPostCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/RequestBody.java deleted file mode 100644 index 4166ca11c2b..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/RequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.fakerefsenum.post; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakerefsenum.post.requestbody.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ), - false - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } - } - - public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} - public record ApplicationjsonRequestBody(ApplicationjsonSchema.StringEnum1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "application/json"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/Responses.java deleted file mode 100644 index 9668bb4535f..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefsenum.post; - -import org.openapijsonschematools.client.paths.fakerefsenum.post.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/responses/Code200Response.java deleted file mode 100644 index 23ed2009366..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/responses/Code200Response.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefsenum.post.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakerefsenum.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.StringEnum1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/responses/FakerefsenumPostCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/responses/FakerefsenumPostCode200Response.java new file mode 100644 index 00000000000..c250f33f370 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsenum/post/responses/FakerefsenumPostCode200Response.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakerefsenum.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakerefsenum.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakerefsenumPostCode200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.StringEnum1Boxed body) implements SealedResponseBody { } + + public static class FakerefsenumPostCode200Response1 extends ResponseDeserializer { + public FakerefsenumPostCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/FakerefsmammalPost.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/FakerefsmammalPost.java new file mode 100644 index 00000000000..1107280199a --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/FakerefsmammalPost.java @@ -0,0 +1,183 @@ +package org.openapijsonschematools.client.paths.fakerefsmammal; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakerefsmammal.post.FakerefsmammalPostRequestBody; +import org.openapijsonschematools.client.paths.fakerefsmammal.post.FakerefsmammalPostResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Fakerefsmammal; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakerefsmammalPost { + private static class PostProvider { + private static final String method = "post"; + + public static FakerefsmammalPostResponses.EndpointResponse post( + PostRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + SerializedRequestBody serializedRequestBody = new FakerefsmammalPostRequestBody.FakerefsmammalPostRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakerefsmammal.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakerefsmammalPostResponses.FakerefsmammalPostResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PostOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakerefsmammalPostResponses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface MammalOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakerefsmammalPostResponses.EndpointResponse mammal(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Post extends ApiClient implements PostOperation { + public Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PostRequest { + public FakerefsmammalPostRequestBody.SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + + public PostRequest( + FakerefsmammalPostRequestBody.SealedRequestBody requestBody, + RootServerInfo.@Nullable ServerIndex serverIndex, + @Nullable Duration timeout + ) { + this.requestBody = requestBody; + this.serverIndex = serverIndex; + this.timeout = timeout; + } + } + + public static class PostNullableRequest { + public FakerefsmammalPostRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + PostNullableRequest getInstance(); + T getBuilderAfterServerIndex(PostNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PostNullableRequest getInstance(); + T getBuilderAfterTimeout(PostNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForRequestBody { + PostNullableRequest getInstance(); + T getBuilderAfterRequestBody(PostNullableRequest instance); + default T requestBody(FakerefsmammalPostRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public static class Post0RequestBuilder implements SetterForServerIndex, SetterForTimeout { + private final PostNullableRequest instance; + + public Post0RequestBuilder(PostNullableRequest instance) { + this.instance = instance; + } + + public PostRequest build() { + var requestBody = instance.requestBody; + if (requestBody == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new PostRequest( + requestBody, + instance.serverIndex, + instance.timeout + ); + } + + public PostNullableRequest getInstance() { + return instance; + } + + public Post0RequestBuilder getBuilderAfterServerIndex(PostNullableRequest instance) { + return this; + } + + public Post0RequestBuilder getBuilderAfterTimeout(PostNullableRequest instance) { + return this; + } + } + public static class PostRequestBuilder implements SetterForRequestBody { + private final PostNullableRequest instance; + + public PostRequestBuilder() { + this.instance = new PostNullableRequest(); + } + + public PostNullableRequest getInstance() { + return instance; + } + + public Post0RequestBuilder getBuilderAfterRequestBody(PostNullableRequest instance) { + return new Post0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/Post.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/Post.java deleted file mode 100644 index 278c82a493c..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/Post.java +++ /dev/null @@ -1,174 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefsmammal; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakerefsmammal.post.RequestBody; -import org.openapijsonschematools.client.paths.fakerefsmammal.post.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Fakerefsmammal; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Post { - private static class PostProvider { - private static final String method = "post"; - - public static Responses.EndpointResponse post( - PostRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - SerializedRequestBody serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakerefsmammal.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PostOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Post1 extends ApiClient implements PostOperation { - public Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PostRequest { - public RequestBody.SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - - public PostRequest( - RequestBody.SealedRequestBody requestBody, - RootServerInfo.@Nullable ServerIndex serverIndex, - @Nullable Duration timeout - ) { - this.requestBody = requestBody; - this.serverIndex = serverIndex; - this.timeout = timeout; - } - } - - public static class PostNullableRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - PostNullableRequest getInstance(); - T getBuilderAfterServerIndex(PostNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PostNullableRequest getInstance(); - T getBuilderAfterTimeout(PostNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForRequestBody { - PostNullableRequest getInstance(); - T getBuilderAfterRequestBody(PostNullableRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public static class Post0RequestBuilder implements SetterForServerIndex, SetterForTimeout { - private final PostNullableRequest instance; - - public Post0RequestBuilder(PostNullableRequest instance) { - this.instance = instance; - } - - public PostRequest build() { - var requestBody = instance.requestBody; - if (requestBody == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new PostRequest( - requestBody, - instance.serverIndex, - instance.timeout - ); - } - - public PostNullableRequest getInstance() { - return instance; - } - - public Post0RequestBuilder getBuilderAfterServerIndex(PostNullableRequest instance) { - return this; - } - - public Post0RequestBuilder getBuilderAfterTimeout(PostNullableRequest instance) { - return this; - } - } - public static class PostRequestBuilder implements SetterForRequestBody { - private final PostNullableRequest instance; - - public PostRequestBuilder() { - this.instance = new PostNullableRequest(); - } - - public PostNullableRequest getInstance() { - return instance; - } - - public Post0RequestBuilder getBuilderAfterRequestBody(PostNullableRequest instance) { - return new Post0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/FakerefsmammalPostRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/FakerefsmammalPostRequestBody.java new file mode 100644 index 00000000000..695888415fe --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/FakerefsmammalPostRequestBody.java @@ -0,0 +1,53 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.fakerefsmammal.post; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakerefsmammal.post.requestbody.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class FakerefsmammalPostRequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class FakerefsmammalPostRequestBody1 extends RequestBodySerializer { + public FakerefsmammalPostRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ), + true + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } + } + + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.Mammal1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "application/json"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/FakerefsmammalPostResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/FakerefsmammalPostResponses.java new file mode 100644 index 00000000000..57581467ece --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/FakerefsmammalPostResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakerefsmammal.post; + +import org.openapijsonschematools.client.paths.fakerefsmammal.post.responses.FakerefsmammalPostCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakerefsmammalPostResponses { + public sealed interface EndpointResponse permits EndpointFakerefsmammalPostCode200Response {} + + public record EndpointFakerefsmammalPostCode200Response( + HttpResponse response, + FakerefsmammalPostCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakerefsmammalPostCode200ResponseDeserializer {} + + public static final class StatusFakerefsmammalPostCode200ResponseDeserializer extends FakerefsmammalPostCode200Response.FakerefsmammalPostCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakerefsmammalPostResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakerefsmammalPostResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakerefsmammalPostCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakerefsmammalPostCode200ResponseDeserializer castDeserializer = (StatusFakerefsmammalPostCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakerefsmammalPostCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/RequestBody.java deleted file mode 100644 index 7fba66cb6d8..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/RequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.fakerefsmammal.post; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakerefsmammal.post.requestbody.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ), - true - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } - } - - public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} - public record ApplicationjsonRequestBody(ApplicationjsonSchema.Mammal1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "application/json"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/Responses.java deleted file mode 100644 index 47df1517739..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefsmammal.post; - -import org.openapijsonschematools.client.paths.fakerefsmammal.post.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/responses/Code200Response.java deleted file mode 100644 index 6565afc0de3..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/responses/Code200Response.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefsmammal.post.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakerefsmammal.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.Mammal1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/responses/FakerefsmammalPostCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/responses/FakerefsmammalPostCode200Response.java new file mode 100644 index 00000000000..7818cef0191 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsmammal/post/responses/FakerefsmammalPostCode200Response.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakerefsmammal.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakerefsmammal.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakerefsmammalPostCode200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.Mammal1Boxed body) implements SealedResponseBody { } + + public static class FakerefsmammalPostCode200Response1 extends ResponseDeserializer { + public FakerefsmammalPostCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/FakerefsnumberPost.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/FakerefsnumberPost.java new file mode 100644 index 00000000000..1d1a42bd13b --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/FakerefsnumberPost.java @@ -0,0 +1,152 @@ +package org.openapijsonschematools.client.paths.fakerefsnumber; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.fakerefsnumber.post.FakerefsnumberPostRequestBody; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakerefsnumber.post.FakerefsnumberPostResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Fakerefsnumber; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakerefsnumberPost { + private static class PostProvider { + private static final String method = "post"; + + public static FakerefsnumberPostResponses.EndpointResponse post( + PostRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + @Nullable SerializedRequestBody serializedRequestBody; + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + if (request.requestBody != null) { + serializedRequestBody = new FakerefsnumberPostRequestBody.FakerefsnumberPostRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + bodyPublisher = serializedRequestBody.bodyPublisher; + } + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakerefsnumber.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakerefsnumberPostResponses.FakerefsnumberPostResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PostOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakerefsnumberPostResponses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface NumberWithValidationsOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakerefsnumberPostResponses.EndpointResponse numberWithValidations(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Post extends ApiClient implements PostOperation { + public Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PostRequest { + public FakerefsnumberPostRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForRequestBody { + PostRequest getInstance(); + T getBuilderAfterRequestBody(PostRequest instance); + default T requestBody(FakerefsnumberPostRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public interface SetterForServerIndex { + PostRequest getInstance(); + T getBuilderAfterServerIndex(PostRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PostRequest getInstance(); + T getBuilderAfterTimeout(PostRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class PostRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { + private final PostRequest instance; + + public PostRequestBuilder() { + this.instance = new PostRequest(); + } + + public PostRequest build() { + return instance; + } + + public PostRequest getInstance() { + return instance; + } + + public PostRequestBuilder getBuilderAfterRequestBody(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterServerIndex(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterTimeout(PostRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/Post.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/Post.java deleted file mode 100644 index 1eaba218885..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/Post.java +++ /dev/null @@ -1,143 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefsnumber; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.fakerefsnumber.post.RequestBody; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakerefsnumber.post.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Fakerefsnumber; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Post { - private static class PostProvider { - private static final String method = "post"; - - public static Responses.EndpointResponse post( - PostRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - @Nullable SerializedRequestBody serializedRequestBody; - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - if (request.requestBody != null) { - serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - bodyPublisher = serializedRequestBody.bodyPublisher; - } - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakerefsnumber.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PostOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Post1 extends ApiClient implements PostOperation { - public Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PostRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForRequestBody { - PostRequest getInstance(); - T getBuilderAfterRequestBody(PostRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public interface SetterForServerIndex { - PostRequest getInstance(); - T getBuilderAfterServerIndex(PostRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PostRequest getInstance(); - T getBuilderAfterTimeout(PostRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class PostRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { - private final PostRequest instance; - - public PostRequestBuilder() { - this.instance = new PostRequest(); - } - - public PostRequest build() { - return instance; - } - - public PostRequest getInstance() { - return instance; - } - - public PostRequestBuilder getBuilderAfterRequestBody(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterServerIndex(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterTimeout(PostRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/FakerefsnumberPostRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/FakerefsnumberPostRequestBody.java new file mode 100644 index 00000000000..f4b6ef9e729 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/FakerefsnumberPostRequestBody.java @@ -0,0 +1,53 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.fakerefsnumber.post; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakerefsnumber.post.requestbody.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class FakerefsnumberPostRequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class FakerefsnumberPostRequestBody1 extends RequestBodySerializer { + public FakerefsnumberPostRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ), + false + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } + } + + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.NumberWithValidations1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "application/json"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/FakerefsnumberPostResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/FakerefsnumberPostResponses.java new file mode 100644 index 00000000000..b8ca69723bb --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/FakerefsnumberPostResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakerefsnumber.post; + +import org.openapijsonschematools.client.paths.fakerefsnumber.post.responses.FakerefsnumberPostCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakerefsnumberPostResponses { + public sealed interface EndpointResponse permits EndpointFakerefsnumberPostCode200Response {} + + public record EndpointFakerefsnumberPostCode200Response( + HttpResponse response, + FakerefsnumberPostCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakerefsnumberPostCode200ResponseDeserializer {} + + public static final class StatusFakerefsnumberPostCode200ResponseDeserializer extends FakerefsnumberPostCode200Response.FakerefsnumberPostCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakerefsnumberPostResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakerefsnumberPostResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakerefsnumberPostCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakerefsnumberPostCode200ResponseDeserializer castDeserializer = (StatusFakerefsnumberPostCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakerefsnumberPostCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/RequestBody.java deleted file mode 100644 index 8494dd01aaa..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/RequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.fakerefsnumber.post; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakerefsnumber.post.requestbody.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ), - false - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } - } - - public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} - public record ApplicationjsonRequestBody(ApplicationjsonSchema.NumberWithValidations1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "application/json"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/Responses.java deleted file mode 100644 index 64721d3dfb9..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefsnumber.post; - -import org.openapijsonschematools.client.paths.fakerefsnumber.post.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/responses/Code200Response.java deleted file mode 100644 index 9e8e93aca7f..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/responses/Code200Response.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefsnumber.post.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakerefsnumber.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.NumberWithValidations1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/responses/FakerefsnumberPostCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/responses/FakerefsnumberPostCode200Response.java new file mode 100644 index 00000000000..0a439671493 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsnumber/post/responses/FakerefsnumberPostCode200Response.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakerefsnumber.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakerefsnumber.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakerefsnumberPostCode200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.NumberWithValidations1Boxed body) implements SealedResponseBody { } + + public static class FakerefsnumberPostCode200Response1 extends ResponseDeserializer { + public FakerefsnumberPostCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/FakerefsobjectmodelwithrefpropsPost.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/FakerefsobjectmodelwithrefpropsPost.java new file mode 100644 index 00000000000..a0d92eb73a6 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/FakerefsobjectmodelwithrefpropsPost.java @@ -0,0 +1,152 @@ +package org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post.FakerefsobjectmodelwithrefpropsPostRequestBody; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post.FakerefsobjectmodelwithrefpropsPostResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Fakerefsobjectmodelwithrefprops; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakerefsobjectmodelwithrefpropsPost { + private static class PostProvider { + private static final String method = "post"; + + public static FakerefsobjectmodelwithrefpropsPostResponses.EndpointResponse post( + PostRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + @Nullable SerializedRequestBody serializedRequestBody; + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + if (request.requestBody != null) { + serializedRequestBody = new FakerefsobjectmodelwithrefpropsPostRequestBody.FakerefsobjectmodelwithrefpropsPostRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + bodyPublisher = serializedRequestBody.bodyPublisher; + } + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakerefsobjectmodelwithrefprops.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakerefsobjectmodelwithrefpropsPostResponses.FakerefsobjectmodelwithrefpropsPostResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PostOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakerefsobjectmodelwithrefpropsPostResponses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface ObjectModelWithRefPropsOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakerefsobjectmodelwithrefpropsPostResponses.EndpointResponse objectModelWithRefProps(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Post extends ApiClient implements PostOperation { + public Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PostRequest { + public FakerefsobjectmodelwithrefpropsPostRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForRequestBody { + PostRequest getInstance(); + T getBuilderAfterRequestBody(PostRequest instance); + default T requestBody(FakerefsobjectmodelwithrefpropsPostRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public interface SetterForServerIndex { + PostRequest getInstance(); + T getBuilderAfterServerIndex(PostRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PostRequest getInstance(); + T getBuilderAfterTimeout(PostRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class PostRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { + private final PostRequest instance; + + public PostRequestBuilder() { + this.instance = new PostRequest(); + } + + public PostRequest build() { + return instance; + } + + public PostRequest getInstance() { + return instance; + } + + public PostRequestBuilder getBuilderAfterRequestBody(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterServerIndex(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterTimeout(PostRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/Post.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/Post.java deleted file mode 100644 index a8a554dc678..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/Post.java +++ /dev/null @@ -1,143 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post.RequestBody; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Fakerefsobjectmodelwithrefprops; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Post { - private static class PostProvider { - private static final String method = "post"; - - public static Responses.EndpointResponse post( - PostRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - @Nullable SerializedRequestBody serializedRequestBody; - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - if (request.requestBody != null) { - serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - bodyPublisher = serializedRequestBody.bodyPublisher; - } - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakerefsobjectmodelwithrefprops.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PostOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Post1 extends ApiClient implements PostOperation { - public Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PostRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForRequestBody { - PostRequest getInstance(); - T getBuilderAfterRequestBody(PostRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public interface SetterForServerIndex { - PostRequest getInstance(); - T getBuilderAfterServerIndex(PostRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PostRequest getInstance(); - T getBuilderAfterTimeout(PostRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class PostRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { - private final PostRequest instance; - - public PostRequestBuilder() { - this.instance = new PostRequest(); - } - - public PostRequest build() { - return instance; - } - - public PostRequest getInstance() { - return instance; - } - - public PostRequestBuilder getBuilderAfterRequestBody(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterServerIndex(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterTimeout(PostRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/FakerefsobjectmodelwithrefpropsPostRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/FakerefsobjectmodelwithrefpropsPostRequestBody.java new file mode 100644 index 00000000000..2905d77e4fd --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/FakerefsobjectmodelwithrefpropsPostRequestBody.java @@ -0,0 +1,53 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post.requestbody.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class FakerefsobjectmodelwithrefpropsPostRequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class FakerefsobjectmodelwithrefpropsPostRequestBody1 extends RequestBodySerializer { + public FakerefsobjectmodelwithrefpropsPostRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ), + false + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } + } + + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.ObjectModelWithRefProps1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "application/json"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/FakerefsobjectmodelwithrefpropsPostResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/FakerefsobjectmodelwithrefpropsPostResponses.java new file mode 100644 index 00000000000..002b379bf62 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/FakerefsobjectmodelwithrefpropsPostResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post; + +import org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post.responses.FakerefsobjectmodelwithrefpropsPostCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakerefsobjectmodelwithrefpropsPostResponses { + public sealed interface EndpointResponse permits EndpointFakerefsobjectmodelwithrefpropsPostCode200Response {} + + public record EndpointFakerefsobjectmodelwithrefpropsPostCode200Response( + HttpResponse response, + FakerefsobjectmodelwithrefpropsPostCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakerefsobjectmodelwithrefpropsPostCode200ResponseDeserializer {} + + public static final class StatusFakerefsobjectmodelwithrefpropsPostCode200ResponseDeserializer extends FakerefsobjectmodelwithrefpropsPostCode200Response.FakerefsobjectmodelwithrefpropsPostCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakerefsobjectmodelwithrefpropsPostResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakerefsobjectmodelwithrefpropsPostResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakerefsobjectmodelwithrefpropsPostCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakerefsobjectmodelwithrefpropsPostCode200ResponseDeserializer castDeserializer = (StatusFakerefsobjectmodelwithrefpropsPostCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakerefsobjectmodelwithrefpropsPostCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/RequestBody.java deleted file mode 100644 index 36aacc1eb10..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/RequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post.requestbody.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ), - false - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } - } - - public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} - public record ApplicationjsonRequestBody(ApplicationjsonSchema.ObjectModelWithRefProps1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "application/json"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/Responses.java deleted file mode 100644 index cf4c1d15769..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post; - -import org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/responses/Code200Response.java deleted file mode 100644 index a2b03d8a56d..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/responses/Code200Response.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.ObjectModelWithRefProps1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/responses/FakerefsobjectmodelwithrefpropsPostCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/responses/FakerefsobjectmodelwithrefpropsPostCode200Response.java new file mode 100644 index 00000000000..5a7bacf97cc --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsobjectmodelwithrefprops/post/responses/FakerefsobjectmodelwithrefpropsPostCode200Response.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakerefsobjectmodelwithrefprops.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakerefsobjectmodelwithrefpropsPostCode200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.ObjectModelWithRefProps1Boxed body) implements SealedResponseBody { } + + public static class FakerefsobjectmodelwithrefpropsPostCode200Response1 extends ResponseDeserializer { + public FakerefsobjectmodelwithrefpropsPostCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/FakerefsstringPost.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/FakerefsstringPost.java new file mode 100644 index 00000000000..adc7818a1fa --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/FakerefsstringPost.java @@ -0,0 +1,152 @@ +package org.openapijsonschematools.client.paths.fakerefsstring; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.fakerefsstring.post.FakerefsstringPostRequestBody; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakerefsstring.post.FakerefsstringPostResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Fakerefsstring; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakerefsstringPost { + private static class PostProvider { + private static final String method = "post"; + + public static FakerefsstringPostResponses.EndpointResponse post( + PostRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + @Nullable SerializedRequestBody serializedRequestBody; + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + if (request.requestBody != null) { + serializedRequestBody = new FakerefsstringPostRequestBody.FakerefsstringPostRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + bodyPublisher = serializedRequestBody.bodyPublisher; + } + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakerefsstring.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakerefsstringPostResponses.FakerefsstringPostResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PostOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakerefsstringPostResponses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface ModelStringOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakerefsstringPostResponses.EndpointResponse modelString(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Post extends ApiClient implements PostOperation { + public Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PostRequest { + public FakerefsstringPostRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForRequestBody { + PostRequest getInstance(); + T getBuilderAfterRequestBody(PostRequest instance); + default T requestBody(FakerefsstringPostRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public interface SetterForServerIndex { + PostRequest getInstance(); + T getBuilderAfterServerIndex(PostRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PostRequest getInstance(); + T getBuilderAfterTimeout(PostRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class PostRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { + private final PostRequest instance; + + public PostRequestBuilder() { + this.instance = new PostRequest(); + } + + public PostRequest build() { + return instance; + } + + public PostRequest getInstance() { + return instance; + } + + public PostRequestBuilder getBuilderAfterRequestBody(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterServerIndex(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterTimeout(PostRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/Post.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/Post.java deleted file mode 100644 index c2b331a1125..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/Post.java +++ /dev/null @@ -1,143 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefsstring; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.fakerefsstring.post.RequestBody; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakerefsstring.post.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Fakerefsstring; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Post { - private static class PostProvider { - private static final String method = "post"; - - public static Responses.EndpointResponse post( - PostRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - @Nullable SerializedRequestBody serializedRequestBody; - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - if (request.requestBody != null) { - serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - bodyPublisher = serializedRequestBody.bodyPublisher; - } - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakerefsstring.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PostOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Post1 extends ApiClient implements PostOperation { - public Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PostRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForRequestBody { - PostRequest getInstance(); - T getBuilderAfterRequestBody(PostRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public interface SetterForServerIndex { - PostRequest getInstance(); - T getBuilderAfterServerIndex(PostRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PostRequest getInstance(); - T getBuilderAfterTimeout(PostRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class PostRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { - private final PostRequest instance; - - public PostRequestBuilder() { - this.instance = new PostRequest(); - } - - public PostRequest build() { - return instance; - } - - public PostRequest getInstance() { - return instance; - } - - public PostRequestBuilder getBuilderAfterRequestBody(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterServerIndex(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterTimeout(PostRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/FakerefsstringPostRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/FakerefsstringPostRequestBody.java new file mode 100644 index 00000000000..1eff64ddf28 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/FakerefsstringPostRequestBody.java @@ -0,0 +1,53 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.fakerefsstring.post; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakerefsstring.post.requestbody.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class FakerefsstringPostRequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class FakerefsstringPostRequestBody1 extends RequestBodySerializer { + public FakerefsstringPostRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ), + false + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } + } + + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.StringJsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "application/json"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/FakerefsstringPostResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/FakerefsstringPostResponses.java new file mode 100644 index 00000000000..3617898cf51 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/FakerefsstringPostResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakerefsstring.post; + +import org.openapijsonschematools.client.paths.fakerefsstring.post.responses.FakerefsstringPostCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakerefsstringPostResponses { + public sealed interface EndpointResponse permits EndpointFakerefsstringPostCode200Response {} + + public record EndpointFakerefsstringPostCode200Response( + HttpResponse response, + FakerefsstringPostCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakerefsstringPostCode200ResponseDeserializer {} + + public static final class StatusFakerefsstringPostCode200ResponseDeserializer extends FakerefsstringPostCode200Response.FakerefsstringPostCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakerefsstringPostResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakerefsstringPostResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakerefsstringPostCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakerefsstringPostCode200ResponseDeserializer castDeserializer = (StatusFakerefsstringPostCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakerefsstringPostCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/RequestBody.java deleted file mode 100644 index 8cbfffaff80..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/RequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.fakerefsstring.post; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakerefsstring.post.requestbody.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ), - false - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } - } - - public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} - public record ApplicationjsonRequestBody(ApplicationjsonSchema.StringJsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "application/json"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/Responses.java deleted file mode 100644 index c2d043e5a24..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefsstring.post; - -import org.openapijsonschematools.client.paths.fakerefsstring.post.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/responses/Code200Response.java deleted file mode 100644 index 78842227518..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/responses/Code200Response.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakerefsstring.post.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakerefsstring.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.StringJsonSchema1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/responses/FakerefsstringPostCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/responses/FakerefsstringPostCode200Response.java new file mode 100644 index 00000000000..52adfde1ffc --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakerefsstring/post/responses/FakerefsstringPostCode200Response.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakerefsstring.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakerefsstring.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakerefsstringPostCode200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.StringJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class FakerefsstringPostCode200Response1 extends ResponseDeserializer { + public FakerefsstringPostCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeresponsewithoutschema/FakeresponsewithoutschemaGet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeresponsewithoutschema/FakeresponsewithoutschemaGet.java new file mode 100644 index 00000000000..284c2b3309e --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeresponsewithoutschema/FakeresponsewithoutschemaGet.java @@ -0,0 +1,124 @@ +package org.openapijsonschematools.client.paths.fakeresponsewithoutschema; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeresponsewithoutschema.get.FakeresponsewithoutschemaGetResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.paths.Fakeresponsewithoutschema; + +import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakeresponsewithoutschemaGet { + private static class GetProvider { + private static final String method = "get"; + + public static FakeresponsewithoutschemaGetResponses.EndpointResponse get( + GetRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakeresponsewithoutschema.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakeresponsewithoutschemaGetResponses.FakeresponsewithoutschemaGetResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface GetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakeresponsewithoutschemaGetResponses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface ResponseWithoutSchemaOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakeresponsewithoutschemaGetResponses.EndpointResponse responseWithoutSchema(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Get extends ApiClient implements GetOperation { + public Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class GetRequest { + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + GetRequest getInstance(); + T getBuilderAfterServerIndex(GetRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + GetRequest getInstance(); + T getBuilderAfterTimeout(GetRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class GetRequestBuilder implements SetterForServerIndex, SetterForTimeout { + private final GetRequest instance; + + public GetRequestBuilder() { + this.instance = new GetRequest(); + } + + public GetRequest build() { + return instance; + } + + public GetRequest getInstance() { + return instance; + } + + public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { + return this; + } + + public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeresponsewithoutschema/Get.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeresponsewithoutschema/Get.java deleted file mode 100644 index 58e670e37cc..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeresponsewithoutschema/Get.java +++ /dev/null @@ -1,115 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeresponsewithoutschema; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakeresponsewithoutschema.get.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.paths.Fakeresponsewithoutschema; - -import java.io.IOException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Get { - private static class GetProvider { - private static final String method = "get"; - - public static Responses.EndpointResponse get( - GetRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakeresponsewithoutschema.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface GetOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Get1 extends ApiClient implements GetOperation { - public Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class GetRequest { - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - GetRequest getInstance(); - T getBuilderAfterServerIndex(GetRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - GetRequest getInstance(); - T getBuilderAfterTimeout(GetRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class GetRequestBuilder implements SetterForServerIndex, SetterForTimeout { - private final GetRequest instance; - - public GetRequestBuilder() { - this.instance = new GetRequest(); - } - - public GetRequest build() { - return instance; - } - - public GetRequest getInstance() { - return instance; - } - - public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { - return this; - } - - public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeresponsewithoutschema/get/FakeresponsewithoutschemaGetResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeresponsewithoutschema/get/FakeresponsewithoutschemaGetResponses.java new file mode 100644 index 00000000000..061491da53c --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeresponsewithoutschema/get/FakeresponsewithoutschemaGetResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakeresponsewithoutschema.get; + +import org.openapijsonschematools.client.paths.fakeresponsewithoutschema.get.responses.FakeresponsewithoutschemaGetCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakeresponsewithoutschemaGetResponses { + public sealed interface EndpointResponse permits EndpointFakeresponsewithoutschemaGetCode200Response {} + + public record EndpointFakeresponsewithoutschemaGetCode200Response( + HttpResponse response, + Void body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakeresponsewithoutschemaGetCode200ResponseDeserializer {} + + public static final class StatusFakeresponsewithoutschemaGetCode200ResponseDeserializer extends FakeresponsewithoutschemaGetCode200Response.FakeresponsewithoutschemaGetCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakeresponsewithoutschemaGetResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakeresponsewithoutschemaGetResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakeresponsewithoutschemaGetCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakeresponsewithoutschemaGetCode200ResponseDeserializer castDeserializer = (StatusFakeresponsewithoutschemaGetCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakeresponsewithoutschemaGetCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeresponsewithoutschema/get/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeresponsewithoutschema/get/Responses.java deleted file mode 100644 index 829ad9e8208..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeresponsewithoutschema/get/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeresponsewithoutschema.get; - -import org.openapijsonschematools.client.paths.fakeresponsewithoutschema.get.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeresponsewithoutschema/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeresponsewithoutschema/get/responses/Code200Response.java deleted file mode 100644 index 01622b70b62..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeresponsewithoutschema/get/responses/Code200Response.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeresponsewithoutschema.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - MapUtils.makeMap( - new AbstractMap.SimpleEntry("application/json", null), - new AbstractMap.SimpleEntry("application/xml", null) - ) - ); - } - - @Override - protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { - return null; - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeresponsewithoutschema/get/responses/FakeresponsewithoutschemaGetCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeresponsewithoutschema/get/responses/FakeresponsewithoutschemaGetCode200Response.java new file mode 100644 index 00000000000..a190bfa972c --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeresponsewithoutschema/get/responses/FakeresponsewithoutschemaGetCode200Response.java @@ -0,0 +1,48 @@ +package org.openapijsonschematools.client.paths.fakeresponsewithoutschema.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakeresponsewithoutschemaGetCode200Response { + + public static class FakeresponsewithoutschemaGetCode200Response1 extends ResponseDeserializer { + public FakeresponsewithoutschemaGetCode200Response1() { + super( + MapUtils.makeMap( + new AbstractMap.SimpleEntry("application/json", null), + new AbstractMap.SimpleEntry("application/xml", null) + ) + ); + } + + @Override + protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/FaketestqueryparamtersPut.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/FaketestqueryparamtersPut.java new file mode 100644 index 00000000000..604870058a1 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/FaketestqueryparamtersPut.java @@ -0,0 +1,180 @@ +package org.openapijsonschematools.client.paths.faketestqueryparamters; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.faketestqueryparamters.put.FaketestqueryparamtersPutQueryParameters; +import org.openapijsonschematools.client.paths.faketestqueryparamters.put.Parameters; +import org.openapijsonschematools.client.paths.faketestqueryparamters.put.FaketestqueryparamtersPutResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.paths.Faketestqueryparamters; + +import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FaketestqueryparamtersPut { + private static class PutProvider { + private static final String method = "put"; + + public static FaketestqueryparamtersPutResponses.EndpointResponse put( + PutRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + + var querySerializer = new Parameters.QueryParametersSerializer(); + @Nullable Map queryMap = querySerializer.getQueryMap(request.queryParameters); + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Faketestqueryparamters.path; + if (queryMap != null) { + url = url + querySerializer.serialize(queryMap); + } + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FaketestqueryparamtersPutResponses.FaketestqueryparamtersPutResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PutOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FaketestqueryparamtersPutResponses.EndpointResponse put(PutRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PutProvider.put(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface QueryParameterCollectionFormatOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FaketestqueryparamtersPutResponses.EndpointResponse queryParameterCollectionFormat(PutRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PutProvider.put(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Put extends ApiClient implements PutOperation { + public Put(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PutRequest { + public FaketestqueryparamtersPutQueryParameters.FaketestqueryparamtersPutQueryParametersMap queryParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + + public PutRequest( + FaketestqueryparamtersPutQueryParameters.FaketestqueryparamtersPutQueryParametersMap queryParameters, + RootServerInfo.@Nullable ServerIndex serverIndex, + @Nullable Duration timeout + ) { + this.queryParameters = queryParameters; + this.serverIndex = serverIndex; + this.timeout = timeout; + } + } + + public static class PutNullableRequest { + public FaketestqueryparamtersPutQueryParameters.@Nullable FaketestqueryparamtersPutQueryParametersMap queryParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + PutNullableRequest getInstance(); + T getBuilderAfterServerIndex(PutNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PutNullableRequest getInstance(); + T getBuilderAfterTimeout(PutNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForQueryParameters { + PutNullableRequest getInstance(); + T getBuilderAfterQueryParameters(PutNullableRequest instance); + default T queryParameters(FaketestqueryparamtersPutQueryParameters.FaketestqueryparamtersPutQueryParametersMap queryParameters) { + var instance = getInstance(); + instance.queryParameters = queryParameters; + return getBuilderAfterQueryParameters(instance); + } + } + + public static class Put0RequestBuilder implements SetterForServerIndex, SetterForTimeout { + private final PutNullableRequest instance; + + public Put0RequestBuilder(PutNullableRequest instance) { + this.instance = instance; + } + + public PutRequest build() { + var queryParameters = instance.queryParameters; + if (queryParameters == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new PutRequest( + queryParameters, + instance.serverIndex, + instance.timeout + ); + } + + public PutNullableRequest getInstance() { + return instance; + } + + public Put0RequestBuilder getBuilderAfterServerIndex(PutNullableRequest instance) { + return this; + } + + public Put0RequestBuilder getBuilderAfterTimeout(PutNullableRequest instance) { + return this; + } + } + public static class PutRequestBuilder implements SetterForQueryParameters { + private final PutNullableRequest instance; + + public PutRequestBuilder() { + this.instance = new PutNullableRequest(); + } + + public PutNullableRequest getInstance() { + return instance; + } + + public Put0RequestBuilder getBuilderAfterQueryParameters(PutNullableRequest instance) { + return new Put0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/Put.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/Put.java deleted file mode 100644 index 98a0fd0f5e2..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/Put.java +++ /dev/null @@ -1,171 +0,0 @@ -package org.openapijsonschematools.client.paths.faketestqueryparamters; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.faketestqueryparamters.put.QueryParameters; -import org.openapijsonschematools.client.paths.faketestqueryparamters.put.Parameters; -import org.openapijsonschematools.client.paths.faketestqueryparamters.put.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.paths.Faketestqueryparamters; - -import java.io.IOException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Put { - private static class PutProvider { - private static final String method = "put"; - - public static Responses.EndpointResponse put( - PutRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - - var querySerializer = new Parameters.QueryParametersSerializer(); - @Nullable Map queryMap = querySerializer.getQueryMap(request.queryParameters); - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Faketestqueryparamters.path; - if (queryMap != null) { - url = url + querySerializer.serialize(queryMap); - } - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PutOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse put(PutRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PutProvider.put(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Put1 extends ApiClient implements PutOperation { - public Put1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PutRequest { - public QueryParameters.QueryParametersMap queryParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - - public PutRequest( - QueryParameters.QueryParametersMap queryParameters, - RootServerInfo.@Nullable ServerIndex serverIndex, - @Nullable Duration timeout - ) { - this.queryParameters = queryParameters; - this.serverIndex = serverIndex; - this.timeout = timeout; - } - } - - public static class PutNullableRequest { - public QueryParameters.@Nullable QueryParametersMap queryParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - PutNullableRequest getInstance(); - T getBuilderAfterServerIndex(PutNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PutNullableRequest getInstance(); - T getBuilderAfterTimeout(PutNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForQueryParameters { - PutNullableRequest getInstance(); - T getBuilderAfterQueryParameters(PutNullableRequest instance); - default T queryParameters(QueryParameters.QueryParametersMap queryParameters) { - var instance = getInstance(); - instance.queryParameters = queryParameters; - return getBuilderAfterQueryParameters(instance); - } - } - - public static class Put0RequestBuilder implements SetterForServerIndex, SetterForTimeout { - private final PutNullableRequest instance; - - public Put0RequestBuilder(PutNullableRequest instance) { - this.instance = instance; - } - - public PutRequest build() { - var queryParameters = instance.queryParameters; - if (queryParameters == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new PutRequest( - queryParameters, - instance.serverIndex, - instance.timeout - ); - } - - public PutNullableRequest getInstance() { - return instance; - } - - public Put0RequestBuilder getBuilderAfterServerIndex(PutNullableRequest instance) { - return this; - } - - public Put0RequestBuilder getBuilderAfterTimeout(PutNullableRequest instance) { - return this; - } - } - public static class PutRequestBuilder implements SetterForQueryParameters { - private final PutNullableRequest instance; - - public PutRequestBuilder() { - this.instance = new PutNullableRequest(); - } - - public PutNullableRequest getInstance() { - return instance; - } - - public Put0RequestBuilder getBuilderAfterQueryParameters(PutNullableRequest instance) { - return new Put0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/FaketestqueryparamtersPutQueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/FaketestqueryparamtersPutQueryParameters.java new file mode 100644 index 00000000000..65ffaf0bd6d --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/FaketestqueryparamtersPutQueryParameters.java @@ -0,0 +1,1515 @@ +package org.openapijsonschematools.client.paths.faketestqueryparamters.put; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.components.schemas.StringWithValidation; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.faketestqueryparamters.put.parameters.parameter0.Schema0; +import org.openapijsonschematools.client.paths.faketestqueryparamters.put.parameters.parameter1.Schema1; +import org.openapijsonschematools.client.paths.faketestqueryparamters.put.parameters.parameter2.Schema2; +import org.openapijsonschematools.client.paths.faketestqueryparamters.put.parameters.parameter3.Schema3; +import org.openapijsonschematools.client.paths.faketestqueryparamters.put.parameters.parameter4.Schema4; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class FaketestqueryparamtersPutQueryParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class FaketestqueryparamtersPutadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable FaketestqueryparamtersPutadditionalProperties instance = null; + public static FaketestqueryparamtersPutadditionalProperties getInstance() { + if (instance == null) { + instance = new FaketestqueryparamtersPutadditionalProperties(); + } + return instance; + } + } + + + public static class FaketestqueryparamtersPutQueryParametersMap extends FrozenMap<@Nullable Object> { + protected FaketestqueryparamtersPutQueryParametersMap(FrozenMap<@Nullable Object> m) { + super(m); + } + public static final Set requiredKeys = Set.of( + "context", + "http", + "ioutil", + "pipe", + "refParam", + "url" + ); + public static final Set optionalKeys = Set.of(); + public static FaketestqueryparamtersPutQueryParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return FaketestqueryparamtersPutQueryParameters1.getInstance().validate(arg, configuration); + } + + public Schema4.SchemaList4 context() { + @Nullable Object value = get("context"); + if (!(value instanceof Schema4.SchemaList4)) { + throw new RuntimeException("Invalid value stored for context"); + } + return (Schema4.SchemaList4) value; + } + + public Schema2.SchemaList2 http() { + @Nullable Object value = get("http"); + if (!(value instanceof Schema2.SchemaList2)) { + throw new RuntimeException("Invalid value stored for http"); + } + return (Schema2.SchemaList2) value; + } + + public Schema1.SchemaList1 ioutil() { + @Nullable Object value = get("ioutil"); + if (!(value instanceof Schema1.SchemaList1)) { + throw new RuntimeException("Invalid value stored for ioutil"); + } + return (Schema1.SchemaList1) value; + } + + public Schema0.SchemaList0 pipe() { + @Nullable Object value = get("pipe"); + if (!(value instanceof Schema0.SchemaList0)) { + throw new RuntimeException("Invalid value stored for pipe"); + } + return (Schema0.SchemaList0) value; + } + + public String refParam() { + @Nullable Object value = get("refParam"); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for refParam"); + } + return (String) value; + } + + public Schema3.SchemaList3 url() { + @Nullable Object value = get("url"); + if (!(value instanceof Schema3.SchemaList3)) { + throw new RuntimeException("Invalid value stored for url"); + } + return (Schema3.SchemaList3) value; + } + } + + public interface SetterForFaketestqueryparamtersPutcontext { + Map getInstance(); + T getBuilderAfterFaketestqueryparamtersPutcontext(Map instance); + + default T context(List value) { + var instance = getInstance(); + instance.put("context", value); + return getBuilderAfterFaketestqueryparamtersPutcontext(instance); + } + } + + public interface SetterForFaketestqueryparamtersPuthttp { + Map getInstance(); + T getBuilderAfterFaketestqueryparamtersPuthttp(Map instance); + + default T http(List value) { + var instance = getInstance(); + instance.put("http", value); + return getBuilderAfterFaketestqueryparamtersPuthttp(instance); + } + } + + public interface SetterForFaketestqueryparamtersPutioutil { + Map getInstance(); + T getBuilderAfterFaketestqueryparamtersPutioutil(Map instance); + + default T ioutil(List value) { + var instance = getInstance(); + instance.put("ioutil", value); + return getBuilderAfterFaketestqueryparamtersPutioutil(instance); + } + } + + public interface SetterForFaketestqueryparamtersPutpipe { + Map getInstance(); + T getBuilderAfterFaketestqueryparamtersPutpipe(Map instance); + + default T pipe(List value) { + var instance = getInstance(); + instance.put("pipe", value); + return getBuilderAfterFaketestqueryparamtersPutpipe(instance); + } + } + + public interface SetterForFaketestqueryparamtersPutrefParam { + Map getInstance(); + T getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance); + + default T refParam(String value) { + var instance = getInstance(); + instance.put("refParam", value); + return getBuilderAfterFaketestqueryparamtersPutrefParam(instance); + } + } + + public interface SetterForFaketestqueryparamtersPuturl { + Map getInstance(); + T getBuilderAfterFaketestqueryparamtersPuturl(Map instance); + + default T url(List value) { + var instance = getInstance(); + instance.put("url", value); + return getBuilderAfterFaketestqueryparamtersPuturl(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap000000Builder implements GenericBuilder> { + private final Map instance; + private static final Set knownKeys = Set.of( + "context", + "http", + "ioutil", + "pipe", + "refParam", + "url" + ); + public Set getKnownKeys() { + return knownKeys; + } + public FaketestqueryparamtersPutQueryParametersMap000000Builder(Map instance) { + this.instance = instance; + } + public Map build() { + return instance; + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap000001Builder implements SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap000001Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000000Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap000010Builder implements SetterForFaketestqueryparamtersPutrefParam { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap000010Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000000Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap000011Builder implements SetterForFaketestqueryparamtersPutrefParam, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap000011Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000001Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000001Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap000010Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000010Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap000100Builder implements SetterForFaketestqueryparamtersPutpipe { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap000100Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000000Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap000101Builder implements SetterForFaketestqueryparamtersPutpipe, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap000101Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000001Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000001Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap000100Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000100Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap000110Builder implements SetterForFaketestqueryparamtersPutpipe, SetterForFaketestqueryparamtersPutrefParam { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap000110Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000010Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000010Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap000100Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000100Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap000111Builder implements SetterForFaketestqueryparamtersPutpipe, SetterForFaketestqueryparamtersPutrefParam, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap000111Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000011Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000011Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap000101Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000101Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap000110Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000110Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap001000Builder implements SetterForFaketestqueryparamtersPutioutil { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap001000Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000000Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap001001Builder implements SetterForFaketestqueryparamtersPutioutil, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap001001Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000001Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000001Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap001000Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap001000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap001010Builder implements SetterForFaketestqueryparamtersPutioutil, SetterForFaketestqueryparamtersPutrefParam { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap001010Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000010Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000010Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap001000Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap001000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap001011Builder implements SetterForFaketestqueryparamtersPutioutil, SetterForFaketestqueryparamtersPutrefParam, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap001011Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000011Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000011Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap001001Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap001001Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap001010Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap001010Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap001100Builder implements SetterForFaketestqueryparamtersPutioutil, SetterForFaketestqueryparamtersPutpipe { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap001100Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000100Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000100Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap001000Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap001000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap001101Builder implements SetterForFaketestqueryparamtersPutioutil, SetterForFaketestqueryparamtersPutpipe, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap001101Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000101Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000101Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap001001Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap001001Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap001100Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap001100Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap001110Builder implements SetterForFaketestqueryparamtersPutioutil, SetterForFaketestqueryparamtersPutpipe, SetterForFaketestqueryparamtersPutrefParam { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap001110Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000110Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000110Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap001010Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap001010Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap001100Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap001100Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap001111Builder implements SetterForFaketestqueryparamtersPutioutil, SetterForFaketestqueryparamtersPutpipe, SetterForFaketestqueryparamtersPutrefParam, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap001111Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000111Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000111Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap001011Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap001011Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap001101Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap001101Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap001110Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap001110Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap010000Builder implements SetterForFaketestqueryparamtersPuthttp { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap010000Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000000Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap010001Builder implements SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap010001Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000001Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000001Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap010000Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap010000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap010010Builder implements SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPutrefParam { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap010010Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000010Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000010Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap010000Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap010000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap010011Builder implements SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPutrefParam, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap010011Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000011Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000011Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap010001Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap010001Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap010010Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap010010Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap010100Builder implements SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPutpipe { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap010100Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000100Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000100Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap010000Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap010000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap010101Builder implements SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPutpipe, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap010101Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000101Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000101Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap010001Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap010001Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap010100Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap010100Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap010110Builder implements SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPutpipe, SetterForFaketestqueryparamtersPutrefParam { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap010110Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000110Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000110Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap010010Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap010010Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap010100Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap010100Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap010111Builder implements SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPutpipe, SetterForFaketestqueryparamtersPutrefParam, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap010111Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000111Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000111Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap010011Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap010011Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap010101Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap010101Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap010110Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap010110Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap011000Builder implements SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPutioutil { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap011000Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap001000Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap001000Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap010000Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap010000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap011001Builder implements SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPutioutil, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap011001Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap001001Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap001001Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap010001Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap010001Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap011000Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap011000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap011010Builder implements SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPutioutil, SetterForFaketestqueryparamtersPutrefParam { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap011010Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap001010Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap001010Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap010010Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap010010Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap011000Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap011000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap011011Builder implements SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPutioutil, SetterForFaketestqueryparamtersPutrefParam, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap011011Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap001011Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap001011Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap010011Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap010011Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap011001Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap011001Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap011010Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap011010Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap011100Builder implements SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPutioutil, SetterForFaketestqueryparamtersPutpipe { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap011100Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap001100Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap001100Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap010100Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap010100Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap011000Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap011000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap011101Builder implements SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPutioutil, SetterForFaketestqueryparamtersPutpipe, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap011101Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap001101Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap001101Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap010101Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap010101Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap011001Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap011001Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap011100Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap011100Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap011110Builder implements SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPutioutil, SetterForFaketestqueryparamtersPutpipe, SetterForFaketestqueryparamtersPutrefParam { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap011110Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap001110Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap001110Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap010110Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap010110Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap011010Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap011010Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap011100Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap011100Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap011111Builder implements SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPutioutil, SetterForFaketestqueryparamtersPutpipe, SetterForFaketestqueryparamtersPutrefParam, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap011111Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap001111Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap001111Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap010111Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap010111Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap011011Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap011011Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap011101Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap011101Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap011110Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap011110Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap100000Builder implements SetterForFaketestqueryparamtersPutcontext { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap100000Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000000Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap100001Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap100001Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000001Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000001Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap100000Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap100000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap100010Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPutrefParam { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap100010Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000010Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000010Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap100000Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap100000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap100011Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPutrefParam, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap100011Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000011Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000011Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap100001Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap100001Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap100010Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap100010Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap100100Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPutpipe { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap100100Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000100Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000100Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap100000Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap100000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap100101Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPutpipe, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap100101Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000101Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000101Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap100001Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap100001Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap100100Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap100100Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap100110Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPutpipe, SetterForFaketestqueryparamtersPutrefParam { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap100110Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000110Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000110Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap100010Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap100010Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap100100Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap100100Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap100111Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPutpipe, SetterForFaketestqueryparamtersPutrefParam, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap100111Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap000111Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap000111Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap100011Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap100011Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap100101Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap100101Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap100110Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap100110Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap101000Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPutioutil { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap101000Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap001000Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap001000Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap100000Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap100000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap101001Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPutioutil, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap101001Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap001001Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap001001Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap100001Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap100001Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap101000Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap101000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap101010Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPutioutil, SetterForFaketestqueryparamtersPutrefParam { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap101010Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap001010Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap001010Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap100010Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap100010Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap101000Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap101000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap101011Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPutioutil, SetterForFaketestqueryparamtersPutrefParam, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap101011Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap001011Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap001011Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap100011Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap100011Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap101001Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap101001Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap101010Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap101010Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap101100Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPutioutil, SetterForFaketestqueryparamtersPutpipe { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap101100Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap001100Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap001100Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap100100Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap100100Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap101000Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap101000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap101101Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPutioutil, SetterForFaketestqueryparamtersPutpipe, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap101101Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap001101Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap001101Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap100101Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap100101Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap101001Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap101001Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap101100Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap101100Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap101110Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPutioutil, SetterForFaketestqueryparamtersPutpipe, SetterForFaketestqueryparamtersPutrefParam { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap101110Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap001110Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap001110Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap100110Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap100110Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap101010Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap101010Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap101100Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap101100Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap101111Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPutioutil, SetterForFaketestqueryparamtersPutpipe, SetterForFaketestqueryparamtersPutrefParam, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap101111Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap001111Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap001111Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap100111Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap100111Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap101011Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap101011Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap101101Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap101101Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap101110Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap101110Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap110000Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPuthttp { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap110000Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap010000Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap010000Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap100000Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap100000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap110001Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap110001Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap010001Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap010001Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap100001Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap100001Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap110000Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap110000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap110010Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPutrefParam { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap110010Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap010010Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap010010Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap100010Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap100010Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap110000Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap110000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap110011Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPutrefParam, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap110011Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap010011Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap010011Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap100011Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap100011Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap110001Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap110001Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap110010Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap110010Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap110100Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPutpipe { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap110100Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap010100Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap010100Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap100100Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap100100Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap110000Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap110000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap110101Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPutpipe, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap110101Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap010101Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap010101Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap100101Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap100101Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap110001Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap110001Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap110100Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap110100Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap110110Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPutpipe, SetterForFaketestqueryparamtersPutrefParam { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap110110Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap010110Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap010110Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap100110Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap100110Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap110010Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap110010Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap110100Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap110100Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap110111Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPutpipe, SetterForFaketestqueryparamtersPutrefParam, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap110111Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap010111Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap010111Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap100111Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap100111Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap110011Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap110011Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap110101Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap110101Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap110110Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap110110Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap111000Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPutioutil { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap111000Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap011000Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap011000Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap101000Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap101000Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap110000Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap110000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap111001Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPutioutil, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap111001Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap011001Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap011001Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap101001Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap101001Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap110001Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap110001Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap111000Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap111000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap111010Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPutioutil, SetterForFaketestqueryparamtersPutrefParam { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap111010Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap011010Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap011010Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap101010Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap101010Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap110010Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap110010Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap111000Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap111000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap111011Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPutioutil, SetterForFaketestqueryparamtersPutrefParam, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap111011Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap011011Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap011011Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap101011Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap101011Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap110011Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap110011Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap111001Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap111001Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap111010Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap111010Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap111100Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPutioutil, SetterForFaketestqueryparamtersPutpipe { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap111100Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap011100Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap011100Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap101100Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap101100Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap110100Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap110100Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap111000Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap111000Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap111101Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPutioutil, SetterForFaketestqueryparamtersPutpipe, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap111101Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap011101Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap011101Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap101101Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap101101Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap110101Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap110101Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap111001Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap111001Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap111100Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap111100Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMap111110Builder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPutioutil, SetterForFaketestqueryparamtersPutpipe, SetterForFaketestqueryparamtersPutrefParam { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMap111110Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap011110Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap011110Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap101110Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap101110Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap110110Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap110110Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap111010Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap111010Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap111100Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap111100Builder(instance); + } + } + + public static class FaketestqueryparamtersPutQueryParametersMapBuilder implements SetterForFaketestqueryparamtersPutcontext, SetterForFaketestqueryparamtersPuthttp, SetterForFaketestqueryparamtersPutioutil, SetterForFaketestqueryparamtersPutpipe, SetterForFaketestqueryparamtersPutrefParam, SetterForFaketestqueryparamtersPuturl { + private final Map instance; + public FaketestqueryparamtersPutQueryParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map getInstance() { + return instance; + } + public FaketestqueryparamtersPutQueryParametersMap011111Builder getBuilderAfterFaketestqueryparamtersPutcontext(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap011111Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap101111Builder getBuilderAfterFaketestqueryparamtersPuthttp(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap101111Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap110111Builder getBuilderAfterFaketestqueryparamtersPutioutil(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap110111Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap111011Builder getBuilderAfterFaketestqueryparamtersPutpipe(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap111011Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap111101Builder getBuilderAfterFaketestqueryparamtersPutrefParam(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap111101Builder(instance); + } + public FaketestqueryparamtersPutQueryParametersMap111110Builder getBuilderAfterFaketestqueryparamtersPuturl(Map instance) { + return new FaketestqueryparamtersPutQueryParametersMap111110Builder(instance); + } + } + + + public sealed interface FaketestqueryparamtersPutQueryParameters1Boxed permits FaketestqueryparamtersPutQueryParameters1BoxedMap { + @Nullable Object getData(); + } + + public record FaketestqueryparamtersPutQueryParameters1BoxedMap(FaketestqueryparamtersPutQueryParametersMap data) implements FaketestqueryparamtersPutQueryParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class FaketestqueryparamtersPutQueryParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable FaketestqueryparamtersPutQueryParameters1 instance = null; + + protected FaketestqueryparamtersPutQueryParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("refParam", StringWithValidation.StringWithValidation1.class), + new PropertyEntry("ioutil", Schema1.Schema11.class), + new PropertyEntry("context", Schema4.Schema41.class), + new PropertyEntry("http", Schema2.Schema21.class), + new PropertyEntry("pipe", Schema0.Schema01.class), + new PropertyEntry("url", Schema3.Schema31.class) + )) + .required(Set.of( + "context", + "http", + "ioutil", + "pipe", + "refParam", + "url" + )) + .additionalProperties(FaketestqueryparamtersPutadditionalProperties.class) + ); + } + + public static FaketestqueryparamtersPutQueryParameters1 getInstance() { + if (instance == null) { + instance = new FaketestqueryparamtersPutQueryParameters1(); + } + return instance; + } + + public FaketestqueryparamtersPutQueryParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + properties.put(propertyName, propertyInstance); + } + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); + return new FaketestqueryparamtersPutQueryParametersMap(castProperties); + } + + public FaketestqueryparamtersPutQueryParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public FaketestqueryparamtersPutQueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new FaketestqueryparamtersPutQueryParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public FaketestqueryparamtersPutQueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/FaketestqueryparamtersPutResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/FaketestqueryparamtersPutResponses.java new file mode 100644 index 00000000000..ed5c4a6f030 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/FaketestqueryparamtersPutResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.faketestqueryparamters.put; + +import org.openapijsonschematools.client.paths.faketestqueryparamters.put.responses.FaketestqueryparamtersPutCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FaketestqueryparamtersPutResponses { + public sealed interface EndpointResponse permits EndpointFaketestqueryparamtersPutCode200Response {} + + public record EndpointFaketestqueryparamtersPutCode200Response( + HttpResponse response, + Void body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFaketestqueryparamtersPutCode200ResponseDeserializer {} + + public static final class StatusFaketestqueryparamtersPutCode200ResponseDeserializer extends FaketestqueryparamtersPutCode200Response.FaketestqueryparamtersPutCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FaketestqueryparamtersPutResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FaketestqueryparamtersPutResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFaketestqueryparamtersPutCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFaketestqueryparamtersPutCode200ResponseDeserializer castDeserializer = (StatusFaketestqueryparamtersPutCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFaketestqueryparamtersPutCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/QueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/QueryParameters.java deleted file mode 100644 index 9b3a467ef31..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/QueryParameters.java +++ /dev/null @@ -1,1515 +0,0 @@ -package org.openapijsonschematools.client.paths.faketestqueryparamters.put; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.components.schemas.StringWithValidation; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.faketestqueryparamters.put.parameters.parameter0.Schema0; -import org.openapijsonschematools.client.paths.faketestqueryparamters.put.parameters.parameter1.Schema1; -import org.openapijsonschematools.client.paths.faketestqueryparamters.put.parameters.parameter2.Schema2; -import org.openapijsonschematools.client.paths.faketestqueryparamters.put.parameters.parameter3.Schema3; -import org.openapijsonschematools.client.paths.faketestqueryparamters.put.parameters.parameter4.Schema4; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class QueryParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class QueryParametersMap extends FrozenMap<@Nullable Object> { - protected QueryParametersMap(FrozenMap<@Nullable Object> m) { - super(m); - } - public static final Set requiredKeys = Set.of( - "context", - "http", - "ioutil", - "pipe", - "refParam", - "url" - ); - public static final Set optionalKeys = Set.of(); - public static QueryParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return QueryParameters1.getInstance().validate(arg, configuration); - } - - public Schema4.SchemaList4 context() { - @Nullable Object value = get("context"); - if (!(value instanceof Schema4.SchemaList4)) { - throw new RuntimeException("Invalid value stored for context"); - } - return (Schema4.SchemaList4) value; - } - - public Schema2.SchemaList2 http() { - @Nullable Object value = get("http"); - if (!(value instanceof Schema2.SchemaList2)) { - throw new RuntimeException("Invalid value stored for http"); - } - return (Schema2.SchemaList2) value; - } - - public Schema1.SchemaList1 ioutil() { - @Nullable Object value = get("ioutil"); - if (!(value instanceof Schema1.SchemaList1)) { - throw new RuntimeException("Invalid value stored for ioutil"); - } - return (Schema1.SchemaList1) value; - } - - public Schema0.SchemaList0 pipe() { - @Nullable Object value = get("pipe"); - if (!(value instanceof Schema0.SchemaList0)) { - throw new RuntimeException("Invalid value stored for pipe"); - } - return (Schema0.SchemaList0) value; - } - - public String refParam() { - @Nullable Object value = get("refParam"); - if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for refParam"); - } - return (String) value; - } - - public Schema3.SchemaList3 url() { - @Nullable Object value = get("url"); - if (!(value instanceof Schema3.SchemaList3)) { - throw new RuntimeException("Invalid value stored for url"); - } - return (Schema3.SchemaList3) value; - } - } - - public interface SetterForContext { - Map getInstance(); - T getBuilderAfterContext(Map instance); - - default T context(List value) { - var instance = getInstance(); - instance.put("context", value); - return getBuilderAfterContext(instance); - } - } - - public interface SetterForHttp { - Map getInstance(); - T getBuilderAfterHttp(Map instance); - - default T http(List value) { - var instance = getInstance(); - instance.put("http", value); - return getBuilderAfterHttp(instance); - } - } - - public interface SetterForIoutil { - Map getInstance(); - T getBuilderAfterIoutil(Map instance); - - default T ioutil(List value) { - var instance = getInstance(); - instance.put("ioutil", value); - return getBuilderAfterIoutil(instance); - } - } - - public interface SetterForPipe { - Map getInstance(); - T getBuilderAfterPipe(Map instance); - - default T pipe(List value) { - var instance = getInstance(); - instance.put("pipe", value); - return getBuilderAfterPipe(instance); - } - } - - public interface SetterForRefParam { - Map getInstance(); - T getBuilderAfterRefParam(Map instance); - - default T refParam(String value) { - var instance = getInstance(); - instance.put("refParam", value); - return getBuilderAfterRefParam(instance); - } - } - - public interface SetterForUrl { - Map getInstance(); - T getBuilderAfterUrl(Map instance); - - default T url(List value) { - var instance = getInstance(); - instance.put("url", value); - return getBuilderAfterUrl(instance); - } - } - - public static class QueryParametersMap000000Builder implements GenericBuilder> { - private final Map instance; - private static final Set knownKeys = Set.of( - "context", - "http", - "ioutil", - "pipe", - "refParam", - "url" - ); - public Set getKnownKeys() { - return knownKeys; - } - public QueryParametersMap000000Builder(Map instance) { - this.instance = instance; - } - public Map build() { - return instance; - } - } - - public static class QueryParametersMap000001Builder implements SetterForUrl { - private final Map instance; - public QueryParametersMap000001Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000000Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap000000Builder(instance); - } - } - - public static class QueryParametersMap000010Builder implements SetterForRefParam { - private final Map instance; - public QueryParametersMap000010Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000000Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap000000Builder(instance); - } - } - - public static class QueryParametersMap000011Builder implements SetterForRefParam, SetterForUrl { - private final Map instance; - public QueryParametersMap000011Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000001Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap000001Builder(instance); - } - public QueryParametersMap000010Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap000010Builder(instance); - } - } - - public static class QueryParametersMap000100Builder implements SetterForPipe { - private final Map instance; - public QueryParametersMap000100Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000000Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap000000Builder(instance); - } - } - - public static class QueryParametersMap000101Builder implements SetterForPipe, SetterForUrl { - private final Map instance; - public QueryParametersMap000101Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000001Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap000001Builder(instance); - } - public QueryParametersMap000100Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap000100Builder(instance); - } - } - - public static class QueryParametersMap000110Builder implements SetterForPipe, SetterForRefParam { - private final Map instance; - public QueryParametersMap000110Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000010Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap000010Builder(instance); - } - public QueryParametersMap000100Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap000100Builder(instance); - } - } - - public static class QueryParametersMap000111Builder implements SetterForPipe, SetterForRefParam, SetterForUrl { - private final Map instance; - public QueryParametersMap000111Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000011Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap000011Builder(instance); - } - public QueryParametersMap000101Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap000101Builder(instance); - } - public QueryParametersMap000110Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap000110Builder(instance); - } - } - - public static class QueryParametersMap001000Builder implements SetterForIoutil { - private final Map instance; - public QueryParametersMap001000Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000000Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap000000Builder(instance); - } - } - - public static class QueryParametersMap001001Builder implements SetterForIoutil, SetterForUrl { - private final Map instance; - public QueryParametersMap001001Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000001Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap000001Builder(instance); - } - public QueryParametersMap001000Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap001000Builder(instance); - } - } - - public static class QueryParametersMap001010Builder implements SetterForIoutil, SetterForRefParam { - private final Map instance; - public QueryParametersMap001010Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000010Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap000010Builder(instance); - } - public QueryParametersMap001000Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap001000Builder(instance); - } - } - - public static class QueryParametersMap001011Builder implements SetterForIoutil, SetterForRefParam, SetterForUrl { - private final Map instance; - public QueryParametersMap001011Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000011Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap000011Builder(instance); - } - public QueryParametersMap001001Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap001001Builder(instance); - } - public QueryParametersMap001010Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap001010Builder(instance); - } - } - - public static class QueryParametersMap001100Builder implements SetterForIoutil, SetterForPipe { - private final Map instance; - public QueryParametersMap001100Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000100Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap000100Builder(instance); - } - public QueryParametersMap001000Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap001000Builder(instance); - } - } - - public static class QueryParametersMap001101Builder implements SetterForIoutil, SetterForPipe, SetterForUrl { - private final Map instance; - public QueryParametersMap001101Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000101Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap000101Builder(instance); - } - public QueryParametersMap001001Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap001001Builder(instance); - } - public QueryParametersMap001100Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap001100Builder(instance); - } - } - - public static class QueryParametersMap001110Builder implements SetterForIoutil, SetterForPipe, SetterForRefParam { - private final Map instance; - public QueryParametersMap001110Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000110Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap000110Builder(instance); - } - public QueryParametersMap001010Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap001010Builder(instance); - } - public QueryParametersMap001100Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap001100Builder(instance); - } - } - - public static class QueryParametersMap001111Builder implements SetterForIoutil, SetterForPipe, SetterForRefParam, SetterForUrl { - private final Map instance; - public QueryParametersMap001111Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000111Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap000111Builder(instance); - } - public QueryParametersMap001011Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap001011Builder(instance); - } - public QueryParametersMap001101Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap001101Builder(instance); - } - public QueryParametersMap001110Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap001110Builder(instance); - } - } - - public static class QueryParametersMap010000Builder implements SetterForHttp { - private final Map instance; - public QueryParametersMap010000Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000000Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap000000Builder(instance); - } - } - - public static class QueryParametersMap010001Builder implements SetterForHttp, SetterForUrl { - private final Map instance; - public QueryParametersMap010001Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000001Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap000001Builder(instance); - } - public QueryParametersMap010000Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap010000Builder(instance); - } - } - - public static class QueryParametersMap010010Builder implements SetterForHttp, SetterForRefParam { - private final Map instance; - public QueryParametersMap010010Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000010Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap000010Builder(instance); - } - public QueryParametersMap010000Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap010000Builder(instance); - } - } - - public static class QueryParametersMap010011Builder implements SetterForHttp, SetterForRefParam, SetterForUrl { - private final Map instance; - public QueryParametersMap010011Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000011Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap000011Builder(instance); - } - public QueryParametersMap010001Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap010001Builder(instance); - } - public QueryParametersMap010010Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap010010Builder(instance); - } - } - - public static class QueryParametersMap010100Builder implements SetterForHttp, SetterForPipe { - private final Map instance; - public QueryParametersMap010100Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000100Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap000100Builder(instance); - } - public QueryParametersMap010000Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap010000Builder(instance); - } - } - - public static class QueryParametersMap010101Builder implements SetterForHttp, SetterForPipe, SetterForUrl { - private final Map instance; - public QueryParametersMap010101Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000101Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap000101Builder(instance); - } - public QueryParametersMap010001Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap010001Builder(instance); - } - public QueryParametersMap010100Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap010100Builder(instance); - } - } - - public static class QueryParametersMap010110Builder implements SetterForHttp, SetterForPipe, SetterForRefParam { - private final Map instance; - public QueryParametersMap010110Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000110Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap000110Builder(instance); - } - public QueryParametersMap010010Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap010010Builder(instance); - } - public QueryParametersMap010100Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap010100Builder(instance); - } - } - - public static class QueryParametersMap010111Builder implements SetterForHttp, SetterForPipe, SetterForRefParam, SetterForUrl { - private final Map instance; - public QueryParametersMap010111Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000111Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap000111Builder(instance); - } - public QueryParametersMap010011Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap010011Builder(instance); - } - public QueryParametersMap010101Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap010101Builder(instance); - } - public QueryParametersMap010110Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap010110Builder(instance); - } - } - - public static class QueryParametersMap011000Builder implements SetterForHttp, SetterForIoutil { - private final Map instance; - public QueryParametersMap011000Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap001000Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap001000Builder(instance); - } - public QueryParametersMap010000Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap010000Builder(instance); - } - } - - public static class QueryParametersMap011001Builder implements SetterForHttp, SetterForIoutil, SetterForUrl { - private final Map instance; - public QueryParametersMap011001Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap001001Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap001001Builder(instance); - } - public QueryParametersMap010001Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap010001Builder(instance); - } - public QueryParametersMap011000Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap011000Builder(instance); - } - } - - public static class QueryParametersMap011010Builder implements SetterForHttp, SetterForIoutil, SetterForRefParam { - private final Map instance; - public QueryParametersMap011010Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap001010Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap001010Builder(instance); - } - public QueryParametersMap010010Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap010010Builder(instance); - } - public QueryParametersMap011000Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap011000Builder(instance); - } - } - - public static class QueryParametersMap011011Builder implements SetterForHttp, SetterForIoutil, SetterForRefParam, SetterForUrl { - private final Map instance; - public QueryParametersMap011011Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap001011Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap001011Builder(instance); - } - public QueryParametersMap010011Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap010011Builder(instance); - } - public QueryParametersMap011001Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap011001Builder(instance); - } - public QueryParametersMap011010Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap011010Builder(instance); - } - } - - public static class QueryParametersMap011100Builder implements SetterForHttp, SetterForIoutil, SetterForPipe { - private final Map instance; - public QueryParametersMap011100Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap001100Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap001100Builder(instance); - } - public QueryParametersMap010100Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap010100Builder(instance); - } - public QueryParametersMap011000Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap011000Builder(instance); - } - } - - public static class QueryParametersMap011101Builder implements SetterForHttp, SetterForIoutil, SetterForPipe, SetterForUrl { - private final Map instance; - public QueryParametersMap011101Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap001101Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap001101Builder(instance); - } - public QueryParametersMap010101Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap010101Builder(instance); - } - public QueryParametersMap011001Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap011001Builder(instance); - } - public QueryParametersMap011100Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap011100Builder(instance); - } - } - - public static class QueryParametersMap011110Builder implements SetterForHttp, SetterForIoutil, SetterForPipe, SetterForRefParam { - private final Map instance; - public QueryParametersMap011110Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap001110Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap001110Builder(instance); - } - public QueryParametersMap010110Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap010110Builder(instance); - } - public QueryParametersMap011010Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap011010Builder(instance); - } - public QueryParametersMap011100Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap011100Builder(instance); - } - } - - public static class QueryParametersMap011111Builder implements SetterForHttp, SetterForIoutil, SetterForPipe, SetterForRefParam, SetterForUrl { - private final Map instance; - public QueryParametersMap011111Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap001111Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap001111Builder(instance); - } - public QueryParametersMap010111Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap010111Builder(instance); - } - public QueryParametersMap011011Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap011011Builder(instance); - } - public QueryParametersMap011101Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap011101Builder(instance); - } - public QueryParametersMap011110Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap011110Builder(instance); - } - } - - public static class QueryParametersMap100000Builder implements SetterForContext { - private final Map instance; - public QueryParametersMap100000Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000000Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap000000Builder(instance); - } - } - - public static class QueryParametersMap100001Builder implements SetterForContext, SetterForUrl { - private final Map instance; - public QueryParametersMap100001Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000001Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap000001Builder(instance); - } - public QueryParametersMap100000Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap100000Builder(instance); - } - } - - public static class QueryParametersMap100010Builder implements SetterForContext, SetterForRefParam { - private final Map instance; - public QueryParametersMap100010Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000010Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap000010Builder(instance); - } - public QueryParametersMap100000Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap100000Builder(instance); - } - } - - public static class QueryParametersMap100011Builder implements SetterForContext, SetterForRefParam, SetterForUrl { - private final Map instance; - public QueryParametersMap100011Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000011Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap000011Builder(instance); - } - public QueryParametersMap100001Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap100001Builder(instance); - } - public QueryParametersMap100010Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap100010Builder(instance); - } - } - - public static class QueryParametersMap100100Builder implements SetterForContext, SetterForPipe { - private final Map instance; - public QueryParametersMap100100Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000100Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap000100Builder(instance); - } - public QueryParametersMap100000Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap100000Builder(instance); - } - } - - public static class QueryParametersMap100101Builder implements SetterForContext, SetterForPipe, SetterForUrl { - private final Map instance; - public QueryParametersMap100101Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000101Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap000101Builder(instance); - } - public QueryParametersMap100001Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap100001Builder(instance); - } - public QueryParametersMap100100Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap100100Builder(instance); - } - } - - public static class QueryParametersMap100110Builder implements SetterForContext, SetterForPipe, SetterForRefParam { - private final Map instance; - public QueryParametersMap100110Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000110Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap000110Builder(instance); - } - public QueryParametersMap100010Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap100010Builder(instance); - } - public QueryParametersMap100100Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap100100Builder(instance); - } - } - - public static class QueryParametersMap100111Builder implements SetterForContext, SetterForPipe, SetterForRefParam, SetterForUrl { - private final Map instance; - public QueryParametersMap100111Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap000111Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap000111Builder(instance); - } - public QueryParametersMap100011Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap100011Builder(instance); - } - public QueryParametersMap100101Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap100101Builder(instance); - } - public QueryParametersMap100110Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap100110Builder(instance); - } - } - - public static class QueryParametersMap101000Builder implements SetterForContext, SetterForIoutil { - private final Map instance; - public QueryParametersMap101000Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap001000Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap001000Builder(instance); - } - public QueryParametersMap100000Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap100000Builder(instance); - } - } - - public static class QueryParametersMap101001Builder implements SetterForContext, SetterForIoutil, SetterForUrl { - private final Map instance; - public QueryParametersMap101001Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap001001Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap001001Builder(instance); - } - public QueryParametersMap100001Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap100001Builder(instance); - } - public QueryParametersMap101000Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap101000Builder(instance); - } - } - - public static class QueryParametersMap101010Builder implements SetterForContext, SetterForIoutil, SetterForRefParam { - private final Map instance; - public QueryParametersMap101010Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap001010Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap001010Builder(instance); - } - public QueryParametersMap100010Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap100010Builder(instance); - } - public QueryParametersMap101000Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap101000Builder(instance); - } - } - - public static class QueryParametersMap101011Builder implements SetterForContext, SetterForIoutil, SetterForRefParam, SetterForUrl { - private final Map instance; - public QueryParametersMap101011Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap001011Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap001011Builder(instance); - } - public QueryParametersMap100011Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap100011Builder(instance); - } - public QueryParametersMap101001Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap101001Builder(instance); - } - public QueryParametersMap101010Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap101010Builder(instance); - } - } - - public static class QueryParametersMap101100Builder implements SetterForContext, SetterForIoutil, SetterForPipe { - private final Map instance; - public QueryParametersMap101100Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap001100Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap001100Builder(instance); - } - public QueryParametersMap100100Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap100100Builder(instance); - } - public QueryParametersMap101000Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap101000Builder(instance); - } - } - - public static class QueryParametersMap101101Builder implements SetterForContext, SetterForIoutil, SetterForPipe, SetterForUrl { - private final Map instance; - public QueryParametersMap101101Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap001101Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap001101Builder(instance); - } - public QueryParametersMap100101Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap100101Builder(instance); - } - public QueryParametersMap101001Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap101001Builder(instance); - } - public QueryParametersMap101100Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap101100Builder(instance); - } - } - - public static class QueryParametersMap101110Builder implements SetterForContext, SetterForIoutil, SetterForPipe, SetterForRefParam { - private final Map instance; - public QueryParametersMap101110Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap001110Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap001110Builder(instance); - } - public QueryParametersMap100110Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap100110Builder(instance); - } - public QueryParametersMap101010Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap101010Builder(instance); - } - public QueryParametersMap101100Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap101100Builder(instance); - } - } - - public static class QueryParametersMap101111Builder implements SetterForContext, SetterForIoutil, SetterForPipe, SetterForRefParam, SetterForUrl { - private final Map instance; - public QueryParametersMap101111Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap001111Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap001111Builder(instance); - } - public QueryParametersMap100111Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap100111Builder(instance); - } - public QueryParametersMap101011Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap101011Builder(instance); - } - public QueryParametersMap101101Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap101101Builder(instance); - } - public QueryParametersMap101110Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap101110Builder(instance); - } - } - - public static class QueryParametersMap110000Builder implements SetterForContext, SetterForHttp { - private final Map instance; - public QueryParametersMap110000Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap010000Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap010000Builder(instance); - } - public QueryParametersMap100000Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap100000Builder(instance); - } - } - - public static class QueryParametersMap110001Builder implements SetterForContext, SetterForHttp, SetterForUrl { - private final Map instance; - public QueryParametersMap110001Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap010001Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap010001Builder(instance); - } - public QueryParametersMap100001Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap100001Builder(instance); - } - public QueryParametersMap110000Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap110000Builder(instance); - } - } - - public static class QueryParametersMap110010Builder implements SetterForContext, SetterForHttp, SetterForRefParam { - private final Map instance; - public QueryParametersMap110010Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap010010Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap010010Builder(instance); - } - public QueryParametersMap100010Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap100010Builder(instance); - } - public QueryParametersMap110000Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap110000Builder(instance); - } - } - - public static class QueryParametersMap110011Builder implements SetterForContext, SetterForHttp, SetterForRefParam, SetterForUrl { - private final Map instance; - public QueryParametersMap110011Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap010011Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap010011Builder(instance); - } - public QueryParametersMap100011Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap100011Builder(instance); - } - public QueryParametersMap110001Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap110001Builder(instance); - } - public QueryParametersMap110010Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap110010Builder(instance); - } - } - - public static class QueryParametersMap110100Builder implements SetterForContext, SetterForHttp, SetterForPipe { - private final Map instance; - public QueryParametersMap110100Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap010100Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap010100Builder(instance); - } - public QueryParametersMap100100Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap100100Builder(instance); - } - public QueryParametersMap110000Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap110000Builder(instance); - } - } - - public static class QueryParametersMap110101Builder implements SetterForContext, SetterForHttp, SetterForPipe, SetterForUrl { - private final Map instance; - public QueryParametersMap110101Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap010101Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap010101Builder(instance); - } - public QueryParametersMap100101Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap100101Builder(instance); - } - public QueryParametersMap110001Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap110001Builder(instance); - } - public QueryParametersMap110100Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap110100Builder(instance); - } - } - - public static class QueryParametersMap110110Builder implements SetterForContext, SetterForHttp, SetterForPipe, SetterForRefParam { - private final Map instance; - public QueryParametersMap110110Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap010110Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap010110Builder(instance); - } - public QueryParametersMap100110Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap100110Builder(instance); - } - public QueryParametersMap110010Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap110010Builder(instance); - } - public QueryParametersMap110100Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap110100Builder(instance); - } - } - - public static class QueryParametersMap110111Builder implements SetterForContext, SetterForHttp, SetterForPipe, SetterForRefParam, SetterForUrl { - private final Map instance; - public QueryParametersMap110111Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap010111Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap010111Builder(instance); - } - public QueryParametersMap100111Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap100111Builder(instance); - } - public QueryParametersMap110011Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap110011Builder(instance); - } - public QueryParametersMap110101Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap110101Builder(instance); - } - public QueryParametersMap110110Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap110110Builder(instance); - } - } - - public static class QueryParametersMap111000Builder implements SetterForContext, SetterForHttp, SetterForIoutil { - private final Map instance; - public QueryParametersMap111000Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap011000Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap011000Builder(instance); - } - public QueryParametersMap101000Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap101000Builder(instance); - } - public QueryParametersMap110000Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap110000Builder(instance); - } - } - - public static class QueryParametersMap111001Builder implements SetterForContext, SetterForHttp, SetterForIoutil, SetterForUrl { - private final Map instance; - public QueryParametersMap111001Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap011001Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap011001Builder(instance); - } - public QueryParametersMap101001Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap101001Builder(instance); - } - public QueryParametersMap110001Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap110001Builder(instance); - } - public QueryParametersMap111000Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap111000Builder(instance); - } - } - - public static class QueryParametersMap111010Builder implements SetterForContext, SetterForHttp, SetterForIoutil, SetterForRefParam { - private final Map instance; - public QueryParametersMap111010Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap011010Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap011010Builder(instance); - } - public QueryParametersMap101010Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap101010Builder(instance); - } - public QueryParametersMap110010Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap110010Builder(instance); - } - public QueryParametersMap111000Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap111000Builder(instance); - } - } - - public static class QueryParametersMap111011Builder implements SetterForContext, SetterForHttp, SetterForIoutil, SetterForRefParam, SetterForUrl { - private final Map instance; - public QueryParametersMap111011Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap011011Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap011011Builder(instance); - } - public QueryParametersMap101011Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap101011Builder(instance); - } - public QueryParametersMap110011Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap110011Builder(instance); - } - public QueryParametersMap111001Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap111001Builder(instance); - } - public QueryParametersMap111010Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap111010Builder(instance); - } - } - - public static class QueryParametersMap111100Builder implements SetterForContext, SetterForHttp, SetterForIoutil, SetterForPipe { - private final Map instance; - public QueryParametersMap111100Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap011100Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap011100Builder(instance); - } - public QueryParametersMap101100Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap101100Builder(instance); - } - public QueryParametersMap110100Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap110100Builder(instance); - } - public QueryParametersMap111000Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap111000Builder(instance); - } - } - - public static class QueryParametersMap111101Builder implements SetterForContext, SetterForHttp, SetterForIoutil, SetterForPipe, SetterForUrl { - private final Map instance; - public QueryParametersMap111101Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap011101Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap011101Builder(instance); - } - public QueryParametersMap101101Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap101101Builder(instance); - } - public QueryParametersMap110101Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap110101Builder(instance); - } - public QueryParametersMap111001Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap111001Builder(instance); - } - public QueryParametersMap111100Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap111100Builder(instance); - } - } - - public static class QueryParametersMap111110Builder implements SetterForContext, SetterForHttp, SetterForIoutil, SetterForPipe, SetterForRefParam { - private final Map instance; - public QueryParametersMap111110Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap011110Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap011110Builder(instance); - } - public QueryParametersMap101110Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap101110Builder(instance); - } - public QueryParametersMap110110Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap110110Builder(instance); - } - public QueryParametersMap111010Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap111010Builder(instance); - } - public QueryParametersMap111100Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap111100Builder(instance); - } - } - - public static class QueryParametersMapBuilder implements SetterForContext, SetterForHttp, SetterForIoutil, SetterForPipe, SetterForRefParam, SetterForUrl { - private final Map instance; - public QueryParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map getInstance() { - return instance; - } - public QueryParametersMap011111Builder getBuilderAfterContext(Map instance) { - return new QueryParametersMap011111Builder(instance); - } - public QueryParametersMap101111Builder getBuilderAfterHttp(Map instance) { - return new QueryParametersMap101111Builder(instance); - } - public QueryParametersMap110111Builder getBuilderAfterIoutil(Map instance) { - return new QueryParametersMap110111Builder(instance); - } - public QueryParametersMap111011Builder getBuilderAfterPipe(Map instance) { - return new QueryParametersMap111011Builder(instance); - } - public QueryParametersMap111101Builder getBuilderAfterRefParam(Map instance) { - return new QueryParametersMap111101Builder(instance); - } - public QueryParametersMap111110Builder getBuilderAfterUrl(Map instance) { - return new QueryParametersMap111110Builder(instance); - } - } - - - public sealed interface QueryParameters1Boxed permits QueryParameters1BoxedMap { - @Nullable Object getData(); - } - - public record QueryParameters1BoxedMap(QueryParametersMap data) implements QueryParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable QueryParameters1 instance = null; - - protected QueryParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("refParam", StringWithValidation.StringWithValidation1.class), - new PropertyEntry("ioutil", Schema1.Schema11.class), - new PropertyEntry("context", Schema4.Schema41.class), - new PropertyEntry("http", Schema2.Schema21.class), - new PropertyEntry("pipe", Schema0.Schema01.class), - new PropertyEntry("url", Schema3.Schema31.class) - )) - .required(Set.of( - "context", - "http", - "ioutil", - "pipe", - "refParam", - "url" - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static QueryParameters1 getInstance() { - if (instance == null) { - instance = new QueryParameters1(); - } - return instance; - } - - public QueryParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, propertyInstance); - } - FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); - return new QueryParametersMap(castProperties); - } - - public QueryParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public QueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new QueryParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public QueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/Responses.java deleted file mode 100644 index e24c9f4f38b..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.faketestqueryparamters.put; - -import org.openapijsonschematools.client.paths.faketestqueryparamters.put.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/responses/Code200Response.java deleted file mode 100644 index ca41d3b2624..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/responses/Code200Response.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.openapijsonschematools.client.paths.faketestqueryparamters.put.responses; - -import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; - -public class Code200Response extends SuccessDescriptionOnly { - public static class Code200Response1 extends SuccessDescriptionOnly1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/responses/FaketestqueryparamtersPutCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/responses/FaketestqueryparamtersPutCode200Response.java new file mode 100644 index 00000000000..180a1f4d934 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/faketestqueryparamters/put/responses/FaketestqueryparamtersPutCode200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.faketestqueryparamters.put.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class FaketestqueryparamtersPutCode200Response extends SuccessDescriptionOnly { + public static class FaketestqueryparamtersPutCode200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/FakeuploaddownloadfilePost.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/FakeuploaddownloadfilePost.java new file mode 100644 index 00000000000..40b05b37b3a --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/FakeuploaddownloadfilePost.java @@ -0,0 +1,183 @@ +package org.openapijsonschematools.client.paths.fakeuploaddownloadfile; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.FakeuploaddownloadfilePostRequestBody; +import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.FakeuploaddownloadfilePostResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Fakeuploaddownloadfile; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakeuploaddownloadfilePost { + private static class PostProvider { + private static final String method = "post"; + + public static FakeuploaddownloadfilePostResponses.EndpointResponse post( + PostRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + SerializedRequestBody serializedRequestBody = new FakeuploaddownloadfilePostRequestBody.FakeuploaddownloadfilePostRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakeuploaddownloadfile.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakeuploaddownloadfilePostResponses.FakeuploaddownloadfilePostResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PostOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakeuploaddownloadfilePostResponses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface UploadDownloadFileOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakeuploaddownloadfilePostResponses.EndpointResponse uploadDownloadFile(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Post extends ApiClient implements PostOperation { + public Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PostRequest { + public FakeuploaddownloadfilePostRequestBody.SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + + public PostRequest( + FakeuploaddownloadfilePostRequestBody.SealedRequestBody requestBody, + RootServerInfo.@Nullable ServerIndex serverIndex, + @Nullable Duration timeout + ) { + this.requestBody = requestBody; + this.serverIndex = serverIndex; + this.timeout = timeout; + } + } + + public static class PostNullableRequest { + public FakeuploaddownloadfilePostRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + PostNullableRequest getInstance(); + T getBuilderAfterServerIndex(PostNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PostNullableRequest getInstance(); + T getBuilderAfterTimeout(PostNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForRequestBody { + PostNullableRequest getInstance(); + T getBuilderAfterRequestBody(PostNullableRequest instance); + default T requestBody(FakeuploaddownloadfilePostRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public static class Post0RequestBuilder implements SetterForServerIndex, SetterForTimeout { + private final PostNullableRequest instance; + + public Post0RequestBuilder(PostNullableRequest instance) { + this.instance = instance; + } + + public PostRequest build() { + var requestBody = instance.requestBody; + if (requestBody == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new PostRequest( + requestBody, + instance.serverIndex, + instance.timeout + ); + } + + public PostNullableRequest getInstance() { + return instance; + } + + public Post0RequestBuilder getBuilderAfterServerIndex(PostNullableRequest instance) { + return this; + } + + public Post0RequestBuilder getBuilderAfterTimeout(PostNullableRequest instance) { + return this; + } + } + public static class PostRequestBuilder implements SetterForRequestBody { + private final PostNullableRequest instance; + + public PostRequestBuilder() { + this.instance = new PostNullableRequest(); + } + + public PostNullableRequest getInstance() { + return instance; + } + + public Post0RequestBuilder getBuilderAfterRequestBody(PostNullableRequest instance) { + return new Post0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/Post.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/Post.java deleted file mode 100644 index 0cfde8026ef..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/Post.java +++ /dev/null @@ -1,174 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeuploaddownloadfile; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.RequestBody; -import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Fakeuploaddownloadfile; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Post { - private static class PostProvider { - private static final String method = "post"; - - public static Responses.EndpointResponse post( - PostRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - SerializedRequestBody serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakeuploaddownloadfile.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PostOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Post1 extends ApiClient implements PostOperation { - public Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PostRequest { - public RequestBody.SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - - public PostRequest( - RequestBody.SealedRequestBody requestBody, - RootServerInfo.@Nullable ServerIndex serverIndex, - @Nullable Duration timeout - ) { - this.requestBody = requestBody; - this.serverIndex = serverIndex; - this.timeout = timeout; - } - } - - public static class PostNullableRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - PostNullableRequest getInstance(); - T getBuilderAfterServerIndex(PostNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PostNullableRequest getInstance(); - T getBuilderAfterTimeout(PostNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForRequestBody { - PostNullableRequest getInstance(); - T getBuilderAfterRequestBody(PostNullableRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public static class Post0RequestBuilder implements SetterForServerIndex, SetterForTimeout { - private final PostNullableRequest instance; - - public Post0RequestBuilder(PostNullableRequest instance) { - this.instance = instance; - } - - public PostRequest build() { - var requestBody = instance.requestBody; - if (requestBody == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new PostRequest( - requestBody, - instance.serverIndex, - instance.timeout - ); - } - - public PostNullableRequest getInstance() { - return instance; - } - - public Post0RequestBuilder getBuilderAfterServerIndex(PostNullableRequest instance) { - return this; - } - - public Post0RequestBuilder getBuilderAfterTimeout(PostNullableRequest instance) { - return this; - } - } - public static class PostRequestBuilder implements SetterForRequestBody { - private final PostNullableRequest instance; - - public PostRequestBuilder() { - this.instance = new PostNullableRequest(); - } - - public PostNullableRequest getInstance() { - return instance; - } - - public Post0RequestBuilder getBuilderAfterRequestBody(PostNullableRequest instance) { - return new Post0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/FakeuploaddownloadfilePostRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/FakeuploaddownloadfilePostRequestBody.java new file mode 100644 index 00000000000..b7e3baa11fe --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/FakeuploaddownloadfilePostRequestBody.java @@ -0,0 +1,53 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.requestbody.content.applicationoctetstream.ApplicationoctetstreamSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class FakeuploaddownloadfilePostRequestBody { + public sealed interface SealedMediaType permits ApplicationoctetstreamMediaType {} + + public record ApplicationoctetstreamMediaType(ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationoctetstreamMediaType() { + this(ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class FakeuploaddownloadfilePostRequestBody1 extends RequestBodySerializer { + public FakeuploaddownloadfilePostRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/octet-stream", new ApplicationoctetstreamMediaType()) + ), + true + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + ApplicationoctetstreamRequestBody requestBody0 = (ApplicationoctetstreamRequestBody) requestBody; + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } + } + + public sealed interface SealedRequestBody permits ApplicationoctetstreamRequestBody {} + public record ApplicationoctetstreamRequestBody(ApplicationoctetstreamSchema.StringJsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "application/octet-stream"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/FakeuploaddownloadfilePostResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/FakeuploaddownloadfilePostResponses.java new file mode 100644 index 00000000000..04f4e9c3706 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/FakeuploaddownloadfilePostResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post; + +import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.responses.FakeuploaddownloadfilePostCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakeuploaddownloadfilePostResponses { + public sealed interface EndpointResponse permits EndpointFakeuploaddownloadfilePostCode200Response {} + + public record EndpointFakeuploaddownloadfilePostCode200Response( + HttpResponse response, + FakeuploaddownloadfilePostCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakeuploaddownloadfilePostCode200ResponseDeserializer {} + + public static final class StatusFakeuploaddownloadfilePostCode200ResponseDeserializer extends FakeuploaddownloadfilePostCode200Response.FakeuploaddownloadfilePostCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakeuploaddownloadfilePostResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakeuploaddownloadfilePostResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakeuploaddownloadfilePostCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakeuploaddownloadfilePostCode200ResponseDeserializer castDeserializer = (StatusFakeuploaddownloadfilePostCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakeuploaddownloadfilePostCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/RequestBody.java deleted file mode 100644 index 480f5c0801a..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/RequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.requestbody.content.applicationoctetstream.ApplicationoctetstreamSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits ApplicationoctetstreamMediaType {} - - public record ApplicationoctetstreamMediaType(ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationoctetstreamMediaType() { - this(ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/octet-stream", new ApplicationoctetstreamMediaType()) - ), - true - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - ApplicationoctetstreamRequestBody requestBody0 = (ApplicationoctetstreamRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } - } - - public sealed interface SealedRequestBody permits ApplicationoctetstreamRequestBody {} - public record ApplicationoctetstreamRequestBody(ApplicationoctetstreamSchema.StringJsonSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "application/octet-stream"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/Responses.java deleted file mode 100644 index 2a8598335a0..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post; - -import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/responses/Code200Response.java deleted file mode 100644 index f9b8bd33e16..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/responses/Code200Response.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.responses.code200response.content.applicationoctetstream.ApplicationoctetstreamSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationoctetstreamMediaType {} - - public record ApplicationoctetstreamMediaType(ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationoctetstreamMediaType() { - this(ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationoctetstreamResponseBody {} - public record ApplicationoctetstreamResponseBody(ApplicationoctetstreamSchema.StringJsonSchema1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/octet-stream", new ApplicationoctetstreamMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationoctetstreamMediaType thisMediaType = (ApplicationoctetstreamMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationoctetstreamResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/responses/FakeuploaddownloadfilePostCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/responses/FakeuploaddownloadfilePostCode200Response.java new file mode 100644 index 00000000000..dd4052cb616 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploaddownloadfile/post/responses/FakeuploaddownloadfilePostCode200Response.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakeuploaddownloadfile.post.responses.code200response.content.applicationoctetstream.ApplicationoctetstreamSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakeuploaddownloadfilePostCode200Response { + public sealed interface SealedMediaType permits ApplicationoctetstreamMediaType {} + + public record ApplicationoctetstreamMediaType(ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationoctetstreamMediaType() { + this(ApplicationoctetstreamSchema.ApplicationoctetstreamSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationoctetstreamResponseBody {} + public record ApplicationoctetstreamResponseBody(ApplicationoctetstreamSchema.StringJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class FakeuploaddownloadfilePostCode200Response1 extends ResponseDeserializer { + public FakeuploaddownloadfilePostCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/octet-stream", new ApplicationoctetstreamMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationoctetstreamMediaType thisMediaType = (ApplicationoctetstreamMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationoctetstreamResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/FakeuploadfilePost.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/FakeuploadfilePost.java new file mode 100644 index 00000000000..4a90826a6bd --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/FakeuploadfilePost.java @@ -0,0 +1,152 @@ +package org.openapijsonschematools.client.paths.fakeuploadfile; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.fakeuploadfile.post.FakeuploadfilePostRequestBody; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeuploadfile.post.FakeuploadfilePostResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Fakeuploadfile; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakeuploadfilePost { + private static class PostProvider { + private static final String method = "post"; + + public static FakeuploadfilePostResponses.EndpointResponse post( + PostRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + @Nullable SerializedRequestBody serializedRequestBody; + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + if (request.requestBody != null) { + serializedRequestBody = new FakeuploadfilePostRequestBody.FakeuploadfilePostRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + bodyPublisher = serializedRequestBody.bodyPublisher; + } + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakeuploadfile.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakeuploadfilePostResponses.FakeuploadfilePostResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PostOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakeuploadfilePostResponses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface UploadFileOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakeuploadfilePostResponses.EndpointResponse uploadFile(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Post extends ApiClient implements PostOperation { + public Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PostRequest { + public FakeuploadfilePostRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForRequestBody { + PostRequest getInstance(); + T getBuilderAfterRequestBody(PostRequest instance); + default T requestBody(FakeuploadfilePostRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public interface SetterForServerIndex { + PostRequest getInstance(); + T getBuilderAfterServerIndex(PostRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PostRequest getInstance(); + T getBuilderAfterTimeout(PostRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class PostRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { + private final PostRequest instance; + + public PostRequestBuilder() { + this.instance = new PostRequest(); + } + + public PostRequest build() { + return instance; + } + + public PostRequest getInstance() { + return instance; + } + + public PostRequestBuilder getBuilderAfterRequestBody(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterServerIndex(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterTimeout(PostRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/Post.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/Post.java deleted file mode 100644 index 87f187dd7e6..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/Post.java +++ /dev/null @@ -1,143 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeuploadfile; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.fakeuploadfile.post.RequestBody; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakeuploadfile.post.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Fakeuploadfile; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Post { - private static class PostProvider { - private static final String method = "post"; - - public static Responses.EndpointResponse post( - PostRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - @Nullable SerializedRequestBody serializedRequestBody; - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - if (request.requestBody != null) { - serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - bodyPublisher = serializedRequestBody.bodyPublisher; - } - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakeuploadfile.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PostOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Post1 extends ApiClient implements PostOperation { - public Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PostRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForRequestBody { - PostRequest getInstance(); - T getBuilderAfterRequestBody(PostRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public interface SetterForServerIndex { - PostRequest getInstance(); - T getBuilderAfterServerIndex(PostRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PostRequest getInstance(); - T getBuilderAfterTimeout(PostRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class PostRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { - private final PostRequest instance; - - public PostRequestBuilder() { - this.instance = new PostRequest(); - } - - public PostRequest build() { - return instance; - } - - public PostRequest getInstance() { - return instance; - } - - public PostRequestBuilder getBuilderAfterRequestBody(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterServerIndex(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterTimeout(PostRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/FakeuploadfilePostRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/FakeuploadfilePostRequestBody.java new file mode 100644 index 00000000000..29679dae97b --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/FakeuploadfilePostRequestBody.java @@ -0,0 +1,53 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.fakeuploadfile.post; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakeuploadfile.post.requestbody.content.multipartformdata.MultipartformdataSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class FakeuploadfilePostRequestBody { + public sealed interface SealedMediaType permits MultipartformdataMediaType {} + + public record MultipartformdataMediaType(MultipartformdataSchema.MultipartformdataSchema1 schema) implements SealedMediaType, MediaType { + public MultipartformdataMediaType() { + this(MultipartformdataSchema.MultipartformdataSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class FakeuploadfilePostRequestBody1 extends RequestBodySerializer { + public FakeuploadfilePostRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("multipart/form-data", new MultipartformdataMediaType()) + ), + false + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + MultipartformdataRequestBody requestBody0 = (MultipartformdataRequestBody) requestBody; + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } + } + + public sealed interface SealedRequestBody permits MultipartformdataRequestBody {} + public record MultipartformdataRequestBody(MultipartformdataSchema.MultipartformdataSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "multipart/form-data"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/FakeuploadfilePostResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/FakeuploadfilePostResponses.java new file mode 100644 index 00000000000..976aaee314e --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/FakeuploadfilePostResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakeuploadfile.post; + +import org.openapijsonschematools.client.paths.fakeuploadfile.post.responses.FakeuploadfilePostCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakeuploadfilePostResponses { + public sealed interface EndpointResponse permits EndpointFakeuploadfilePostCode200Response {} + + public record EndpointFakeuploadfilePostCode200Response( + HttpResponse response, + FakeuploadfilePostCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakeuploadfilePostCode200ResponseDeserializer {} + + public static final class StatusFakeuploadfilePostCode200ResponseDeserializer extends FakeuploadfilePostCode200Response.FakeuploadfilePostCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakeuploadfilePostResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakeuploadfilePostResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakeuploadfilePostCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakeuploadfilePostCode200ResponseDeserializer castDeserializer = (StatusFakeuploadfilePostCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakeuploadfilePostCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/RequestBody.java deleted file mode 100644 index c9165873f80..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/RequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.fakeuploadfile.post; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakeuploadfile.post.requestbody.content.multipartformdata.MultipartformdataSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits MultipartformdataMediaType {} - - public record MultipartformdataMediaType(MultipartformdataSchema.MultipartformdataSchema1 schema) implements SealedMediaType, MediaType { - public MultipartformdataMediaType() { - this(MultipartformdataSchema.MultipartformdataSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("multipart/form-data", new MultipartformdataMediaType()) - ), - false - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - MultipartformdataRequestBody requestBody0 = (MultipartformdataRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } - } - - public sealed interface SealedRequestBody permits MultipartformdataRequestBody {} - public record MultipartformdataRequestBody(MultipartformdataSchema.MultipartformdataSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "multipart/form-data"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/Responses.java deleted file mode 100644 index d57c98d7c24..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeuploadfile.post; - -import org.openapijsonschematools.client.paths.fakeuploadfile.post.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/responses/Code200Response.java deleted file mode 100644 index 5ef05875230..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/responses/Code200Response.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeuploadfile.post.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakeuploadfile.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.ApiResponseSchema1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/responses/FakeuploadfilePostCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/responses/FakeuploadfilePostCode200Response.java new file mode 100644 index 00000000000..19ee4cb8e6b --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfile/post/responses/FakeuploadfilePostCode200Response.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakeuploadfile.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakeuploadfile.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakeuploadfilePostCode200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.ApiResponseSchema1Boxed body) implements SealedResponseBody { } + + public static class FakeuploadfilePostCode200Response1 extends ResponseDeserializer { + public FakeuploadfilePostCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/FakeuploadfilesPost.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/FakeuploadfilesPost.java new file mode 100644 index 00000000000..e35ade51c50 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/FakeuploadfilesPost.java @@ -0,0 +1,152 @@ +package org.openapijsonschematools.client.paths.fakeuploadfiles; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.fakeuploadfiles.post.FakeuploadfilesPostRequestBody; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakeuploadfiles.post.FakeuploadfilesPostResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Fakeuploadfiles; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakeuploadfilesPost { + private static class PostProvider { + private static final String method = "post"; + + public static FakeuploadfilesPostResponses.EndpointResponse post( + PostRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + @Nullable SerializedRequestBody serializedRequestBody; + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + if (request.requestBody != null) { + serializedRequestBody = new FakeuploadfilesPostRequestBody.FakeuploadfilesPostRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + bodyPublisher = serializedRequestBody.bodyPublisher; + } + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakeuploadfiles.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakeuploadfilesPostResponses.FakeuploadfilesPostResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PostOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakeuploadfilesPostResponses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface UploadFilesOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakeuploadfilesPostResponses.EndpointResponse uploadFiles(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Post extends ApiClient implements PostOperation { + public Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PostRequest { + public FakeuploadfilesPostRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForRequestBody { + PostRequest getInstance(); + T getBuilderAfterRequestBody(PostRequest instance); + default T requestBody(FakeuploadfilesPostRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public interface SetterForServerIndex { + PostRequest getInstance(); + T getBuilderAfterServerIndex(PostRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PostRequest getInstance(); + T getBuilderAfterTimeout(PostRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class PostRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { + private final PostRequest instance; + + public PostRequestBuilder() { + this.instance = new PostRequest(); + } + + public PostRequest build() { + return instance; + } + + public PostRequest getInstance() { + return instance; + } + + public PostRequestBuilder getBuilderAfterRequestBody(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterServerIndex(PostRequest instance) { + return this; + } + + public PostRequestBuilder getBuilderAfterTimeout(PostRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/Post.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/Post.java deleted file mode 100644 index 7be8841da1e..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/Post.java +++ /dev/null @@ -1,143 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeuploadfiles; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.fakeuploadfiles.post.RequestBody; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakeuploadfiles.post.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Fakeuploadfiles; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Post { - private static class PostProvider { - private static final String method = "post"; - - public static Responses.EndpointResponse post( - PostRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - @Nullable SerializedRequestBody serializedRequestBody; - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - if (request.requestBody != null) { - serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - bodyPublisher = serializedRequestBody.bodyPublisher; - } - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakeuploadfiles.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PostOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Post1 extends ApiClient implements PostOperation { - public Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PostRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForRequestBody { - PostRequest getInstance(); - T getBuilderAfterRequestBody(PostRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public interface SetterForServerIndex { - PostRequest getInstance(); - T getBuilderAfterServerIndex(PostRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PostRequest getInstance(); - T getBuilderAfterTimeout(PostRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class PostRequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForTimeout { - private final PostRequest instance; - - public PostRequestBuilder() { - this.instance = new PostRequest(); - } - - public PostRequest build() { - return instance; - } - - public PostRequest getInstance() { - return instance; - } - - public PostRequestBuilder getBuilderAfterRequestBody(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterServerIndex(PostRequest instance) { - return this; - } - - public PostRequestBuilder getBuilderAfterTimeout(PostRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/FakeuploadfilesPostRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/FakeuploadfilesPostRequestBody.java new file mode 100644 index 00000000000..88c61d43ac0 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/FakeuploadfilesPostRequestBody.java @@ -0,0 +1,53 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.fakeuploadfiles.post; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakeuploadfiles.post.requestbody.content.multipartformdata.MultipartformdataSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class FakeuploadfilesPostRequestBody { + public sealed interface SealedMediaType permits MultipartformdataMediaType {} + + public record MultipartformdataMediaType(MultipartformdataSchema.MultipartformdataSchema1 schema) implements SealedMediaType, MediaType { + public MultipartformdataMediaType() { + this(MultipartformdataSchema.MultipartformdataSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class FakeuploadfilesPostRequestBody1 extends RequestBodySerializer { + public FakeuploadfilesPostRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("multipart/form-data", new MultipartformdataMediaType()) + ), + false + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + MultipartformdataRequestBody requestBody0 = (MultipartformdataRequestBody) requestBody; + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } + } + + public sealed interface SealedRequestBody permits MultipartformdataRequestBody {} + public record MultipartformdataRequestBody(MultipartformdataSchema.MultipartformdataSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "multipart/form-data"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/FakeuploadfilesPostResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/FakeuploadfilesPostResponses.java new file mode 100644 index 00000000000..77ed06b1d42 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/FakeuploadfilesPostResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.fakeuploadfiles.post; + +import org.openapijsonschematools.client.paths.fakeuploadfiles.post.responses.FakeuploadfilesPostCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakeuploadfilesPostResponses { + public sealed interface EndpointResponse permits EndpointFakeuploadfilesPostCode200Response {} + + public record EndpointFakeuploadfilesPostCode200Response( + HttpResponse response, + FakeuploadfilesPostCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakeuploadfilesPostCode200ResponseDeserializer {} + + public static final class StatusFakeuploadfilesPostCode200ResponseDeserializer extends FakeuploadfilesPostCode200Response.FakeuploadfilesPostCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class FakeuploadfilesPostResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public FakeuploadfilesPostResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakeuploadfilesPostCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusFakeuploadfilesPostCode200ResponseDeserializer castDeserializer = (StatusFakeuploadfilesPostCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakeuploadfilesPostCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/RequestBody.java deleted file mode 100644 index 418dbfd9b9a..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/RequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.fakeuploadfiles.post; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakeuploadfiles.post.requestbody.content.multipartformdata.MultipartformdataSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits MultipartformdataMediaType {} - - public record MultipartformdataMediaType(MultipartformdataSchema.MultipartformdataSchema1 schema) implements SealedMediaType, MediaType { - public MultipartformdataMediaType() { - this(MultipartformdataSchema.MultipartformdataSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("multipart/form-data", new MultipartformdataMediaType()) - ), - false - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - MultipartformdataRequestBody requestBody0 = (MultipartformdataRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } - } - - public sealed interface SealedRequestBody permits MultipartformdataRequestBody {} - public record MultipartformdataRequestBody(MultipartformdataSchema.MultipartformdataSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "multipart/form-data"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/Responses.java deleted file mode 100644 index 2507eff62d3..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeuploadfiles.post; - -import org.openapijsonschematools.client.paths.fakeuploadfiles.post.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/responses/Code200Response.java deleted file mode 100644 index 8491068775e..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/responses/Code200Response.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakeuploadfiles.post.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakeuploadfiles.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.ApiResponseSchema1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/responses/FakeuploadfilesPostCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/responses/FakeuploadfilesPostCode200Response.java new file mode 100644 index 00000000000..b2d4ff90442 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakeuploadfiles/post/responses/FakeuploadfilesPostCode200Response.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakeuploadfiles.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakeuploadfiles.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakeuploadfilesPostCode200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.ApiResponseSchema1Boxed body) implements SealedResponseBody { } + + public static class FakeuploadfilesPostCode200Response1 extends ResponseDeserializer { + public FakeuploadfilesPostCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/FakewildcardresponsesGet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/FakewildcardresponsesGet.java new file mode 100644 index 00000000000..1f7aab70481 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/FakewildcardresponsesGet.java @@ -0,0 +1,124 @@ +package org.openapijsonschematools.client.paths.fakewildcardresponses; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.FakewildcardresponsesGetResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.paths.Fakewildcardresponses; + +import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FakewildcardresponsesGet { + private static class GetProvider { + private static final String method = "get"; + + public static FakewildcardresponsesGetResponses.EndpointResponse get( + GetRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Fakewildcardresponses.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FakewildcardresponsesGetResponses.FakewildcardresponsesGetResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface GetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakewildcardresponsesGetResponses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface WildCardResponsesOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FakewildcardresponsesGetResponses.EndpointResponse wildCardResponses(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Get extends ApiClient implements GetOperation { + public Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class GetRequest { + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + GetRequest getInstance(); + T getBuilderAfterServerIndex(GetRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + GetRequest getInstance(); + T getBuilderAfterTimeout(GetRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class GetRequestBuilder implements SetterForServerIndex, SetterForTimeout { + private final GetRequest instance; + + public GetRequestBuilder() { + this.instance = new GetRequest(); + } + + public GetRequest build() { + return instance; + } + + public GetRequest getInstance() { + return instance; + } + + public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { + return this; + } + + public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/Get.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/Get.java deleted file mode 100644 index fe290c34307..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/Get.java +++ /dev/null @@ -1,115 +0,0 @@ -package org.openapijsonschematools.client.paths.fakewildcardresponses; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.fakewildcardresponses.get.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.paths.Fakewildcardresponses; - -import java.io.IOException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Get { - private static class GetProvider { - private static final String method = "get"; - - public static Responses.EndpointResponse get( - GetRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Fakewildcardresponses.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface GetOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Get1 extends ApiClient implements GetOperation { - public Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class GetRequest { - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - GetRequest getInstance(); - T getBuilderAfterServerIndex(GetRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - GetRequest getInstance(); - T getBuilderAfterTimeout(GetRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class GetRequestBuilder implements SetterForServerIndex, SetterForTimeout { - private final GetRequest instance; - - public GetRequestBuilder() { - this.instance = new GetRequest(); - } - - public GetRequest build() { - return instance; - } - - public GetRequest getInstance() { - return instance; - } - - public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { - return this; - } - - public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/FakewildcardresponsesGetResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/FakewildcardresponsesGetResponses.java new file mode 100644 index 00000000000..893cf1358e5 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/FakewildcardresponsesGetResponses.java @@ -0,0 +1,139 @@ +package org.openapijsonschematools.client.paths.fakewildcardresponses.get; + +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.FakewildcardresponsesGetCode1XXResponse; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.FakewildcardresponsesGetCode200Response; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.FakewildcardresponsesGetCode2XXResponse; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.FakewildcardresponsesGetCode3XXResponse; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.FakewildcardresponsesGetCode4XXResponse; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.FakewildcardresponsesGetCode5XXResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FakewildcardresponsesGetResponses { + public sealed interface EndpointResponse permits EndpointFakewildcardresponsesGetCode1XXResponse, EndpointFakewildcardresponsesGetCode2XXResponse, EndpointFakewildcardresponsesGetCode200Response, EndpointFakewildcardresponsesGetCode3XXResponse {} + + public record EndpointFakewildcardresponsesGetCode1XXResponse( + HttpResponse response, + FakewildcardresponsesGetCode1XXResponse.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public record EndpointFakewildcardresponsesGetCode2XXResponse( + HttpResponse response, + FakewildcardresponsesGetCode2XXResponse.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public record EndpointFakewildcardresponsesGetCode200Response( + HttpResponse response, + FakewildcardresponsesGetCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public record EndpointFakewildcardresponsesGetCode3XXResponse( + HttpResponse response, + FakewildcardresponsesGetCode3XXResponse.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusFakewildcardresponsesGetCode200ResponseDeserializer {} + + public static final class StatusFakewildcardresponsesGetCode200ResponseDeserializer extends FakewildcardresponsesGetCode200Response.FakewildcardresponsesGetCode200Response1 implements StatusCodeResponseDeserializer { + } + public sealed interface WildcardCodeResponseDeserializer permits WildcardFakewildcardresponsesGetCode1XXResponseDeserializer, WildcardFakewildcardresponsesGetCode2XXResponseDeserializer, WildcardFakewildcardresponsesGetCode3XXResponseDeserializer, WildcardFakewildcardresponsesGetCode4XXResponseDeserializer, WildcardFakewildcardresponsesGetCode5XXResponseDeserializer {} + + public static final class WildcardFakewildcardresponsesGetCode1XXResponseDeserializer extends FakewildcardresponsesGetCode1XXResponse.FakewildcardresponsesGetCode1XXResponse1 implements WildcardCodeResponseDeserializer { + } + public static final class WildcardFakewildcardresponsesGetCode2XXResponseDeserializer extends FakewildcardresponsesGetCode2XXResponse.FakewildcardresponsesGetCode2XXResponse1 implements WildcardCodeResponseDeserializer { + } + public static final class WildcardFakewildcardresponsesGetCode3XXResponseDeserializer extends FakewildcardresponsesGetCode3XXResponse.FakewildcardresponsesGetCode3XXResponse1 implements WildcardCodeResponseDeserializer { + } + public static final class WildcardFakewildcardresponsesGetCode4XXResponseDeserializer extends FakewildcardresponsesGetCode4XXResponse.FakewildcardresponsesGetCode4XXResponse1 implements WildcardCodeResponseDeserializer { + } + public static final class WildcardFakewildcardresponsesGetCode5XXResponseDeserializer extends FakewildcardresponsesGetCode5XXResponse.FakewildcardresponsesGetCode5XXResponse1 implements WildcardCodeResponseDeserializer { + } + + public static final class FakewildcardresponsesGetResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + private final Map wildcardCodeToResponseDeserializer; + public FakewildcardresponsesGetResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusFakewildcardresponsesGetCode200ResponseDeserializer()) + ); + this.wildcardCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("1", new WildcardFakewildcardresponsesGetCode1XXResponseDeserializer()), + new AbstractMap.SimpleEntry<>("2", new WildcardFakewildcardresponsesGetCode2XXResponseDeserializer()), + new AbstractMap.SimpleEntry<>("3", new WildcardFakewildcardresponsesGetCode3XXResponseDeserializer()), + new AbstractMap.SimpleEntry<>("4", new WildcardFakewildcardresponsesGetCode4XXResponseDeserializer()), + new AbstractMap.SimpleEntry<>("5", new WildcardFakewildcardresponsesGetCode5XXResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer != null) { + StatusFakewildcardresponsesGetCode200ResponseDeserializer castDeserializer = (StatusFakewildcardresponsesGetCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointFakewildcardresponsesGetCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + @Nullable WildcardCodeResponseDeserializer wildcardCodeDeserializer = wildcardCodeToResponseDeserializer.get(statusCode); + if (wildcardCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + if (wildcardCodeDeserializer instanceof WildcardFakewildcardresponsesGetCode1XXResponseDeserializer castDeserializer) { + var deserializedResponse = castDeserializer.deserialize(response, configuration); + throw new FakewildcardresponsesGetCode1XXResponse.ResponseApiException( + "Received error statusCode response from server", + response, + deserializedResponse + ); + } else if (wildcardCodeDeserializer instanceof WildcardFakewildcardresponsesGetCode2XXResponseDeserializer castDeserializer) { + var deserializedResponse = castDeserializer.deserialize(response, configuration); + throw new FakewildcardresponsesGetCode2XXResponse.ResponseApiException( + "Received error statusCode response from server", + response, + deserializedResponse + ); + } else if (wildcardCodeDeserializer instanceof WildcardFakewildcardresponsesGetCode3XXResponseDeserializer castDeserializer) { + var deserializedResponse = castDeserializer.deserialize(response, configuration); + throw new FakewildcardresponsesGetCode3XXResponse.ResponseApiException( + "Received error statusCode response from server", + response, + deserializedResponse + ); + } else if (wildcardCodeDeserializer instanceof WildcardFakewildcardresponsesGetCode4XXResponseDeserializer castDeserializer) { + var deserializedResponse = castDeserializer.deserialize(response, configuration); + throw new FakewildcardresponsesGetCode4XXResponse.ResponseApiException( + "Received error statusCode response from server", + response, + deserializedResponse + ); + } else { + WildcardFakewildcardresponsesGetCode5XXResponseDeserializer castDeserializer = (WildcardFakewildcardresponsesGetCode5XXResponseDeserializer) wildcardCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + throw new FakewildcardresponsesGetCode5XXResponse.ResponseApiException( + "Received error statusCode response from server", + response, + deserializedResponse + ); + } + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/Responses.java deleted file mode 100644 index 70451e1cb4c..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/Responses.java +++ /dev/null @@ -1,139 +0,0 @@ -package org.openapijsonschematools.client.paths.fakewildcardresponses.get; - -import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.Code1XXResponse; -import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.Code200Response; -import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.Code2XXResponse; -import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.Code3XXResponse; -import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.Code4XXResponse; -import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.Code5XXResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode1XXResponse, EndpointCode2XXResponse, EndpointCode200Response, EndpointCode3XXResponse {} - - public record EndpointCode1XXResponse( - HttpResponse response, - Code1XXResponse.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public record EndpointCode2XXResponse( - HttpResponse response, - Code2XXResponse.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public record EndpointCode3XXResponse( - HttpResponse response, - Code3XXResponse.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - public sealed interface WildcardCodeResponseDeserializer permits WildcardCode1XXResponseDeserializer, WildcardCode2XXResponseDeserializer, WildcardCode3XXResponseDeserializer, WildcardCode4XXResponseDeserializer, WildcardCode5XXResponseDeserializer {} - - public static final class WildcardCode1XXResponseDeserializer extends Code1XXResponse.Code1XXResponse1 implements WildcardCodeResponseDeserializer { - } - public static final class WildcardCode2XXResponseDeserializer extends Code2XXResponse.Code2XXResponse1 implements WildcardCodeResponseDeserializer { - } - public static final class WildcardCode3XXResponseDeserializer extends Code3XXResponse.Code3XXResponse1 implements WildcardCodeResponseDeserializer { - } - public static final class WildcardCode4XXResponseDeserializer extends Code4XXResponse.Code4XXResponse1 implements WildcardCodeResponseDeserializer { - } - public static final class WildcardCode5XXResponseDeserializer extends Code5XXResponse.Code5XXResponse1 implements WildcardCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - private final Map wildcardCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - this.wildcardCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("1", new WildcardCode1XXResponseDeserializer()), - new AbstractMap.SimpleEntry<>("2", new WildcardCode2XXResponseDeserializer()), - new AbstractMap.SimpleEntry<>("3", new WildcardCode3XXResponseDeserializer()), - new AbstractMap.SimpleEntry<>("4", new WildcardCode4XXResponseDeserializer()), - new AbstractMap.SimpleEntry<>("5", new WildcardCode5XXResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer != null) { - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - @Nullable WildcardCodeResponseDeserializer wildcardCodeDeserializer = wildcardCodeToResponseDeserializer.get(statusCode); - if (wildcardCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - if (wildcardCodeDeserializer instanceof WildcardCode1XXResponseDeserializer castDeserializer) { - var deserializedResponse = castDeserializer.deserialize(response, configuration); - throw new Code1XXResponse.ResponseApiException( - "Received error statusCode response from server", - response, - deserializedResponse - ); - } else if (wildcardCodeDeserializer instanceof WildcardCode2XXResponseDeserializer castDeserializer) { - var deserializedResponse = castDeserializer.deserialize(response, configuration); - throw new Code2XXResponse.ResponseApiException( - "Received error statusCode response from server", - response, - deserializedResponse - ); - } else if (wildcardCodeDeserializer instanceof WildcardCode3XXResponseDeserializer castDeserializer) { - var deserializedResponse = castDeserializer.deserialize(response, configuration); - throw new Code3XXResponse.ResponseApiException( - "Received error statusCode response from server", - response, - deserializedResponse - ); - } else if (wildcardCodeDeserializer instanceof WildcardCode4XXResponseDeserializer castDeserializer) { - var deserializedResponse = castDeserializer.deserialize(response, configuration); - throw new Code4XXResponse.ResponseApiException( - "Received error statusCode response from server", - response, - deserializedResponse - ); - } else { - WildcardCode5XXResponseDeserializer castDeserializer = (WildcardCode5XXResponseDeserializer) wildcardCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - throw new Code5XXResponse.ResponseApiException( - "Received error statusCode response from server", - response, - deserializedResponse - ); - } - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code1XXResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code1XXResponse.java deleted file mode 100644 index 4bb1a115b72..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code1XXResponse.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.code1xxresponse.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code1XXResponse { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } - - public static class Code1XXResponse1 extends ResponseDeserializer { - public Code1XXResponse1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code200Response.java deleted file mode 100644 index 8138d8bc1a7..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code200Response.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code2XXResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code2XXResponse.java deleted file mode 100644 index 3d9e6eb5638..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code2XXResponse.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.code2xxresponse.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code2XXResponse { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } - - public static class Code2XXResponse1 extends ResponseDeserializer { - public Code2XXResponse1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code3XXResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code3XXResponse.java deleted file mode 100644 index 5a177c3e8ae..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code3XXResponse.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.code3xxresponse.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code3XXResponse { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } - - public static class Code3XXResponse1 extends ResponseDeserializer { - public Code3XXResponse1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code4XXResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code4XXResponse.java deleted file mode 100644 index 944465a02ea..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code4XXResponse.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.code4xxresponse.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code4XXResponse { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } - - public static class Code4XXResponse1 extends ResponseDeserializer { - public Code4XXResponse1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code5XXResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code5XXResponse.java deleted file mode 100644 index 46d31fd8f01..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/Code5XXResponse.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.code5xxresponse.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code5XXResponse { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } - - public static class Code5XXResponse1 extends ResponseDeserializer { - public Code5XXResponse1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode1XXResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode1XXResponse.java new file mode 100644 index 00000000000..9be539481c2 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode1XXResponse.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.code1xxresponse.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakewildcardresponsesGetCode1XXResponse { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class FakewildcardresponsesGetCode1XXResponse1 extends ResponseDeserializer { + public FakewildcardresponsesGetCode1XXResponse1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode200Response.java new file mode 100644 index 00000000000..6176befb30c --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode200Response.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakewildcardresponsesGetCode200Response { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class FakewildcardresponsesGetCode200Response1 extends ResponseDeserializer { + public FakewildcardresponsesGetCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode2XXResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode2XXResponse.java new file mode 100644 index 00000000000..5a471b38e05 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode2XXResponse.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.code2xxresponse.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakewildcardresponsesGetCode2XXResponse { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class FakewildcardresponsesGetCode2XXResponse1 extends ResponseDeserializer { + public FakewildcardresponsesGetCode2XXResponse1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode3XXResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode3XXResponse.java new file mode 100644 index 00000000000..df2e4ea8d9d --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode3XXResponse.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.code3xxresponse.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakewildcardresponsesGetCode3XXResponse { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class FakewildcardresponsesGetCode3XXResponse1 extends ResponseDeserializer { + public FakewildcardresponsesGetCode3XXResponse1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode4XXResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode4XXResponse.java new file mode 100644 index 00000000000..0c46483284c --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode4XXResponse.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.code4xxresponse.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakewildcardresponsesGetCode4XXResponse { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class FakewildcardresponsesGetCode4XXResponse1 extends ResponseDeserializer { + public FakewildcardresponsesGetCode4XXResponse1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode5XXResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode5XXResponse.java new file mode 100644 index 00000000000..f4c919e3ded --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/fakewildcardresponses/get/responses/FakewildcardresponsesGetCode5XXResponse.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.fakewildcardresponses.get.responses.code5xxresponse.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FakewildcardresponsesGetCode5XXResponse { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.AnyTypeJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class FakewildcardresponsesGetCode5XXResponse1 extends ResponseDeserializer { + public FakewildcardresponsesGetCode5XXResponse1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/FooGet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/FooGet.java new file mode 100644 index 00000000000..e5828e4cfe5 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/FooGet.java @@ -0,0 +1,124 @@ +package org.openapijsonschematools.client.paths.foo; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.foo.get.FooGetServerInfo; +import org.openapijsonschematools.client.paths.foo.get.FooGetResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.paths.Foo; + +import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class FooGet { + private static class GetProvider { + private static final String method = "get"; + + public static FooGetResponses.EndpointResponse get( + GetRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Foo.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new FooGetResponses.FooGetResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface GetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FooGetResponses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface FooGetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default FooGetResponses.EndpointResponse fooGet(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Get extends ApiClient implements GetOperation { + public Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class GetRequest { + public FooGetServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + GetRequest getInstance(); + T getBuilderAfterServerIndex(GetRequest instance); + default T serverIndex(FooGetServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + GetRequest getInstance(); + T getBuilderAfterTimeout(GetRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class GetRequestBuilder implements SetterForServerIndex, SetterForTimeout { + private final GetRequest instance; + + public GetRequestBuilder() { + this.instance = new GetRequest(); + } + + public GetRequest build() { + return instance; + } + + public GetRequest getInstance() { + return instance; + } + + public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { + return this; + } + + public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/Get.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/Get.java deleted file mode 100644 index ca58d9e23fe..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/Get.java +++ /dev/null @@ -1,115 +0,0 @@ -package org.openapijsonschematools.client.paths.foo; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.foo.get.FooGetServerInfo; -import org.openapijsonschematools.client.paths.foo.get.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.paths.Foo; - -import java.io.IOException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Get { - private static class GetProvider { - private static final String method = "get"; - - public static Responses.EndpointResponse get( - GetRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Foo.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface GetOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Get1 extends ApiClient implements GetOperation { - public Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class GetRequest { - public FooGetServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - GetRequest getInstance(); - T getBuilderAfterServerIndex(GetRequest instance); - default T serverIndex(FooGetServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - GetRequest getInstance(); - T getBuilderAfterTimeout(GetRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class GetRequestBuilder implements SetterForServerIndex, SetterForTimeout { - private final GetRequest instance; - - public GetRequestBuilder() { - this.instance = new GetRequest(); - } - - public GetRequest build() { - return instance; - } - - public GetRequest getInstance() { - return instance; - } - - public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { - return this; - } - - public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/get/FooGetResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/get/FooGetResponses.java new file mode 100644 index 00000000000..c447c27c206 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/get/FooGetResponses.java @@ -0,0 +1,37 @@ +package org.openapijsonschematools.client.paths.foo.get; + +import org.openapijsonschematools.client.paths.foo.get.responses.FooGetCodedefaultResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class FooGetResponses { + public sealed interface EndpointResponse permits EndpointFooGetCodedefaultResponse {} + + public record EndpointFooGetCodedefaultResponse( + HttpResponse response, + FooGetCodedefaultResponse.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public static final class FooGetResponses1 implements ResponsesDeserializer { + private final FooGetCodedefaultResponse.FooGetCodedefaultResponse1 defaultResponseDeserializer; + public FooGetResponses1() { + this.defaultResponseDeserializer = new FooGetCodedefaultResponse.FooGetCodedefaultResponse1(); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + var deserializedResponse = defaultResponseDeserializer.deserialize(response, configuration); + return new EndpointFooGetCodedefaultResponse(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/get/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/get/Responses.java deleted file mode 100644 index 63a2d1d6c22..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/get/Responses.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.openapijsonschematools.client.paths.foo.get; - -import org.openapijsonschematools.client.paths.foo.get.responses.CodedefaultResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCodedefaultResponse {} - - public record EndpointCodedefaultResponse( - HttpResponse response, - CodedefaultResponse.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public static final class Responses1 implements ResponsesDeserializer { - private final CodedefaultResponse.CodedefaultResponse1 defaultResponseDeserializer; - public Responses1() { - this.defaultResponseDeserializer = new CodedefaultResponse.CodedefaultResponse1(); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - var deserializedResponse = defaultResponseDeserializer.deserialize(response, configuration); - return new EndpointCodedefaultResponse(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/get/responses/CodedefaultResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/get/responses/CodedefaultResponse.java deleted file mode 100644 index 28ef2eae71c..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/get/responses/CodedefaultResponse.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapijsonschematools.client.paths.foo.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.foo.get.responses.codedefaultresponse.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class CodedefaultResponse { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} - public record ApplicationjsonResponseBody(ApplicationjsonSchema.ApplicationjsonSchema1Boxed body) implements SealedResponseBody { } - - public static class CodedefaultResponse1 extends ResponseDeserializer { - public CodedefaultResponse1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/get/responses/FooGetCodedefaultResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/get/responses/FooGetCodedefaultResponse.java new file mode 100644 index 00000000000..8d43ab82cfb --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/foo/get/responses/FooGetCodedefaultResponse.java @@ -0,0 +1,63 @@ +package org.openapijsonschematools.client.paths.foo.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.foo.get.responses.codedefaultresponse.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class FooGetCodedefaultResponse { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationjsonResponseBody {} + public record ApplicationjsonResponseBody(ApplicationjsonSchema.ApplicationjsonSchema1Boxed body) implements SealedResponseBody { } + + public static class FooGetCodedefaultResponse1 extends ResponseDeserializer { + public FooGetCodedefaultResponse1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/PetPost.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/PetPost.java new file mode 100644 index 00000000000..1f9d0dc8431 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/PetPost.java @@ -0,0 +1,215 @@ +package org.openapijsonschematools.client.paths.pet; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.pet.post.PetPostSecurityInfo; +import org.openapijsonschematools.client.paths.pet.post.PetPostRequestBody; +import org.openapijsonschematools.client.paths.pet.post.PetPostResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Pet; +import org.openapijsonschematools.client.securityrequirementobjects.SecurityRequirementObject; +import org.openapijsonschematools.client.securityrequirementobjects.AuthApplier; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class PetPost { + private static class PostProvider extends AuthApplier { + private static final String method = "post"; + + public static PetPostResponses.EndpointResponse post( + PostRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + SerializedRequestBody serializedRequestBody = new PetPostRequestBody.PetPostRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + SecurityRequirementObject securityRequirementObject = apiConfiguration.getSecurityRequirementObject(request.securityIndex); + updateParamsForAuth( + securityRequirementObject, + headers, + Pet.path, + method, + bodyPublisher, + queryMap, + apiConfiguration + ); + + String url = host + Pet.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new PetPostResponses.PetPostResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PostOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default PetPostResponses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface AddPetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default PetPostResponses.EndpointResponse addPet(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Post extends ApiClient implements PostOperation { + public Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PostRequest { + public PetPostRequestBody.SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public PetPostSecurityInfo.@Nullable SecurityIndex securityIndex; + public @Nullable Duration timeout; + + public PostRequest( + PetPostRequestBody.SealedRequestBody requestBody, + RootServerInfo.@Nullable ServerIndex serverIndex, + PetPostSecurityInfo.@Nullable SecurityIndex securityIndex, + @Nullable Duration timeout + ) { + this.requestBody = requestBody; + this.serverIndex = serverIndex; + this.securityIndex = securityIndex; + this.timeout = timeout; + } + } + + public static class PostNullableRequest { + public PetPostRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public PetPostSecurityInfo.@Nullable SecurityIndex securityIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + PostNullableRequest getInstance(); + T getBuilderAfterServerIndex(PostNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForSecurityIndex { + PostNullableRequest getInstance(); + T getBuilderAfterSecurityIndex(PostNullableRequest instance); + default T securityIndex(PetPostSecurityInfo.SecurityIndex securityIndex) { + var instance = getInstance(); + instance.securityIndex = securityIndex; + return getBuilderAfterSecurityIndex(instance); + } + } + + public interface SetterForTimeout { + PostNullableRequest getInstance(); + T getBuilderAfterTimeout(PostNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForRequestBody { + PostNullableRequest getInstance(); + T getBuilderAfterRequestBody(PostNullableRequest instance); + default T requestBody(PetPostRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public static class Post0RequestBuilder implements SetterForServerIndex, SetterForSecurityIndex, SetterForTimeout { + private final PostNullableRequest instance; + + public Post0RequestBuilder(PostNullableRequest instance) { + this.instance = instance; + } + + public PostRequest build() { + var requestBody = instance.requestBody; + if (requestBody == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new PostRequest( + requestBody, + instance.serverIndex, + instance.securityIndex, + instance.timeout + ); + } + + public PostNullableRequest getInstance() { + return instance; + } + + public Post0RequestBuilder getBuilderAfterServerIndex(PostNullableRequest instance) { + return this; + } + + public Post0RequestBuilder getBuilderAfterSecurityIndex(PostNullableRequest instance) { + return this; + } + + public Post0RequestBuilder getBuilderAfterTimeout(PostNullableRequest instance) { + return this; + } + } + public static class PostRequestBuilder implements SetterForRequestBody { + private final PostNullableRequest instance; + + public PostRequestBuilder() { + this.instance = new PostNullableRequest(); + } + + public PostNullableRequest getInstance() { + return instance; + } + + public Post0RequestBuilder getBuilderAfterRequestBody(PostNullableRequest instance) { + return new Post0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/PetPut.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/PetPut.java new file mode 100644 index 00000000000..2fbf38a193b --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/PetPut.java @@ -0,0 +1,214 @@ +package org.openapijsonschematools.client.paths.pet; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.pet.put.PetPutSecurityInfo; +import org.openapijsonschematools.client.paths.pet.put.PetPutRequestBody; +import org.openapijsonschematools.client.paths.pet.put.PetPutResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Pet; +import org.openapijsonschematools.client.securityrequirementobjects.SecurityRequirementObject; +import org.openapijsonschematools.client.securityrequirementobjects.AuthApplier; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class PetPut { + private static class PutProvider extends AuthApplier { + private static final String method = "put"; + + public static Void put( + PutRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + SerializedRequestBody serializedRequestBody = new PetPutRequestBody.PetPutRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + SecurityRequirementObject securityRequirementObject = apiConfiguration.getSecurityRequirementObject(request.securityIndex); + updateParamsForAuth( + securityRequirementObject, + headers, + Pet.path, + method, + bodyPublisher, + queryMap, + apiConfiguration + ); + + String url = host + Pet.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + return (Void) null; + } + } + + public interface PutOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default Void put(PutRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PutProvider.put(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface UpdatePetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default Void updatePet(PutRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PutProvider.put(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Put extends ApiClient implements PutOperation { + public Put(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PutRequest { + public PetPutRequestBody.SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public PetPutSecurityInfo.@Nullable SecurityIndex securityIndex; + public @Nullable Duration timeout; + + public PutRequest( + PetPutRequestBody.SealedRequestBody requestBody, + RootServerInfo.@Nullable ServerIndex serverIndex, + PetPutSecurityInfo.@Nullable SecurityIndex securityIndex, + @Nullable Duration timeout + ) { + this.requestBody = requestBody; + this.serverIndex = serverIndex; + this.securityIndex = securityIndex; + this.timeout = timeout; + } + } + + public static class PutNullableRequest { + public PetPutRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public PetPutSecurityInfo.@Nullable SecurityIndex securityIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + PutNullableRequest getInstance(); + T getBuilderAfterServerIndex(PutNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForSecurityIndex { + PutNullableRequest getInstance(); + T getBuilderAfterSecurityIndex(PutNullableRequest instance); + default T securityIndex(PetPutSecurityInfo.SecurityIndex securityIndex) { + var instance = getInstance(); + instance.securityIndex = securityIndex; + return getBuilderAfterSecurityIndex(instance); + } + } + + public interface SetterForTimeout { + PutNullableRequest getInstance(); + T getBuilderAfterTimeout(PutNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForRequestBody { + PutNullableRequest getInstance(); + T getBuilderAfterRequestBody(PutNullableRequest instance); + default T requestBody(PetPutRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public static class Put0RequestBuilder implements SetterForServerIndex, SetterForSecurityIndex, SetterForTimeout { + private final PutNullableRequest instance; + + public Put0RequestBuilder(PutNullableRequest instance) { + this.instance = instance; + } + + public PutRequest build() { + var requestBody = instance.requestBody; + if (requestBody == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new PutRequest( + requestBody, + instance.serverIndex, + instance.securityIndex, + instance.timeout + ); + } + + public PutNullableRequest getInstance() { + return instance; + } + + public Put0RequestBuilder getBuilderAfterServerIndex(PutNullableRequest instance) { + return this; + } + + public Put0RequestBuilder getBuilderAfterSecurityIndex(PutNullableRequest instance) { + return this; + } + + public Put0RequestBuilder getBuilderAfterTimeout(PutNullableRequest instance) { + return this; + } + } + public static class PutRequestBuilder implements SetterForRequestBody { + private final PutNullableRequest instance; + + public PutRequestBuilder() { + this.instance = new PutNullableRequest(); + } + + public PutNullableRequest getInstance() { + return instance; + } + + public Put0RequestBuilder getBuilderAfterRequestBody(PutNullableRequest instance) { + return new Put0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/Post.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/Post.java deleted file mode 100644 index 8ac322b163d..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/Post.java +++ /dev/null @@ -1,206 +0,0 @@ -package org.openapijsonschematools.client.paths.pet; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.pet.post.PetPostSecurityInfo; -import org.openapijsonschematools.client.paths.pet.post.RequestBody; -import org.openapijsonschematools.client.paths.pet.post.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Pet; -import org.openapijsonschematools.client.securityrequirementobjects.SecurityRequirementObject; -import org.openapijsonschematools.client.securityrequirementobjects.AuthApplier; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Post { - private static class PostProvider extends AuthApplier { - private static final String method = "post"; - - public static Responses.EndpointResponse post( - PostRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - SerializedRequestBody serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - SecurityRequirementObject securityRequirementObject = apiConfiguration.getSecurityRequirementObject(request.securityIndex); - updateParamsForAuth( - securityRequirementObject, - headers, - Pet.path, - method, - bodyPublisher, - queryMap, - apiConfiguration - ); - - String url = host + Pet.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PostOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Post1 extends ApiClient implements PostOperation { - public Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PostRequest { - public RequestBody.SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public PetPostSecurityInfo.@Nullable SecurityIndex securityIndex; - public @Nullable Duration timeout; - - public PostRequest( - RequestBody.SealedRequestBody requestBody, - RootServerInfo.@Nullable ServerIndex serverIndex, - PetPostSecurityInfo.@Nullable SecurityIndex securityIndex, - @Nullable Duration timeout - ) { - this.requestBody = requestBody; - this.serverIndex = serverIndex; - this.securityIndex = securityIndex; - this.timeout = timeout; - } - } - - public static class PostNullableRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public PetPostSecurityInfo.@Nullable SecurityIndex securityIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - PostNullableRequest getInstance(); - T getBuilderAfterServerIndex(PostNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForSecurityIndex { - PostNullableRequest getInstance(); - T getBuilderAfterSecurityIndex(PostNullableRequest instance); - default T securityIndex(PetPostSecurityInfo.SecurityIndex securityIndex) { - var instance = getInstance(); - instance.securityIndex = securityIndex; - return getBuilderAfterSecurityIndex(instance); - } - } - - public interface SetterForTimeout { - PostNullableRequest getInstance(); - T getBuilderAfterTimeout(PostNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForRequestBody { - PostNullableRequest getInstance(); - T getBuilderAfterRequestBody(PostNullableRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public static class Post0RequestBuilder implements SetterForServerIndex, SetterForSecurityIndex, SetterForTimeout { - private final PostNullableRequest instance; - - public Post0RequestBuilder(PostNullableRequest instance) { - this.instance = instance; - } - - public PostRequest build() { - var requestBody = instance.requestBody; - if (requestBody == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new PostRequest( - requestBody, - instance.serverIndex, - instance.securityIndex, - instance.timeout - ); - } - - public PostNullableRequest getInstance() { - return instance; - } - - public Post0RequestBuilder getBuilderAfterServerIndex(PostNullableRequest instance) { - return this; - } - - public Post0RequestBuilder getBuilderAfterSecurityIndex(PostNullableRequest instance) { - return this; - } - - public Post0RequestBuilder getBuilderAfterTimeout(PostNullableRequest instance) { - return this; - } - } - public static class PostRequestBuilder implements SetterForRequestBody { - private final PostNullableRequest instance; - - public PostRequestBuilder() { - this.instance = new PostNullableRequest(); - } - - public PostNullableRequest getInstance() { - return instance; - } - - public Post0RequestBuilder getBuilderAfterRequestBody(PostNullableRequest instance) { - return new Post0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/Put.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/Put.java deleted file mode 100644 index e75a9b792d3..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/Put.java +++ /dev/null @@ -1,206 +0,0 @@ -package org.openapijsonschematools.client.paths.pet; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.pet.put.PetPutSecurityInfo; -import org.openapijsonschematools.client.paths.pet.put.RequestBody; -import org.openapijsonschematools.client.paths.pet.put.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Pet; -import org.openapijsonschematools.client.securityrequirementobjects.SecurityRequirementObject; -import org.openapijsonschematools.client.securityrequirementobjects.AuthApplier; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Put { - private static class PutProvider extends AuthApplier { - private static final String method = "put"; - - public static Void put( - PutRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - SerializedRequestBody serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - SecurityRequirementObject securityRequirementObject = apiConfiguration.getSecurityRequirementObject(request.securityIndex); - updateParamsForAuth( - securityRequirementObject, - headers, - Pet.path, - method, - bodyPublisher, - queryMap, - apiConfiguration - ); - - String url = host + Pet.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PutOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Void put(PutRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PutProvider.put(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Put1 extends ApiClient implements PutOperation { - public Put1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PutRequest { - public RequestBody.SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public PetPutSecurityInfo.@Nullable SecurityIndex securityIndex; - public @Nullable Duration timeout; - - public PutRequest( - RequestBody.SealedRequestBody requestBody, - RootServerInfo.@Nullable ServerIndex serverIndex, - PetPutSecurityInfo.@Nullable SecurityIndex securityIndex, - @Nullable Duration timeout - ) { - this.requestBody = requestBody; - this.serverIndex = serverIndex; - this.securityIndex = securityIndex; - this.timeout = timeout; - } - } - - public static class PutNullableRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public PetPutSecurityInfo.@Nullable SecurityIndex securityIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - PutNullableRequest getInstance(); - T getBuilderAfterServerIndex(PutNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForSecurityIndex { - PutNullableRequest getInstance(); - T getBuilderAfterSecurityIndex(PutNullableRequest instance); - default T securityIndex(PetPutSecurityInfo.SecurityIndex securityIndex) { - var instance = getInstance(); - instance.securityIndex = securityIndex; - return getBuilderAfterSecurityIndex(instance); - } - } - - public interface SetterForTimeout { - PutNullableRequest getInstance(); - T getBuilderAfterTimeout(PutNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForRequestBody { - PutNullableRequest getInstance(); - T getBuilderAfterRequestBody(PutNullableRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public static class Put0RequestBuilder implements SetterForServerIndex, SetterForSecurityIndex, SetterForTimeout { - private final PutNullableRequest instance; - - public Put0RequestBuilder(PutNullableRequest instance) { - this.instance = instance; - } - - public PutRequest build() { - var requestBody = instance.requestBody; - if (requestBody == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new PutRequest( - requestBody, - instance.serverIndex, - instance.securityIndex, - instance.timeout - ); - } - - public PutNullableRequest getInstance() { - return instance; - } - - public Put0RequestBuilder getBuilderAfterServerIndex(PutNullableRequest instance) { - return this; - } - - public Put0RequestBuilder getBuilderAfterSecurityIndex(PutNullableRequest instance) { - return this; - } - - public Put0RequestBuilder getBuilderAfterTimeout(PutNullableRequest instance) { - return this; - } - } - public static class PutRequestBuilder implements SetterForRequestBody { - private final PutNullableRequest instance; - - public PutRequestBuilder() { - this.instance = new PutNullableRequest(); - } - - public PutNullableRequest getInstance() { - return instance; - } - - public Put0RequestBuilder getBuilderAfterRequestBody(PutNullableRequest instance) { - return new Put0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/PetPostRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/PetPostRequestBody.java new file mode 100644 index 00000000000..d31fde38cb3 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/PetPostRequestBody.java @@ -0,0 +1,11 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.pet.post; + +import org.openapijsonschematools.client.components.requestbodies.Pet; + +public class PetPostRequestBody extends Pet { + public static class PetPostRequestBody1 extends Pet1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/PetPostResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/PetPostResponses.java new file mode 100644 index 00000000000..b5a6f364f9c --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/PetPostResponses.java @@ -0,0 +1,66 @@ +package org.openapijsonschematools.client.paths.pet.post; + +import org.openapijsonschematools.client.paths.pet.post.responses.PetPostCode200Response; +import org.openapijsonschematools.client.paths.pet.post.responses.PetPostCode405Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class PetPostResponses { + public sealed interface EndpointResponse permits EndpointPetPostCode200Response {} + + public record EndpointPetPostCode200Response( + HttpResponse response, + Void body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusPetPostCode200ResponseDeserializer, StatusPetPostCode405ResponseDeserializer {} + + public static final class StatusPetPostCode200ResponseDeserializer extends PetPostCode200Response.PetPostCode200Response1 implements StatusCodeResponseDeserializer { + } + public static final class StatusPetPostCode405ResponseDeserializer extends PetPostCode405Response.PetPostCode405Response1 implements StatusCodeResponseDeserializer { + } + + public static final class PetPostResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public PetPostResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusPetPostCode200ResponseDeserializer()), + new AbstractMap.SimpleEntry<>("405", new StatusPetPostCode405ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + if (statusCodeDeserializer instanceof StatusPetPostCode200ResponseDeserializer castDeserializer) { + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointPetPostCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } else { + StatusPetPostCode405ResponseDeserializer castDeserializer = (StatusPetPostCode405ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + throw new PetPostCode405Response.ResponseApiException( + "Received error statusCode response from server", + response, + deserializedResponse + ); + } + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/RequestBody.java deleted file mode 100644 index 16a546e1201..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/RequestBody.java +++ /dev/null @@ -1,11 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.pet.post; - -import org.openapijsonschematools.client.components.requestbodies.Pet; - -public class RequestBody extends Pet { - public static class RequestBody1 extends Pet1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/Responses.java deleted file mode 100644 index 1e44c96d53e..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/Responses.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.openapijsonschematools.client.paths.pet.post; - -import org.openapijsonschematools.client.paths.pet.post.responses.Code200Response; -import org.openapijsonschematools.client.paths.pet.post.responses.Code405Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer, StatusCode405ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - public static final class StatusCode405ResponseDeserializer extends Code405Response.Code405Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()), - new AbstractMap.SimpleEntry<>("405", new StatusCode405ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - if (statusCodeDeserializer instanceof StatusCode200ResponseDeserializer castDeserializer) { - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } else { - StatusCode405ResponseDeserializer castDeserializer = (StatusCode405ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - throw new Code405Response.ResponseApiException( - "Received error statusCode response from server", - response, - deserializedResponse - ); - } - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/responses/Code200Response.java deleted file mode 100644 index 77a882b268d..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/responses/Code200Response.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.openapijsonschematools.client.paths.pet.post.responses; - -import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; - -public class Code200Response extends SuccessDescriptionOnly { - public static class Code200Response1 extends SuccessDescriptionOnly1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/responses/Code405Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/responses/Code405Response.java deleted file mode 100644 index 207a4ef554f..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/responses/Code405Response.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapijsonschematools.client.paths.pet.post.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; - -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code405Response { - - public static class Code405Response1 extends ResponseDeserializer { - public Code405Response1() { - super( - MapUtils.makeMap( - ) - ); - } - - @Override - protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { - return null; - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/responses/PetPostCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/responses/PetPostCode200Response.java new file mode 100644 index 00000000000..d32f61af7bc --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/responses/PetPostCode200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.pet.post.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class PetPostCode200Response extends SuccessDescriptionOnly { + public static class PetPostCode200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/responses/PetPostCode405Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/responses/PetPostCode405Response.java new file mode 100644 index 00000000000..30ed877e1b3 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/post/responses/PetPostCode405Response.java @@ -0,0 +1,45 @@ +package org.openapijsonschematools.client.paths.pet.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class PetPostCode405Response { + + public static class PetPostCode405Response1 extends ResponseDeserializer { + public PetPostCode405Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/PetPutRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/PetPutRequestBody.java new file mode 100644 index 00000000000..05a8bf7faa0 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/PetPutRequestBody.java @@ -0,0 +1,11 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.pet.put; + +import org.openapijsonschematools.client.components.requestbodies.Pet; + +public class PetPutRequestBody extends Pet { + public static class PetPutRequestBody1 extends Pet1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/PetPutResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/PetPutResponses.java new file mode 100644 index 00000000000..a8e998184ef --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/PetPutResponses.java @@ -0,0 +1,72 @@ +package org.openapijsonschematools.client.paths.pet.put; + +import org.openapijsonschematools.client.paths.pet.put.responses.PetPutCode400Response; +import org.openapijsonschematools.client.paths.pet.put.responses.PetPutCode404Response; +import org.openapijsonschematools.client.paths.pet.put.responses.PetPutCode405Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class PetPutResponses { + + public sealed interface StatusCodeResponseDeserializer permits StatusPetPutCode400ResponseDeserializer, StatusPetPutCode404ResponseDeserializer, StatusPetPutCode405ResponseDeserializer {} + + public static final class StatusPetPutCode400ResponseDeserializer extends PetPutCode400Response.PetPutCode400Response1 implements StatusCodeResponseDeserializer { + } + public static final class StatusPetPutCode404ResponseDeserializer extends PetPutCode404Response.PetPutCode404Response1 implements StatusCodeResponseDeserializer { + } + public static final class StatusPetPutCode405ResponseDeserializer extends PetPutCode405Response.PetPutCode405Response1 implements StatusCodeResponseDeserializer { + } + + public static final class PetPutResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public PetPutResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("400", new StatusPetPutCode400ResponseDeserializer()), + new AbstractMap.SimpleEntry<>("404", new StatusPetPutCode404ResponseDeserializer()), + new AbstractMap.SimpleEntry<>("405", new StatusPetPutCode405ResponseDeserializer()) + ); + } + + public Void deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + if (statusCodeDeserializer instanceof StatusPetPutCode400ResponseDeserializer castDeserializer) { + var deserializedResponse = castDeserializer.deserialize(response, configuration); + throw new PetPutCode400Response.ResponseApiException( + "Received error statusCode response from server", + response, + deserializedResponse + ); + } else if (statusCodeDeserializer instanceof StatusPetPutCode404ResponseDeserializer castDeserializer) { + var deserializedResponse = castDeserializer.deserialize(response, configuration); + throw new PetPutCode404Response.ResponseApiException( + "Received error statusCode response from server", + response, + deserializedResponse + ); + } else { + StatusPetPutCode405ResponseDeserializer castDeserializer = (StatusPetPutCode405ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + throw new PetPutCode405Response.ResponseApiException( + "Received error statusCode response from server", + response, + deserializedResponse + ); + } + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/RequestBody.java deleted file mode 100644 index 83f188dd916..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/RequestBody.java +++ /dev/null @@ -1,11 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.pet.put; - -import org.openapijsonschematools.client.components.requestbodies.Pet; - -public class RequestBody extends Pet { - public static class RequestBody1 extends Pet1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/Responses.java deleted file mode 100644 index c5ef091d53a..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/Responses.java +++ /dev/null @@ -1,72 +0,0 @@ -package org.openapijsonschematools.client.paths.pet.put; - -import org.openapijsonschematools.client.paths.pet.put.responses.Code400Response; -import org.openapijsonschematools.client.paths.pet.put.responses.Code404Response; -import org.openapijsonschematools.client.paths.pet.put.responses.Code405Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - - public sealed interface StatusCodeResponseDeserializer permits StatusCode400ResponseDeserializer, StatusCode404ResponseDeserializer, StatusCode405ResponseDeserializer {} - - public static final class StatusCode400ResponseDeserializer extends Code400Response.Code400Response1 implements StatusCodeResponseDeserializer { - } - public static final class StatusCode404ResponseDeserializer extends Code404Response.Code404Response1 implements StatusCodeResponseDeserializer { - } - public static final class StatusCode405ResponseDeserializer extends Code405Response.Code405Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("400", new StatusCode400ResponseDeserializer()), - new AbstractMap.SimpleEntry<>("404", new StatusCode404ResponseDeserializer()), - new AbstractMap.SimpleEntry<>("405", new StatusCode405ResponseDeserializer()) - ); - } - - public Void deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - if (statusCodeDeserializer instanceof StatusCode400ResponseDeserializer castDeserializer) { - var deserializedResponse = castDeserializer.deserialize(response, configuration); - throw new Code400Response.ResponseApiException( - "Received error statusCode response from server", - response, - deserializedResponse - ); - } else if (statusCodeDeserializer instanceof StatusCode404ResponseDeserializer castDeserializer) { - var deserializedResponse = castDeserializer.deserialize(response, configuration); - throw new Code404Response.ResponseApiException( - "Received error statusCode response from server", - response, - deserializedResponse - ); - } else { - StatusCode405ResponseDeserializer castDeserializer = (StatusCode405ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - throw new Code405Response.ResponseApiException( - "Received error statusCode response from server", - response, - deserializedResponse - ); - } - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/Code400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/Code400Response.java deleted file mode 100644 index 27021cdf728..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/Code400Response.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapijsonschematools.client.paths.pet.put.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; - -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code400Response { - - public static class Code400Response1 extends ResponseDeserializer { - public Code400Response1() { - super( - MapUtils.makeMap( - ) - ); - } - - @Override - protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { - return null; - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/Code404Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/Code404Response.java deleted file mode 100644 index b74b875389c..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/Code404Response.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapijsonschematools.client.paths.pet.put.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; - -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code404Response { - - public static class Code404Response1 extends ResponseDeserializer { - public Code404Response1() { - super( - MapUtils.makeMap( - ) - ); - } - - @Override - protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { - return null; - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/Code405Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/Code405Response.java deleted file mode 100644 index 350e155a9c0..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/Code405Response.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapijsonschematools.client.paths.pet.put.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; - -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code405Response { - - public static class Code405Response1 extends ResponseDeserializer { - public Code405Response1() { - super( - MapUtils.makeMap( - ) - ); - } - - @Override - protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { - return null; - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/PetPutCode400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/PetPutCode400Response.java new file mode 100644 index 00000000000..f67abd8a562 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/PetPutCode400Response.java @@ -0,0 +1,45 @@ +package org.openapijsonschematools.client.paths.pet.put.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class PetPutCode400Response { + + public static class PetPutCode400Response1 extends ResponseDeserializer { + public PetPutCode400Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/PetPutCode404Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/PetPutCode404Response.java new file mode 100644 index 00000000000..caa7f0ab930 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/PetPutCode404Response.java @@ -0,0 +1,45 @@ +package org.openapijsonschematools.client.paths.pet.put.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class PetPutCode404Response { + + public static class PetPutCode404Response1 extends ResponseDeserializer { + public PetPutCode404Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/PetPutCode405Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/PetPutCode405Response.java new file mode 100644 index 00000000000..117fd9b4d99 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/pet/put/responses/PetPutCode405Response.java @@ -0,0 +1,45 @@ +package org.openapijsonschematools.client.paths.pet.put.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class PetPutCode405Response { + + public static class PetPutCode405Response1 extends ResponseDeserializer { + public PetPutCode405Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/Get.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/Get.java deleted file mode 100644 index aa30e9bf00f..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/Get.java +++ /dev/null @@ -1,203 +0,0 @@ -package org.openapijsonschematools.client.paths.petfindbystatus; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.petfindbystatus.PetfindbystatusServerInfo; -import org.openapijsonschematools.client.paths.petfindbystatus.get.PetfindbystatusGetSecurityInfo; -import org.openapijsonschematools.client.paths.petfindbystatus.get.QueryParameters; -import org.openapijsonschematools.client.paths.petfindbystatus.get.Parameters; -import org.openapijsonschematools.client.paths.petfindbystatus.get.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.paths.Petfindbystatus; -import org.openapijsonschematools.client.securityrequirementobjects.SecurityRequirementObject; -import org.openapijsonschematools.client.securityrequirementobjects.AuthApplier; - -import java.io.IOException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Get { - private static class GetProvider extends AuthApplier { - private static final String method = "get"; - - public static Responses.EndpointResponse get( - GetRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - - var querySerializer = new Parameters.QueryParametersSerializer(); - @Nullable Map queryMap = querySerializer.getQueryMap(request.queryParameters); - String host = apiConfiguration.getServer(request.serverIndex).url(); - SecurityRequirementObject securityRequirementObject = apiConfiguration.getSecurityRequirementObject(request.securityIndex); - updateParamsForAuth( - securityRequirementObject, - headers, - Petfindbystatus.path, - method, - bodyPublisher, - queryMap, - apiConfiguration - ); - - String url = host + Petfindbystatus.path; - if (queryMap != null) { - url = url + querySerializer.serialize(queryMap); - } - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface GetOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Get1 extends ApiClient implements GetOperation { - public Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class GetRequest { - public QueryParameters.QueryParametersMap queryParameters; - public PetfindbystatusServerInfo.@Nullable ServerIndex serverIndex; - public PetfindbystatusGetSecurityInfo.@Nullable SecurityIndex securityIndex; - public @Nullable Duration timeout; - - public GetRequest( - QueryParameters.QueryParametersMap queryParameters, - PetfindbystatusServerInfo.@Nullable ServerIndex serverIndex, - PetfindbystatusGetSecurityInfo.@Nullable SecurityIndex securityIndex, - @Nullable Duration timeout - ) { - this.queryParameters = queryParameters; - this.serverIndex = serverIndex; - this.securityIndex = securityIndex; - this.timeout = timeout; - } - } - - public static class GetNullableRequest { - public QueryParameters.@Nullable QueryParametersMap queryParameters; - public PetfindbystatusServerInfo.@Nullable ServerIndex serverIndex; - public PetfindbystatusGetSecurityInfo.@Nullable SecurityIndex securityIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - GetNullableRequest getInstance(); - T getBuilderAfterServerIndex(GetNullableRequest instance); - default T serverIndex(PetfindbystatusServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForSecurityIndex { - GetNullableRequest getInstance(); - T getBuilderAfterSecurityIndex(GetNullableRequest instance); - default T securityIndex(PetfindbystatusGetSecurityInfo.SecurityIndex securityIndex) { - var instance = getInstance(); - instance.securityIndex = securityIndex; - return getBuilderAfterSecurityIndex(instance); - } - } - - public interface SetterForTimeout { - GetNullableRequest getInstance(); - T getBuilderAfterTimeout(GetNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForQueryParameters { - GetNullableRequest getInstance(); - T getBuilderAfterQueryParameters(GetNullableRequest instance); - default T queryParameters(QueryParameters.QueryParametersMap queryParameters) { - var instance = getInstance(); - instance.queryParameters = queryParameters; - return getBuilderAfterQueryParameters(instance); - } - } - - public static class Get0RequestBuilder implements SetterForServerIndex, SetterForSecurityIndex, SetterForTimeout { - private final GetNullableRequest instance; - - public Get0RequestBuilder(GetNullableRequest instance) { - this.instance = instance; - } - - public GetRequest build() { - var queryParameters = instance.queryParameters; - if (queryParameters == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new GetRequest( - queryParameters, - instance.serverIndex, - instance.securityIndex, - instance.timeout - ); - } - - public GetNullableRequest getInstance() { - return instance; - } - - public Get0RequestBuilder getBuilderAfterServerIndex(GetNullableRequest instance) { - return this; - } - - public Get0RequestBuilder getBuilderAfterSecurityIndex(GetNullableRequest instance) { - return this; - } - - public Get0RequestBuilder getBuilderAfterTimeout(GetNullableRequest instance) { - return this; - } - } - public static class GetRequestBuilder implements SetterForQueryParameters { - private final GetNullableRequest instance; - - public GetRequestBuilder() { - this.instance = new GetNullableRequest(); - } - - public GetNullableRequest getInstance() { - return instance; - } - - public Get0RequestBuilder getBuilderAfterQueryParameters(GetNullableRequest instance) { - return new Get0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/PetfindbystatusGet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/PetfindbystatusGet.java new file mode 100644 index 00000000000..fffaa35e4c2 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/PetfindbystatusGet.java @@ -0,0 +1,212 @@ +package org.openapijsonschematools.client.paths.petfindbystatus; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.petfindbystatus.PetfindbystatusServerInfo; +import org.openapijsonschematools.client.paths.petfindbystatus.get.PetfindbystatusGetSecurityInfo; +import org.openapijsonschematools.client.paths.petfindbystatus.get.PetfindbystatusGetQueryParameters; +import org.openapijsonschematools.client.paths.petfindbystatus.get.Parameters; +import org.openapijsonschematools.client.paths.petfindbystatus.get.PetfindbystatusGetResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.paths.Petfindbystatus; +import org.openapijsonschematools.client.securityrequirementobjects.SecurityRequirementObject; +import org.openapijsonschematools.client.securityrequirementobjects.AuthApplier; + +import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class PetfindbystatusGet { + private static class GetProvider extends AuthApplier { + private static final String method = "get"; + + public static PetfindbystatusGetResponses.EndpointResponse get( + GetRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + + var querySerializer = new Parameters.QueryParametersSerializer(); + @Nullable Map queryMap = querySerializer.getQueryMap(request.queryParameters); + String host = apiConfiguration.getServer(request.serverIndex).url(); + SecurityRequirementObject securityRequirementObject = apiConfiguration.getSecurityRequirementObject(request.securityIndex); + updateParamsForAuth( + securityRequirementObject, + headers, + Petfindbystatus.path, + method, + bodyPublisher, + queryMap, + apiConfiguration + ); + + String url = host + Petfindbystatus.path; + if (queryMap != null) { + url = url + querySerializer.serialize(queryMap); + } + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new PetfindbystatusGetResponses.PetfindbystatusGetResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface GetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default PetfindbystatusGetResponses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface FindPetsByStatusOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default PetfindbystatusGetResponses.EndpointResponse findPetsByStatus(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Get extends ApiClient implements GetOperation { + public Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class GetRequest { + public PetfindbystatusGetQueryParameters.PetfindbystatusGetQueryParametersMap queryParameters; + public PetfindbystatusServerInfo.@Nullable ServerIndex serverIndex; + public PetfindbystatusGetSecurityInfo.@Nullable SecurityIndex securityIndex; + public @Nullable Duration timeout; + + public GetRequest( + PetfindbystatusGetQueryParameters.PetfindbystatusGetQueryParametersMap queryParameters, + PetfindbystatusServerInfo.@Nullable ServerIndex serverIndex, + PetfindbystatusGetSecurityInfo.@Nullable SecurityIndex securityIndex, + @Nullable Duration timeout + ) { + this.queryParameters = queryParameters; + this.serverIndex = serverIndex; + this.securityIndex = securityIndex; + this.timeout = timeout; + } + } + + public static class GetNullableRequest { + public PetfindbystatusGetQueryParameters.@Nullable PetfindbystatusGetQueryParametersMap queryParameters; + public PetfindbystatusServerInfo.@Nullable ServerIndex serverIndex; + public PetfindbystatusGetSecurityInfo.@Nullable SecurityIndex securityIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + GetNullableRequest getInstance(); + T getBuilderAfterServerIndex(GetNullableRequest instance); + default T serverIndex(PetfindbystatusServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForSecurityIndex { + GetNullableRequest getInstance(); + T getBuilderAfterSecurityIndex(GetNullableRequest instance); + default T securityIndex(PetfindbystatusGetSecurityInfo.SecurityIndex securityIndex) { + var instance = getInstance(); + instance.securityIndex = securityIndex; + return getBuilderAfterSecurityIndex(instance); + } + } + + public interface SetterForTimeout { + GetNullableRequest getInstance(); + T getBuilderAfterTimeout(GetNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForQueryParameters { + GetNullableRequest getInstance(); + T getBuilderAfterQueryParameters(GetNullableRequest instance); + default T queryParameters(PetfindbystatusGetQueryParameters.PetfindbystatusGetQueryParametersMap queryParameters) { + var instance = getInstance(); + instance.queryParameters = queryParameters; + return getBuilderAfterQueryParameters(instance); + } + } + + public static class Get0RequestBuilder implements SetterForServerIndex, SetterForSecurityIndex, SetterForTimeout { + private final GetNullableRequest instance; + + public Get0RequestBuilder(GetNullableRequest instance) { + this.instance = instance; + } + + public GetRequest build() { + var queryParameters = instance.queryParameters; + if (queryParameters == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new GetRequest( + queryParameters, + instance.serverIndex, + instance.securityIndex, + instance.timeout + ); + } + + public GetNullableRequest getInstance() { + return instance; + } + + public Get0RequestBuilder getBuilderAfterServerIndex(GetNullableRequest instance) { + return this; + } + + public Get0RequestBuilder getBuilderAfterSecurityIndex(GetNullableRequest instance) { + return this; + } + + public Get0RequestBuilder getBuilderAfterTimeout(GetNullableRequest instance) { + return this; + } + } + public static class GetRequestBuilder implements SetterForQueryParameters { + private final GetNullableRequest instance; + + public GetRequestBuilder() { + this.instance = new GetNullableRequest(); + } + + public GetNullableRequest getInstance() { + return instance; + } + + public Get0RequestBuilder getBuilderAfterQueryParameters(GetNullableRequest instance) { + return new Get0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/PetfindbystatusGetQueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/PetfindbystatusGetQueryParameters.java new file mode 100644 index 00000000000..79899cbd2ce --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/PetfindbystatusGetQueryParameters.java @@ -0,0 +1,206 @@ +package org.openapijsonschematools.client.paths.petfindbystatus.get; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.petfindbystatus.get.parameters.parameter0.Schema0; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class PetfindbystatusGetQueryParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class PetfindbystatusGetadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable PetfindbystatusGetadditionalProperties instance = null; + public static PetfindbystatusGetadditionalProperties getInstance() { + if (instance == null) { + instance = new PetfindbystatusGetadditionalProperties(); + } + return instance; + } + } + + + public static class PetfindbystatusGetQueryParametersMap extends FrozenMap { + protected PetfindbystatusGetQueryParametersMap(FrozenMap m) { + super(m); + } + public static final Set requiredKeys = Set.of( + "status" + ); + public static final Set optionalKeys = Set.of(); + public static PetfindbystatusGetQueryParametersMap of(Map> arg, SchemaConfiguration configuration) throws ValidationException { + return PetfindbystatusGetQueryParameters1.getInstance().validate(arg, configuration); + } + + public Schema0.SchemaList0 status() { + try { + return getOrThrow("version"); + } catch (UnsetPropertyException e) { + throw new RuntimeException(e); + } + } + } + + public interface SetterForPetfindbystatusGetstatus { + Map> getInstance(); + T getBuilderAfterPetfindbystatusGetstatus(Map> instance); + + default T status(List value) { + var instance = getInstance(); + instance.put("status", value); + return getBuilderAfterPetfindbystatusGetstatus(instance); + } + } + + public static class PetfindbystatusGetQueryParametersMap0Builder implements GenericBuilder>> { + private final Map> instance; + private static final Set knownKeys = Set.of( + "status" + ); + public Set getKnownKeys() { + return knownKeys; + } + public PetfindbystatusGetQueryParametersMap0Builder(Map> instance) { + this.instance = instance; + } + public Map> build() { + return instance; + } + } + + public static class PetfindbystatusGetQueryParametersMapBuilder implements SetterForPetfindbystatusGetstatus { + private final Map> instance; + public PetfindbystatusGetQueryParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map> getInstance() { + return instance; + } + public PetfindbystatusGetQueryParametersMap0Builder getBuilderAfterPetfindbystatusGetstatus(Map> instance) { + return new PetfindbystatusGetQueryParametersMap0Builder(instance); + } + } + + + public sealed interface PetfindbystatusGetQueryParameters1Boxed permits PetfindbystatusGetQueryParameters1BoxedMap { + @Nullable Object getData(); + } + + public record PetfindbystatusGetQueryParameters1BoxedMap(PetfindbystatusGetQueryParametersMap data) implements PetfindbystatusGetQueryParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class PetfindbystatusGetQueryParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable PetfindbystatusGetQueryParameters1 instance = null; + + protected PetfindbystatusGetQueryParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("status", Schema0.Schema01.class) + )) + .required(Set.of( + "status" + )) + .additionalProperties(PetfindbystatusGetadditionalProperties.class) + ); + } + + public static PetfindbystatusGetQueryParameters1 getInstance() { + if (instance == null) { + instance = new PetfindbystatusGetQueryParameters1(); + } + return instance; + } + + public PetfindbystatusGetQueryParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Schema0.SchemaList0)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (Schema0.SchemaList0) propertyInstance); + } + FrozenMap castProperties = new FrozenMap<>(properties); + return new PetfindbystatusGetQueryParametersMap(castProperties); + } + + public PetfindbystatusGetQueryParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public PetfindbystatusGetQueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new PetfindbystatusGetQueryParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public PetfindbystatusGetQueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/PetfindbystatusGetResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/PetfindbystatusGetResponses.java new file mode 100644 index 00000000000..c4507e80287 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/PetfindbystatusGetResponses.java @@ -0,0 +1,66 @@ +package org.openapijsonschematools.client.paths.petfindbystatus.get; + +import org.openapijsonschematools.client.paths.petfindbystatus.get.responses.PetfindbystatusGetCode200Response; +import org.openapijsonschematools.client.paths.petfindbystatus.get.responses.PetfindbystatusGetCode400Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class PetfindbystatusGetResponses { + public sealed interface EndpointResponse permits EndpointPetfindbystatusGetCode200Response {} + + public record EndpointPetfindbystatusGetCode200Response( + HttpResponse response, + PetfindbystatusGetCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusPetfindbystatusGetCode200ResponseDeserializer, StatusPetfindbystatusGetCode400ResponseDeserializer {} + + public static final class StatusPetfindbystatusGetCode200ResponseDeserializer extends PetfindbystatusGetCode200Response.PetfindbystatusGetCode200Response1 implements StatusCodeResponseDeserializer { + } + public static final class StatusPetfindbystatusGetCode400ResponseDeserializer extends PetfindbystatusGetCode400Response.PetfindbystatusGetCode400Response1 implements StatusCodeResponseDeserializer { + } + + public static final class PetfindbystatusGetResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public PetfindbystatusGetResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusPetfindbystatusGetCode200ResponseDeserializer()), + new AbstractMap.SimpleEntry<>("400", new StatusPetfindbystatusGetCode400ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + if (statusCodeDeserializer instanceof StatusPetfindbystatusGetCode200ResponseDeserializer castDeserializer) { + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointPetfindbystatusGetCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } else { + StatusPetfindbystatusGetCode400ResponseDeserializer castDeserializer = (StatusPetfindbystatusGetCode400ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + throw new PetfindbystatusGetCode400Response.ResponseApiException( + "Received error statusCode response from server", + response, + deserializedResponse + ); + } + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/QueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/QueryParameters.java deleted file mode 100644 index 0dcdbdf49d3..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/QueryParameters.java +++ /dev/null @@ -1,206 +0,0 @@ -package org.openapijsonschematools.client.paths.petfindbystatus.get; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.petfindbystatus.get.parameters.parameter0.Schema0; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class QueryParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class QueryParametersMap extends FrozenMap { - protected QueryParametersMap(FrozenMap m) { - super(m); - } - public static final Set requiredKeys = Set.of( - "status" - ); - public static final Set optionalKeys = Set.of(); - public static QueryParametersMap of(Map> arg, SchemaConfiguration configuration) throws ValidationException { - return QueryParameters1.getInstance().validate(arg, configuration); - } - - public Schema0.SchemaList0 status() { - try { - return getOrThrow("version"); - } catch (UnsetPropertyException e) { - throw new RuntimeException(e); - } - } - } - - public interface SetterForStatus { - Map> getInstance(); - T getBuilderAfterStatus(Map> instance); - - default T status(List value) { - var instance = getInstance(); - instance.put("status", value); - return getBuilderAfterStatus(instance); - } - } - - public static class QueryParametersMap0Builder implements GenericBuilder>> { - private final Map> instance; - private static final Set knownKeys = Set.of( - "status" - ); - public Set getKnownKeys() { - return knownKeys; - } - public QueryParametersMap0Builder(Map> instance) { - this.instance = instance; - } - public Map> build() { - return instance; - } - } - - public static class QueryParametersMapBuilder implements SetterForStatus { - private final Map> instance; - public QueryParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map> getInstance() { - return instance; - } - public QueryParametersMap0Builder getBuilderAfterStatus(Map> instance) { - return new QueryParametersMap0Builder(instance); - } - } - - - public sealed interface QueryParameters1Boxed permits QueryParameters1BoxedMap { - @Nullable Object getData(); - } - - public record QueryParameters1BoxedMap(QueryParametersMap data) implements QueryParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable QueryParameters1 instance = null; - - protected QueryParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("status", Schema0.Schema01.class) - )) - .required(Set.of( - "status" - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static QueryParameters1 getInstance() { - if (instance == null) { - instance = new QueryParameters1(); - } - return instance; - } - - public QueryParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - if (!(propertyInstance instanceof Schema0.SchemaList0)) { - throw new RuntimeException("Invalid instantiated value"); - } - properties.put(propertyName, (Schema0.SchemaList0) propertyInstance); - } - FrozenMap castProperties = new FrozenMap<>(properties); - return new QueryParametersMap(castProperties); - } - - public QueryParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public QueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new QueryParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public QueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/Responses.java deleted file mode 100644 index 4e008e2a33b..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/Responses.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.openapijsonschematools.client.paths.petfindbystatus.get; - -import org.openapijsonschematools.client.paths.petfindbystatus.get.responses.Code200Response; -import org.openapijsonschematools.client.paths.petfindbystatus.get.responses.Code400Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer, StatusCode400ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - public static final class StatusCode400ResponseDeserializer extends Code400Response.Code400Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()), - new AbstractMap.SimpleEntry<>("400", new StatusCode400ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - if (statusCodeDeserializer instanceof StatusCode200ResponseDeserializer castDeserializer) { - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } else { - StatusCode400ResponseDeserializer castDeserializer = (StatusCode400ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - throw new Code400Response.ResponseApiException( - "Received error statusCode response from server", - response, - deserializedResponse - ); - } - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/responses/Code200Response.java deleted file mode 100644 index 0bfcce006b9..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/responses/Code200Response.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.openapijsonschematools.client.paths.petfindbystatus.get.responses; - -import org.openapijsonschematools.client.components.responses.SuccessfulXmlAndJsonArrayOfPet; - -public class Code200Response extends SuccessfulXmlAndJsonArrayOfPet { - public static class Code200Response1 extends SuccessfulXmlAndJsonArrayOfPet1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/responses/Code400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/responses/Code400Response.java deleted file mode 100644 index 3ea6e1da098..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/responses/Code400Response.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapijsonschematools.client.paths.petfindbystatus.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; - -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code400Response { - - public static class Code400Response1 extends ResponseDeserializer { - public Code400Response1() { - super( - MapUtils.makeMap( - ) - ); - } - - @Override - protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { - return null; - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/responses/PetfindbystatusGetCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/responses/PetfindbystatusGetCode200Response.java new file mode 100644 index 00000000000..824d60a6907 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/responses/PetfindbystatusGetCode200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.petfindbystatus.get.responses; + +import org.openapijsonschematools.client.components.responses.SuccessfulXmlAndJsonArrayOfPet; + +public class PetfindbystatusGetCode200Response extends SuccessfulXmlAndJsonArrayOfPet { + public static class PetfindbystatusGetCode200Response1 extends SuccessfulXmlAndJsonArrayOfPet1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/responses/PetfindbystatusGetCode400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/responses/PetfindbystatusGetCode400Response.java new file mode 100644 index 00000000000..d05bfe4df56 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbystatus/get/responses/PetfindbystatusGetCode400Response.java @@ -0,0 +1,45 @@ +package org.openapijsonschematools.client.paths.petfindbystatus.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class PetfindbystatusGetCode400Response { + + public static class PetfindbystatusGetCode400Response1 extends ResponseDeserializer { + public PetfindbystatusGetCode400Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/Get.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/Get.java deleted file mode 100644 index f29d6b59081..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/Get.java +++ /dev/null @@ -1,203 +0,0 @@ -package org.openapijsonschematools.client.paths.petfindbytags; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.petfindbytags.get.PetfindbytagsGetSecurityInfo; -import org.openapijsonschematools.client.paths.petfindbytags.get.QueryParameters; -import org.openapijsonschematools.client.paths.petfindbytags.get.Parameters; -import org.openapijsonschematools.client.paths.petfindbytags.get.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.paths.Petfindbytags; -import org.openapijsonschematools.client.securityrequirementobjects.SecurityRequirementObject; -import org.openapijsonschematools.client.securityrequirementobjects.AuthApplier; - -import java.io.IOException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Get { - private static class GetProvider extends AuthApplier { - private static final String method = "get"; - - public static Responses.EndpointResponse get( - GetRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - - var querySerializer = new Parameters.QueryParametersSerializer(); - @Nullable Map queryMap = querySerializer.getQueryMap(request.queryParameters); - String host = apiConfiguration.getServer(request.serverIndex).url(); - SecurityRequirementObject securityRequirementObject = apiConfiguration.getSecurityRequirementObject(request.securityIndex); - updateParamsForAuth( - securityRequirementObject, - headers, - Petfindbytags.path, - method, - bodyPublisher, - queryMap, - apiConfiguration - ); - - String url = host + Petfindbytags.path; - if (queryMap != null) { - url = url + querySerializer.serialize(queryMap); - } - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface GetOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Get1 extends ApiClient implements GetOperation { - public Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class GetRequest { - public QueryParameters.QueryParametersMap queryParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public PetfindbytagsGetSecurityInfo.@Nullable SecurityIndex securityIndex; - public @Nullable Duration timeout; - - public GetRequest( - QueryParameters.QueryParametersMap queryParameters, - RootServerInfo.@Nullable ServerIndex serverIndex, - PetfindbytagsGetSecurityInfo.@Nullable SecurityIndex securityIndex, - @Nullable Duration timeout - ) { - this.queryParameters = queryParameters; - this.serverIndex = serverIndex; - this.securityIndex = securityIndex; - this.timeout = timeout; - } - } - - public static class GetNullableRequest { - public QueryParameters.@Nullable QueryParametersMap queryParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public PetfindbytagsGetSecurityInfo.@Nullable SecurityIndex securityIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - GetNullableRequest getInstance(); - T getBuilderAfterServerIndex(GetNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForSecurityIndex { - GetNullableRequest getInstance(); - T getBuilderAfterSecurityIndex(GetNullableRequest instance); - default T securityIndex(PetfindbytagsGetSecurityInfo.SecurityIndex securityIndex) { - var instance = getInstance(); - instance.securityIndex = securityIndex; - return getBuilderAfterSecurityIndex(instance); - } - } - - public interface SetterForTimeout { - GetNullableRequest getInstance(); - T getBuilderAfterTimeout(GetNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForQueryParameters { - GetNullableRequest getInstance(); - T getBuilderAfterQueryParameters(GetNullableRequest instance); - default T queryParameters(QueryParameters.QueryParametersMap queryParameters) { - var instance = getInstance(); - instance.queryParameters = queryParameters; - return getBuilderAfterQueryParameters(instance); - } - } - - public static class Get0RequestBuilder implements SetterForServerIndex, SetterForSecurityIndex, SetterForTimeout { - private final GetNullableRequest instance; - - public Get0RequestBuilder(GetNullableRequest instance) { - this.instance = instance; - } - - public GetRequest build() { - var queryParameters = instance.queryParameters; - if (queryParameters == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new GetRequest( - queryParameters, - instance.serverIndex, - instance.securityIndex, - instance.timeout - ); - } - - public GetNullableRequest getInstance() { - return instance; - } - - public Get0RequestBuilder getBuilderAfterServerIndex(GetNullableRequest instance) { - return this; - } - - public Get0RequestBuilder getBuilderAfterSecurityIndex(GetNullableRequest instance) { - return this; - } - - public Get0RequestBuilder getBuilderAfterTimeout(GetNullableRequest instance) { - return this; - } - } - public static class GetRequestBuilder implements SetterForQueryParameters { - private final GetNullableRequest instance; - - public GetRequestBuilder() { - this.instance = new GetNullableRequest(); - } - - public GetNullableRequest getInstance() { - return instance; - } - - public Get0RequestBuilder getBuilderAfterQueryParameters(GetNullableRequest instance) { - return new Get0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/PetfindbytagsGet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/PetfindbytagsGet.java new file mode 100644 index 00000000000..318fd196bae --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/PetfindbytagsGet.java @@ -0,0 +1,212 @@ +package org.openapijsonschematools.client.paths.petfindbytags; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.petfindbytags.get.PetfindbytagsGetSecurityInfo; +import org.openapijsonschematools.client.paths.petfindbytags.get.PetfindbytagsGetQueryParameters; +import org.openapijsonschematools.client.paths.petfindbytags.get.Parameters; +import org.openapijsonschematools.client.paths.petfindbytags.get.PetfindbytagsGetResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.paths.Petfindbytags; +import org.openapijsonschematools.client.securityrequirementobjects.SecurityRequirementObject; +import org.openapijsonschematools.client.securityrequirementobjects.AuthApplier; + +import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class PetfindbytagsGet { + private static class GetProvider extends AuthApplier { + private static final String method = "get"; + + public static PetfindbytagsGetResponses.EndpointResponse get( + GetRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + + var querySerializer = new Parameters.QueryParametersSerializer(); + @Nullable Map queryMap = querySerializer.getQueryMap(request.queryParameters); + String host = apiConfiguration.getServer(request.serverIndex).url(); + SecurityRequirementObject securityRequirementObject = apiConfiguration.getSecurityRequirementObject(request.securityIndex); + updateParamsForAuth( + securityRequirementObject, + headers, + Petfindbytags.path, + method, + bodyPublisher, + queryMap, + apiConfiguration + ); + + String url = host + Petfindbytags.path; + if (queryMap != null) { + url = url + querySerializer.serialize(queryMap); + } + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new PetfindbytagsGetResponses.PetfindbytagsGetResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface GetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default PetfindbytagsGetResponses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface FindPetsByTagsOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default PetfindbytagsGetResponses.EndpointResponse findPetsByTags(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Get extends ApiClient implements GetOperation { + public Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class GetRequest { + public PetfindbytagsGetQueryParameters.PetfindbytagsGetQueryParametersMap queryParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public PetfindbytagsGetSecurityInfo.@Nullable SecurityIndex securityIndex; + public @Nullable Duration timeout; + + public GetRequest( + PetfindbytagsGetQueryParameters.PetfindbytagsGetQueryParametersMap queryParameters, + RootServerInfo.@Nullable ServerIndex serverIndex, + PetfindbytagsGetSecurityInfo.@Nullable SecurityIndex securityIndex, + @Nullable Duration timeout + ) { + this.queryParameters = queryParameters; + this.serverIndex = serverIndex; + this.securityIndex = securityIndex; + this.timeout = timeout; + } + } + + public static class GetNullableRequest { + public PetfindbytagsGetQueryParameters.@Nullable PetfindbytagsGetQueryParametersMap queryParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public PetfindbytagsGetSecurityInfo.@Nullable SecurityIndex securityIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + GetNullableRequest getInstance(); + T getBuilderAfterServerIndex(GetNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForSecurityIndex { + GetNullableRequest getInstance(); + T getBuilderAfterSecurityIndex(GetNullableRequest instance); + default T securityIndex(PetfindbytagsGetSecurityInfo.SecurityIndex securityIndex) { + var instance = getInstance(); + instance.securityIndex = securityIndex; + return getBuilderAfterSecurityIndex(instance); + } + } + + public interface SetterForTimeout { + GetNullableRequest getInstance(); + T getBuilderAfterTimeout(GetNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForQueryParameters { + GetNullableRequest getInstance(); + T getBuilderAfterQueryParameters(GetNullableRequest instance); + default T queryParameters(PetfindbytagsGetQueryParameters.PetfindbytagsGetQueryParametersMap queryParameters) { + var instance = getInstance(); + instance.queryParameters = queryParameters; + return getBuilderAfterQueryParameters(instance); + } + } + + public static class Get0RequestBuilder implements SetterForServerIndex, SetterForSecurityIndex, SetterForTimeout { + private final GetNullableRequest instance; + + public Get0RequestBuilder(GetNullableRequest instance) { + this.instance = instance; + } + + public GetRequest build() { + var queryParameters = instance.queryParameters; + if (queryParameters == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new GetRequest( + queryParameters, + instance.serverIndex, + instance.securityIndex, + instance.timeout + ); + } + + public GetNullableRequest getInstance() { + return instance; + } + + public Get0RequestBuilder getBuilderAfterServerIndex(GetNullableRequest instance) { + return this; + } + + public Get0RequestBuilder getBuilderAfterSecurityIndex(GetNullableRequest instance) { + return this; + } + + public Get0RequestBuilder getBuilderAfterTimeout(GetNullableRequest instance) { + return this; + } + } + public static class GetRequestBuilder implements SetterForQueryParameters { + private final GetNullableRequest instance; + + public GetRequestBuilder() { + this.instance = new GetNullableRequest(); + } + + public GetNullableRequest getInstance() { + return instance; + } + + public Get0RequestBuilder getBuilderAfterQueryParameters(GetNullableRequest instance) { + return new Get0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/PetfindbytagsGetQueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/PetfindbytagsGetQueryParameters.java new file mode 100644 index 00000000000..d5b4b8853ab --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/PetfindbytagsGetQueryParameters.java @@ -0,0 +1,206 @@ +package org.openapijsonschematools.client.paths.petfindbytags.get; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.petfindbytags.get.parameters.parameter0.Schema0; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenList; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class PetfindbytagsGetQueryParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class PetfindbytagsGetadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable PetfindbytagsGetadditionalProperties instance = null; + public static PetfindbytagsGetadditionalProperties getInstance() { + if (instance == null) { + instance = new PetfindbytagsGetadditionalProperties(); + } + return instance; + } + } + + + public static class PetfindbytagsGetQueryParametersMap extends FrozenMap { + protected PetfindbytagsGetQueryParametersMap(FrozenMap m) { + super(m); + } + public static final Set requiredKeys = Set.of( + "tags" + ); + public static final Set optionalKeys = Set.of(); + public static PetfindbytagsGetQueryParametersMap of(Map> arg, SchemaConfiguration configuration) throws ValidationException { + return PetfindbytagsGetQueryParameters1.getInstance().validate(arg, configuration); + } + + public Schema0.SchemaList0 tags() { + try { + return getOrThrow("version"); + } catch (UnsetPropertyException e) { + throw new RuntimeException(e); + } + } + } + + public interface SetterForPetfindbytagsGettags { + Map> getInstance(); + T getBuilderAfterPetfindbytagsGettags(Map> instance); + + default T tags(List value) { + var instance = getInstance(); + instance.put("tags", value); + return getBuilderAfterPetfindbytagsGettags(instance); + } + } + + public static class PetfindbytagsGetQueryParametersMap0Builder implements GenericBuilder>> { + private final Map> instance; + private static final Set knownKeys = Set.of( + "tags" + ); + public Set getKnownKeys() { + return knownKeys; + } + public PetfindbytagsGetQueryParametersMap0Builder(Map> instance) { + this.instance = instance; + } + public Map> build() { + return instance; + } + } + + public static class PetfindbytagsGetQueryParametersMapBuilder implements SetterForPetfindbytagsGettags { + private final Map> instance; + public PetfindbytagsGetQueryParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map> getInstance() { + return instance; + } + public PetfindbytagsGetQueryParametersMap0Builder getBuilderAfterPetfindbytagsGettags(Map> instance) { + return new PetfindbytagsGetQueryParametersMap0Builder(instance); + } + } + + + public sealed interface PetfindbytagsGetQueryParameters1Boxed permits PetfindbytagsGetQueryParameters1BoxedMap { + @Nullable Object getData(); + } + + public record PetfindbytagsGetQueryParameters1BoxedMap(PetfindbytagsGetQueryParametersMap data) implements PetfindbytagsGetQueryParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class PetfindbytagsGetQueryParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable PetfindbytagsGetQueryParameters1 instance = null; + + protected PetfindbytagsGetQueryParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("tags", Schema0.Schema01.class) + )) + .required(Set.of( + "tags" + )) + .additionalProperties(PetfindbytagsGetadditionalProperties.class) + ); + } + + public static PetfindbytagsGetQueryParameters1 getInstance() { + if (instance == null) { + instance = new PetfindbytagsGetQueryParameters1(); + } + return instance; + } + + public PetfindbytagsGetQueryParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Schema0.SchemaList0)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (Schema0.SchemaList0) propertyInstance); + } + FrozenMap castProperties = new FrozenMap<>(properties); + return new PetfindbytagsGetQueryParametersMap(castProperties); + } + + public PetfindbytagsGetQueryParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public PetfindbytagsGetQueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new PetfindbytagsGetQueryParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public PetfindbytagsGetQueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/PetfindbytagsGetResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/PetfindbytagsGetResponses.java new file mode 100644 index 00000000000..9129f784d43 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/PetfindbytagsGetResponses.java @@ -0,0 +1,66 @@ +package org.openapijsonschematools.client.paths.petfindbytags.get; + +import org.openapijsonschematools.client.paths.petfindbytags.get.responses.PetfindbytagsGetCode200Response; +import org.openapijsonschematools.client.paths.petfindbytags.get.responses.PetfindbytagsGetCode400Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class PetfindbytagsGetResponses { + public sealed interface EndpointResponse permits EndpointPetfindbytagsGetCode200Response {} + + public record EndpointPetfindbytagsGetCode200Response( + HttpResponse response, + PetfindbytagsGetCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusPetfindbytagsGetCode200ResponseDeserializer, StatusPetfindbytagsGetCode400ResponseDeserializer {} + + public static final class StatusPetfindbytagsGetCode200ResponseDeserializer extends PetfindbytagsGetCode200Response.PetfindbytagsGetCode200Response1 implements StatusCodeResponseDeserializer { + } + public static final class StatusPetfindbytagsGetCode400ResponseDeserializer extends PetfindbytagsGetCode400Response.PetfindbytagsGetCode400Response1 implements StatusCodeResponseDeserializer { + } + + public static final class PetfindbytagsGetResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public PetfindbytagsGetResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusPetfindbytagsGetCode200ResponseDeserializer()), + new AbstractMap.SimpleEntry<>("400", new StatusPetfindbytagsGetCode400ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + if (statusCodeDeserializer instanceof StatusPetfindbytagsGetCode200ResponseDeserializer castDeserializer) { + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointPetfindbytagsGetCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } else { + StatusPetfindbytagsGetCode400ResponseDeserializer castDeserializer = (StatusPetfindbytagsGetCode400ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + throw new PetfindbytagsGetCode400Response.ResponseApiException( + "Received error statusCode response from server", + response, + deserializedResponse + ); + } + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/QueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/QueryParameters.java deleted file mode 100644 index 4352f51e740..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/QueryParameters.java +++ /dev/null @@ -1,206 +0,0 @@ -package org.openapijsonschematools.client.paths.petfindbytags.get; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.petfindbytags.get.parameters.parameter0.Schema0; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenList; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class QueryParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class QueryParametersMap extends FrozenMap { - protected QueryParametersMap(FrozenMap m) { - super(m); - } - public static final Set requiredKeys = Set.of( - "tags" - ); - public static final Set optionalKeys = Set.of(); - public static QueryParametersMap of(Map> arg, SchemaConfiguration configuration) throws ValidationException { - return QueryParameters1.getInstance().validate(arg, configuration); - } - - public Schema0.SchemaList0 tags() { - try { - return getOrThrow("version"); - } catch (UnsetPropertyException e) { - throw new RuntimeException(e); - } - } - } - - public interface SetterForTags { - Map> getInstance(); - T getBuilderAfterTags(Map> instance); - - default T tags(List value) { - var instance = getInstance(); - instance.put("tags", value); - return getBuilderAfterTags(instance); - } - } - - public static class QueryParametersMap0Builder implements GenericBuilder>> { - private final Map> instance; - private static final Set knownKeys = Set.of( - "tags" - ); - public Set getKnownKeys() { - return knownKeys; - } - public QueryParametersMap0Builder(Map> instance) { - this.instance = instance; - } - public Map> build() { - return instance; - } - } - - public static class QueryParametersMapBuilder implements SetterForTags { - private final Map> instance; - public QueryParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map> getInstance() { - return instance; - } - public QueryParametersMap0Builder getBuilderAfterTags(Map> instance) { - return new QueryParametersMap0Builder(instance); - } - } - - - public sealed interface QueryParameters1Boxed permits QueryParameters1BoxedMap { - @Nullable Object getData(); - } - - public record QueryParameters1BoxedMap(QueryParametersMap data) implements QueryParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable QueryParameters1 instance = null; - - protected QueryParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("tags", Schema0.Schema01.class) - )) - .required(Set.of( - "tags" - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static QueryParameters1 getInstance() { - if (instance == null) { - instance = new QueryParameters1(); - } - return instance; - } - - public QueryParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - if (!(propertyInstance instanceof Schema0.SchemaList0)) { - throw new RuntimeException("Invalid instantiated value"); - } - properties.put(propertyName, (Schema0.SchemaList0) propertyInstance); - } - FrozenMap castProperties = new FrozenMap<>(properties); - return new QueryParametersMap(castProperties); - } - - public QueryParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public QueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new QueryParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public QueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/Responses.java deleted file mode 100644 index b29be24d716..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/Responses.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.openapijsonschematools.client.paths.petfindbytags.get; - -import org.openapijsonschematools.client.paths.petfindbytags.get.responses.Code200Response; -import org.openapijsonschematools.client.paths.petfindbytags.get.responses.Code400Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer, StatusCode400ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - public static final class StatusCode400ResponseDeserializer extends Code400Response.Code400Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()), - new AbstractMap.SimpleEntry<>("400", new StatusCode400ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - if (statusCodeDeserializer instanceof StatusCode200ResponseDeserializer castDeserializer) { - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } else { - StatusCode400ResponseDeserializer castDeserializer = (StatusCode400ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - throw new Code400Response.ResponseApiException( - "Received error statusCode response from server", - response, - deserializedResponse - ); - } - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/responses/Code200Response.java deleted file mode 100644 index ab2690f07ef..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/responses/Code200Response.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.openapijsonschematools.client.paths.petfindbytags.get.responses; - -import org.openapijsonschematools.client.components.responses.RefSuccessfulXmlAndJsonArrayOfPet; - -public class Code200Response extends RefSuccessfulXmlAndJsonArrayOfPet { - public static class Code200Response1 extends RefSuccessfulXmlAndJsonArrayOfPet1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/responses/Code400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/responses/Code400Response.java deleted file mode 100644 index b674ee9ab33..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/responses/Code400Response.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapijsonschematools.client.paths.petfindbytags.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; - -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code400Response { - - public static class Code400Response1 extends ResponseDeserializer { - public Code400Response1() { - super( - MapUtils.makeMap( - ) - ); - } - - @Override - protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { - return null; - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/responses/PetfindbytagsGetCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/responses/PetfindbytagsGetCode200Response.java new file mode 100644 index 00000000000..bd576d29b7e --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/responses/PetfindbytagsGetCode200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.petfindbytags.get.responses; + +import org.openapijsonschematools.client.components.responses.RefSuccessfulXmlAndJsonArrayOfPet; + +public class PetfindbytagsGetCode200Response extends RefSuccessfulXmlAndJsonArrayOfPet { + public static class PetfindbytagsGetCode200Response1 extends RefSuccessfulXmlAndJsonArrayOfPet1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/responses/PetfindbytagsGetCode400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/responses/PetfindbytagsGetCode400Response.java new file mode 100644 index 00000000000..96f6f4fc9fa --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petfindbytags/get/responses/PetfindbytagsGetCode400Response.java @@ -0,0 +1,45 @@ +package org.openapijsonschematools.client.paths.petfindbytags.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class PetfindbytagsGetCode400Response { + + public static class PetfindbytagsGetCode400Response1 extends ResponseDeserializer { + public PetfindbytagsGetCode400Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/Delete.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/Delete.java deleted file mode 100644 index 4504536c416..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/Delete.java +++ /dev/null @@ -1,228 +0,0 @@ -package org.openapijsonschematools.client.paths.petpetid; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.petpetid.delete.HeaderParameters; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.petpetid.delete.PetpetidDeleteSecurityInfo; -import org.openapijsonschematools.client.paths.petpetid.delete.PathParameters; -import org.openapijsonschematools.client.paths.petpetid.delete.Parameters; -import org.openapijsonschematools.client.paths.petpetid.delete.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.paths.Petpetid; -import org.openapijsonschematools.client.securityrequirementobjects.SecurityRequirementObject; -import org.openapijsonschematools.client.securityrequirementobjects.AuthApplier; - -import java.io.IOException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Delete { - private static class DeleteProvider extends AuthApplier { - private static final String method = "delete"; - - public static Void delete( - DeleteRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - - if (request.headerParameters != null) { - var headersSerializer = new Parameters.HeaderParametersSerializer(); - Map> serializedHeaders = headersSerializer.serialize(request.headerParameters); - headers.putAll(serializedHeaders); - } - - var pathSerializer = new Parameters.PathParametersSerializer(); - String updatedPath = pathSerializer.serialize(request.pathParameters, Petpetid.path); - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - SecurityRequirementObject securityRequirementObject = apiConfiguration.getSecurityRequirementObject(request.securityIndex); - updateParamsForAuth( - securityRequirementObject, - headers, - updatedPath, - method, - bodyPublisher, - queryMap, - apiConfiguration - ); - - String url = host + updatedPath; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface DeleteOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Void delete(DeleteRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return DeleteProvider.delete(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Delete1 extends ApiClient implements DeleteOperation { - public Delete1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class DeleteRequest { - public PathParameters.PathParametersMap pathParameters; - public HeaderParameters.@Nullable HeaderParametersMap headerParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public PetpetidDeleteSecurityInfo.@Nullable SecurityIndex securityIndex; - public @Nullable Duration timeout; - - public DeleteRequest( - PathParameters.PathParametersMap pathParameters, - HeaderParameters.@Nullable HeaderParametersMap headerParameters, - RootServerInfo.@Nullable ServerIndex serverIndex, - PetpetidDeleteSecurityInfo.@Nullable SecurityIndex securityIndex, - @Nullable Duration timeout - ) { - this.pathParameters = pathParameters; - this.headerParameters = headerParameters; - this.serverIndex = serverIndex; - this.securityIndex = securityIndex; - this.timeout = timeout; - } - } - - public static class DeleteNullableRequest { - public PathParameters.@Nullable PathParametersMap pathParameters; - public HeaderParameters.@Nullable HeaderParametersMap headerParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public PetpetidDeleteSecurityInfo.@Nullable SecurityIndex securityIndex; - public @Nullable Duration timeout; - } - - public interface SetterForHeaderParameters { - DeleteNullableRequest getInstance(); - T getBuilderAfterHeaderParameters(DeleteNullableRequest instance); - default T headerParameters(HeaderParameters.HeaderParametersMap headerParameters) { - var instance = getInstance(); - instance.headerParameters = headerParameters; - return getBuilderAfterHeaderParameters(instance); - } - } - - public interface SetterForServerIndex { - DeleteNullableRequest getInstance(); - T getBuilderAfterServerIndex(DeleteNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForSecurityIndex { - DeleteNullableRequest getInstance(); - T getBuilderAfterSecurityIndex(DeleteNullableRequest instance); - default T securityIndex(PetpetidDeleteSecurityInfo.SecurityIndex securityIndex) { - var instance = getInstance(); - instance.securityIndex = securityIndex; - return getBuilderAfterSecurityIndex(instance); - } - } - - public interface SetterForTimeout { - DeleteNullableRequest getInstance(); - T getBuilderAfterTimeout(DeleteNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForPathParameters { - DeleteNullableRequest getInstance(); - T getBuilderAfterPathParameters(DeleteNullableRequest instance); - default T pathParameters(PathParameters.PathParametersMap pathParameters) { - var instance = getInstance(); - instance.pathParameters = pathParameters; - return getBuilderAfterPathParameters(instance); - } - } - - public static class Delete0RequestBuilder implements SetterForHeaderParameters, SetterForServerIndex, SetterForSecurityIndex, SetterForTimeout { - private final DeleteNullableRequest instance; - - public Delete0RequestBuilder(DeleteNullableRequest instance) { - this.instance = instance; - } - - public DeleteRequest build() { - var pathParameters = instance.pathParameters; - if (pathParameters == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new DeleteRequest( - pathParameters, - instance.headerParameters, - instance.serverIndex, - instance.securityIndex, - instance.timeout - ); - } - - public DeleteNullableRequest getInstance() { - return instance; - } - - public Delete0RequestBuilder getBuilderAfterHeaderParameters(DeleteNullableRequest instance) { - return this; - } - - public Delete0RequestBuilder getBuilderAfterServerIndex(DeleteNullableRequest instance) { - return this; - } - - public Delete0RequestBuilder getBuilderAfterSecurityIndex(DeleteNullableRequest instance) { - return this; - } - - public Delete0RequestBuilder getBuilderAfterTimeout(DeleteNullableRequest instance) { - return this; - } - } - public static class DeleteRequestBuilder implements SetterForPathParameters { - private final DeleteNullableRequest instance; - - public DeleteRequestBuilder() { - this.instance = new DeleteNullableRequest(); - } - - public DeleteNullableRequest getInstance() { - return instance; - } - - public Delete0RequestBuilder getBuilderAfterPathParameters(DeleteNullableRequest instance) { - return new Delete0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/Get.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/Get.java deleted file mode 100644 index d61d683a408..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/Get.java +++ /dev/null @@ -1,202 +0,0 @@ -package org.openapijsonschematools.client.paths.petpetid; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.petpetid.get.PetpetidGetSecurityInfo; -import org.openapijsonschematools.client.paths.petpetid.get.PathParameters; -import org.openapijsonschematools.client.paths.petpetid.get.Parameters; -import org.openapijsonschematools.client.paths.petpetid.get.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.paths.Petpetid; -import org.openapijsonschematools.client.securityrequirementobjects.SecurityRequirementObject; -import org.openapijsonschematools.client.securityrequirementobjects.AuthApplier; - -import java.io.IOException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Get { - private static class GetProvider extends AuthApplier { - private static final String method = "get"; - - public static Responses.EndpointResponse get( - GetRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - - var pathSerializer = new Parameters.PathParametersSerializer(); - String updatedPath = pathSerializer.serialize(request.pathParameters, Petpetid.path); - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - SecurityRequirementObject securityRequirementObject = apiConfiguration.getSecurityRequirementObject(request.securityIndex); - updateParamsForAuth( - securityRequirementObject, - headers, - updatedPath, - method, - bodyPublisher, - queryMap, - apiConfiguration - ); - - String url = host + updatedPath; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface GetOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Get1 extends ApiClient implements GetOperation { - public Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class GetRequest { - public PathParameters.PathParametersMap pathParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public PetpetidGetSecurityInfo.@Nullable SecurityIndex securityIndex; - public @Nullable Duration timeout; - - public GetRequest( - PathParameters.PathParametersMap pathParameters, - RootServerInfo.@Nullable ServerIndex serverIndex, - PetpetidGetSecurityInfo.@Nullable SecurityIndex securityIndex, - @Nullable Duration timeout - ) { - this.pathParameters = pathParameters; - this.serverIndex = serverIndex; - this.securityIndex = securityIndex; - this.timeout = timeout; - } - } - - public static class GetNullableRequest { - public PathParameters.@Nullable PathParametersMap pathParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public PetpetidGetSecurityInfo.@Nullable SecurityIndex securityIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - GetNullableRequest getInstance(); - T getBuilderAfterServerIndex(GetNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForSecurityIndex { - GetNullableRequest getInstance(); - T getBuilderAfterSecurityIndex(GetNullableRequest instance); - default T securityIndex(PetpetidGetSecurityInfo.SecurityIndex securityIndex) { - var instance = getInstance(); - instance.securityIndex = securityIndex; - return getBuilderAfterSecurityIndex(instance); - } - } - - public interface SetterForTimeout { - GetNullableRequest getInstance(); - T getBuilderAfterTimeout(GetNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForPathParameters { - GetNullableRequest getInstance(); - T getBuilderAfterPathParameters(GetNullableRequest instance); - default T pathParameters(PathParameters.PathParametersMap pathParameters) { - var instance = getInstance(); - instance.pathParameters = pathParameters; - return getBuilderAfterPathParameters(instance); - } - } - - public static class Get0RequestBuilder implements SetterForServerIndex, SetterForSecurityIndex, SetterForTimeout { - private final GetNullableRequest instance; - - public Get0RequestBuilder(GetNullableRequest instance) { - this.instance = instance; - } - - public GetRequest build() { - var pathParameters = instance.pathParameters; - if (pathParameters == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new GetRequest( - pathParameters, - instance.serverIndex, - instance.securityIndex, - instance.timeout - ); - } - - public GetNullableRequest getInstance() { - return instance; - } - - public Get0RequestBuilder getBuilderAfterServerIndex(GetNullableRequest instance) { - return this; - } - - public Get0RequestBuilder getBuilderAfterSecurityIndex(GetNullableRequest instance) { - return this; - } - - public Get0RequestBuilder getBuilderAfterTimeout(GetNullableRequest instance) { - return this; - } - } - public static class GetRequestBuilder implements SetterForPathParameters { - private final GetNullableRequest instance; - - public GetRequestBuilder() { - this.instance = new GetNullableRequest(); - } - - public GetNullableRequest getInstance() { - return instance; - } - - public Get0RequestBuilder getBuilderAfterPathParameters(GetNullableRequest instance) { - return new Get0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/PetpetidDelete.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/PetpetidDelete.java new file mode 100644 index 00000000000..81fa39afd8f --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/PetpetidDelete.java @@ -0,0 +1,236 @@ +package org.openapijsonschematools.client.paths.petpetid; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.petpetid.delete.PetpetidDeleteHeaderParameters; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.petpetid.delete.PetpetidDeleteSecurityInfo; +import org.openapijsonschematools.client.paths.petpetid.delete.PetpetidDeletePathParameters; +import org.openapijsonschematools.client.paths.petpetid.delete.Parameters; +import org.openapijsonschematools.client.paths.petpetid.delete.PetpetidDeleteResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.paths.Petpetid; +import org.openapijsonschematools.client.securityrequirementobjects.SecurityRequirementObject; +import org.openapijsonschematools.client.securityrequirementobjects.AuthApplier; + +import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class PetpetidDelete { + private static class DeleteProvider extends AuthApplier { + private static final String method = "delete"; + + public static Void delete( + DeleteRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + + if (request.headerParameters != null) { + var headersSerializer = new Parameters.HeaderParametersSerializer(); + Map> serializedHeaders = headersSerializer.serialize(request.headerParameters); + headers.putAll(serializedHeaders); + } + + var pathSerializer = new Parameters.PathParametersSerializer(); + String updatedPath = pathSerializer.serialize(request.pathParameters, Petpetid.path); + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + SecurityRequirementObject securityRequirementObject = apiConfiguration.getSecurityRequirementObject(request.securityIndex); + updateParamsForAuth( + securityRequirementObject, + headers, + updatedPath, + method, + bodyPublisher, + queryMap, + apiConfiguration + ); + + String url = host + updatedPath; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + return (Void) null; + } + } + + public interface DeleteOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default Void delete(DeleteRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return DeleteProvider.delete(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface DeletePetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default Void deletePet(DeleteRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return DeleteProvider.delete(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Delete extends ApiClient implements DeleteOperation { + public Delete(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class DeleteRequest { + public PetpetidDeletePathParameters.PetpetidDeletePathParametersMap pathParameters; + public PetpetidDeleteHeaderParameters.@Nullable PetpetidDeleteHeaderParametersMap headerParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public PetpetidDeleteSecurityInfo.@Nullable SecurityIndex securityIndex; + public @Nullable Duration timeout; + + public DeleteRequest( + PetpetidDeletePathParameters.PetpetidDeletePathParametersMap pathParameters, + PetpetidDeleteHeaderParameters.@Nullable PetpetidDeleteHeaderParametersMap headerParameters, + RootServerInfo.@Nullable ServerIndex serverIndex, + PetpetidDeleteSecurityInfo.@Nullable SecurityIndex securityIndex, + @Nullable Duration timeout + ) { + this.pathParameters = pathParameters; + this.headerParameters = headerParameters; + this.serverIndex = serverIndex; + this.securityIndex = securityIndex; + this.timeout = timeout; + } + } + + public static class DeleteNullableRequest { + public PetpetidDeletePathParameters.@Nullable PetpetidDeletePathParametersMap pathParameters; + public PetpetidDeleteHeaderParameters.@Nullable PetpetidDeleteHeaderParametersMap headerParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public PetpetidDeleteSecurityInfo.@Nullable SecurityIndex securityIndex; + public @Nullable Duration timeout; + } + + public interface SetterForHeaderParameters { + DeleteNullableRequest getInstance(); + T getBuilderAfterHeaderParameters(DeleteNullableRequest instance); + default T headerParameters(PetpetidDeleteHeaderParameters.PetpetidDeleteHeaderParametersMap headerParameters) { + var instance = getInstance(); + instance.headerParameters = headerParameters; + return getBuilderAfterHeaderParameters(instance); + } + } + + public interface SetterForServerIndex { + DeleteNullableRequest getInstance(); + T getBuilderAfterServerIndex(DeleteNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForSecurityIndex { + DeleteNullableRequest getInstance(); + T getBuilderAfterSecurityIndex(DeleteNullableRequest instance); + default T securityIndex(PetpetidDeleteSecurityInfo.SecurityIndex securityIndex) { + var instance = getInstance(); + instance.securityIndex = securityIndex; + return getBuilderAfterSecurityIndex(instance); + } + } + + public interface SetterForTimeout { + DeleteNullableRequest getInstance(); + T getBuilderAfterTimeout(DeleteNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForPathParameters { + DeleteNullableRequest getInstance(); + T getBuilderAfterPathParameters(DeleteNullableRequest instance); + default T pathParameters(PetpetidDeletePathParameters.PetpetidDeletePathParametersMap pathParameters) { + var instance = getInstance(); + instance.pathParameters = pathParameters; + return getBuilderAfterPathParameters(instance); + } + } + + public static class Delete0RequestBuilder implements SetterForHeaderParameters, SetterForServerIndex, SetterForSecurityIndex, SetterForTimeout { + private final DeleteNullableRequest instance; + + public Delete0RequestBuilder(DeleteNullableRequest instance) { + this.instance = instance; + } + + public DeleteRequest build() { + var pathParameters = instance.pathParameters; + if (pathParameters == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new DeleteRequest( + pathParameters, + instance.headerParameters, + instance.serverIndex, + instance.securityIndex, + instance.timeout + ); + } + + public DeleteNullableRequest getInstance() { + return instance; + } + + public Delete0RequestBuilder getBuilderAfterHeaderParameters(DeleteNullableRequest instance) { + return this; + } + + public Delete0RequestBuilder getBuilderAfterServerIndex(DeleteNullableRequest instance) { + return this; + } + + public Delete0RequestBuilder getBuilderAfterSecurityIndex(DeleteNullableRequest instance) { + return this; + } + + public Delete0RequestBuilder getBuilderAfterTimeout(DeleteNullableRequest instance) { + return this; + } + } + public static class DeleteRequestBuilder implements SetterForPathParameters { + private final DeleteNullableRequest instance; + + public DeleteRequestBuilder() { + this.instance = new DeleteNullableRequest(); + } + + public DeleteNullableRequest getInstance() { + return instance; + } + + public Delete0RequestBuilder getBuilderAfterPathParameters(DeleteNullableRequest instance) { + return new Delete0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/PetpetidGet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/PetpetidGet.java new file mode 100644 index 00000000000..f3ec5bfc3bc --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/PetpetidGet.java @@ -0,0 +1,211 @@ +package org.openapijsonschematools.client.paths.petpetid; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.petpetid.get.PetpetidGetSecurityInfo; +import org.openapijsonschematools.client.paths.petpetid.get.PetpetidGetPathParameters; +import org.openapijsonschematools.client.paths.petpetid.get.Parameters; +import org.openapijsonschematools.client.paths.petpetid.get.PetpetidGetResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.paths.Petpetid; +import org.openapijsonschematools.client.securityrequirementobjects.SecurityRequirementObject; +import org.openapijsonschematools.client.securityrequirementobjects.AuthApplier; + +import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class PetpetidGet { + private static class GetProvider extends AuthApplier { + private static final String method = "get"; + + public static PetpetidGetResponses.EndpointResponse get( + GetRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + + var pathSerializer = new Parameters.PathParametersSerializer(); + String updatedPath = pathSerializer.serialize(request.pathParameters, Petpetid.path); + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + SecurityRequirementObject securityRequirementObject = apiConfiguration.getSecurityRequirementObject(request.securityIndex); + updateParamsForAuth( + securityRequirementObject, + headers, + updatedPath, + method, + bodyPublisher, + queryMap, + apiConfiguration + ); + + String url = host + updatedPath; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new PetpetidGetResponses.PetpetidGetResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface GetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default PetpetidGetResponses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface GetPetByIdOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default PetpetidGetResponses.EndpointResponse getPetById(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Get extends ApiClient implements GetOperation { + public Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class GetRequest { + public PetpetidGetPathParameters.PetpetidGetPathParametersMap pathParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public PetpetidGetSecurityInfo.@Nullable SecurityIndex securityIndex; + public @Nullable Duration timeout; + + public GetRequest( + PetpetidGetPathParameters.PetpetidGetPathParametersMap pathParameters, + RootServerInfo.@Nullable ServerIndex serverIndex, + PetpetidGetSecurityInfo.@Nullable SecurityIndex securityIndex, + @Nullable Duration timeout + ) { + this.pathParameters = pathParameters; + this.serverIndex = serverIndex; + this.securityIndex = securityIndex; + this.timeout = timeout; + } + } + + public static class GetNullableRequest { + public PetpetidGetPathParameters.@Nullable PetpetidGetPathParametersMap pathParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public PetpetidGetSecurityInfo.@Nullable SecurityIndex securityIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + GetNullableRequest getInstance(); + T getBuilderAfterServerIndex(GetNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForSecurityIndex { + GetNullableRequest getInstance(); + T getBuilderAfterSecurityIndex(GetNullableRequest instance); + default T securityIndex(PetpetidGetSecurityInfo.SecurityIndex securityIndex) { + var instance = getInstance(); + instance.securityIndex = securityIndex; + return getBuilderAfterSecurityIndex(instance); + } + } + + public interface SetterForTimeout { + GetNullableRequest getInstance(); + T getBuilderAfterTimeout(GetNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForPathParameters { + GetNullableRequest getInstance(); + T getBuilderAfterPathParameters(GetNullableRequest instance); + default T pathParameters(PetpetidGetPathParameters.PetpetidGetPathParametersMap pathParameters) { + var instance = getInstance(); + instance.pathParameters = pathParameters; + return getBuilderAfterPathParameters(instance); + } + } + + public static class Get0RequestBuilder implements SetterForServerIndex, SetterForSecurityIndex, SetterForTimeout { + private final GetNullableRequest instance; + + public Get0RequestBuilder(GetNullableRequest instance) { + this.instance = instance; + } + + public GetRequest build() { + var pathParameters = instance.pathParameters; + if (pathParameters == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new GetRequest( + pathParameters, + instance.serverIndex, + instance.securityIndex, + instance.timeout + ); + } + + public GetNullableRequest getInstance() { + return instance; + } + + public Get0RequestBuilder getBuilderAfterServerIndex(GetNullableRequest instance) { + return this; + } + + public Get0RequestBuilder getBuilderAfterSecurityIndex(GetNullableRequest instance) { + return this; + } + + public Get0RequestBuilder getBuilderAfterTimeout(GetNullableRequest instance) { + return this; + } + } + public static class GetRequestBuilder implements SetterForPathParameters { + private final GetNullableRequest instance; + + public GetRequestBuilder() { + this.instance = new GetNullableRequest(); + } + + public GetNullableRequest getInstance() { + return instance; + } + + public Get0RequestBuilder getBuilderAfterPathParameters(GetNullableRequest instance) { + return new Get0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/PetpetidPost.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/PetpetidPost.java new file mode 100644 index 00000000000..c0b8ff9ea2c --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/PetpetidPost.java @@ -0,0 +1,242 @@ +package org.openapijsonschematools.client.paths.petpetid; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.petpetid.post.PetpetidPostRequestBody; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.petpetid.post.PetpetidPostSecurityInfo; +import org.openapijsonschematools.client.paths.petpetid.post.PetpetidPostPathParameters; +import org.openapijsonschematools.client.paths.petpetid.post.Parameters; +import org.openapijsonschematools.client.paths.petpetid.post.PetpetidPostResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Petpetid; +import org.openapijsonschematools.client.securityrequirementobjects.SecurityRequirementObject; +import org.openapijsonschematools.client.securityrequirementobjects.AuthApplier; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class PetpetidPost { + private static class PostProvider extends AuthApplier { + private static final String method = "post"; + + public static Void post( + PostRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + @Nullable SerializedRequestBody serializedRequestBody; + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + if (request.requestBody != null) { + serializedRequestBody = new PetpetidPostRequestBody.PetpetidPostRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + bodyPublisher = serializedRequestBody.bodyPublisher; + } + + var pathSerializer = new Parameters.PathParametersSerializer(); + String updatedPath = pathSerializer.serialize(request.pathParameters, Petpetid.path); + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + SecurityRequirementObject securityRequirementObject = apiConfiguration.getSecurityRequirementObject(request.securityIndex); + updateParamsForAuth( + securityRequirementObject, + headers, + updatedPath, + method, + bodyPublisher, + queryMap, + apiConfiguration + ); + + String url = host + updatedPath; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + return (Void) null; + } + } + + public interface PostOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default Void post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface UpdatePetWithFormOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default Void updatePetWithForm(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Post extends ApiClient implements PostOperation { + public Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PostRequest { + public PetpetidPostPathParameters.PetpetidPostPathParametersMap pathParameters; + public PetpetidPostRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public PetpetidPostSecurityInfo.@Nullable SecurityIndex securityIndex; + public @Nullable Duration timeout; + + public PostRequest( + PetpetidPostPathParameters.PetpetidPostPathParametersMap pathParameters, + PetpetidPostRequestBody.@Nullable SealedRequestBody requestBody, + RootServerInfo.@Nullable ServerIndex serverIndex, + PetpetidPostSecurityInfo.@Nullable SecurityIndex securityIndex, + @Nullable Duration timeout + ) { + this.pathParameters = pathParameters; + this.requestBody = requestBody; + this.serverIndex = serverIndex; + this.securityIndex = securityIndex; + this.timeout = timeout; + } + } + + public static class PostNullableRequest { + public PetpetidPostPathParameters.@Nullable PetpetidPostPathParametersMap pathParameters; + public PetpetidPostRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public PetpetidPostSecurityInfo.@Nullable SecurityIndex securityIndex; + public @Nullable Duration timeout; + } + + public interface SetterForRequestBody { + PostNullableRequest getInstance(); + T getBuilderAfterRequestBody(PostNullableRequest instance); + default T requestBody(PetpetidPostRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public interface SetterForServerIndex { + PostNullableRequest getInstance(); + T getBuilderAfterServerIndex(PostNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForSecurityIndex { + PostNullableRequest getInstance(); + T getBuilderAfterSecurityIndex(PostNullableRequest instance); + default T securityIndex(PetpetidPostSecurityInfo.SecurityIndex securityIndex) { + var instance = getInstance(); + instance.securityIndex = securityIndex; + return getBuilderAfterSecurityIndex(instance); + } + } + + public interface SetterForTimeout { + PostNullableRequest getInstance(); + T getBuilderAfterTimeout(PostNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForPathParameters { + PostNullableRequest getInstance(); + T getBuilderAfterPathParameters(PostNullableRequest instance); + default T pathParameters(PetpetidPostPathParameters.PetpetidPostPathParametersMap pathParameters) { + var instance = getInstance(); + instance.pathParameters = pathParameters; + return getBuilderAfterPathParameters(instance); + } + } + + public static class Post0RequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForSecurityIndex, SetterForTimeout { + private final PostNullableRequest instance; + + public Post0RequestBuilder(PostNullableRequest instance) { + this.instance = instance; + } + + public PostRequest build() { + var pathParameters = instance.pathParameters; + if (pathParameters == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new PostRequest( + pathParameters, + instance.requestBody, + instance.serverIndex, + instance.securityIndex, + instance.timeout + ); + } + + public PostNullableRequest getInstance() { + return instance; + } + + public Post0RequestBuilder getBuilderAfterRequestBody(PostNullableRequest instance) { + return this; + } + + public Post0RequestBuilder getBuilderAfterServerIndex(PostNullableRequest instance) { + return this; + } + + public Post0RequestBuilder getBuilderAfterSecurityIndex(PostNullableRequest instance) { + return this; + } + + public Post0RequestBuilder getBuilderAfterTimeout(PostNullableRequest instance) { + return this; + } + } + public static class PostRequestBuilder implements SetterForPathParameters { + private final PostNullableRequest instance; + + public PostRequestBuilder() { + this.instance = new PostNullableRequest(); + } + + public PostNullableRequest getInstance() { + return instance; + } + + public Post0RequestBuilder getBuilderAfterPathParameters(PostNullableRequest instance) { + return new Post0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/Post.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/Post.java deleted file mode 100644 index b9ad09b7104..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/Post.java +++ /dev/null @@ -1,234 +0,0 @@ -package org.openapijsonschematools.client.paths.petpetid; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.petpetid.post.RequestBody; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.petpetid.post.PetpetidPostSecurityInfo; -import org.openapijsonschematools.client.paths.petpetid.post.PathParameters; -import org.openapijsonschematools.client.paths.petpetid.post.Parameters; -import org.openapijsonschematools.client.paths.petpetid.post.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Petpetid; -import org.openapijsonschematools.client.securityrequirementobjects.SecurityRequirementObject; -import org.openapijsonschematools.client.securityrequirementobjects.AuthApplier; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Post { - private static class PostProvider extends AuthApplier { - private static final String method = "post"; - - public static Void post( - PostRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - @Nullable SerializedRequestBody serializedRequestBody; - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - if (request.requestBody != null) { - serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - bodyPublisher = serializedRequestBody.bodyPublisher; - } - - var pathSerializer = new Parameters.PathParametersSerializer(); - String updatedPath = pathSerializer.serialize(request.pathParameters, Petpetid.path); - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - SecurityRequirementObject securityRequirementObject = apiConfiguration.getSecurityRequirementObject(request.securityIndex); - updateParamsForAuth( - securityRequirementObject, - headers, - updatedPath, - method, - bodyPublisher, - queryMap, - apiConfiguration - ); - - String url = host + updatedPath; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PostOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Void post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Post1 extends ApiClient implements PostOperation { - public Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PostRequest { - public PathParameters.PathParametersMap pathParameters; - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public PetpetidPostSecurityInfo.@Nullable SecurityIndex securityIndex; - public @Nullable Duration timeout; - - public PostRequest( - PathParameters.PathParametersMap pathParameters, - RequestBody.@Nullable SealedRequestBody requestBody, - RootServerInfo.@Nullable ServerIndex serverIndex, - PetpetidPostSecurityInfo.@Nullable SecurityIndex securityIndex, - @Nullable Duration timeout - ) { - this.pathParameters = pathParameters; - this.requestBody = requestBody; - this.serverIndex = serverIndex; - this.securityIndex = securityIndex; - this.timeout = timeout; - } - } - - public static class PostNullableRequest { - public PathParameters.@Nullable PathParametersMap pathParameters; - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public PetpetidPostSecurityInfo.@Nullable SecurityIndex securityIndex; - public @Nullable Duration timeout; - } - - public interface SetterForRequestBody { - PostNullableRequest getInstance(); - T getBuilderAfterRequestBody(PostNullableRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public interface SetterForServerIndex { - PostNullableRequest getInstance(); - T getBuilderAfterServerIndex(PostNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForSecurityIndex { - PostNullableRequest getInstance(); - T getBuilderAfterSecurityIndex(PostNullableRequest instance); - default T securityIndex(PetpetidPostSecurityInfo.SecurityIndex securityIndex) { - var instance = getInstance(); - instance.securityIndex = securityIndex; - return getBuilderAfterSecurityIndex(instance); - } - } - - public interface SetterForTimeout { - PostNullableRequest getInstance(); - T getBuilderAfterTimeout(PostNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForPathParameters { - PostNullableRequest getInstance(); - T getBuilderAfterPathParameters(PostNullableRequest instance); - default T pathParameters(PathParameters.PathParametersMap pathParameters) { - var instance = getInstance(); - instance.pathParameters = pathParameters; - return getBuilderAfterPathParameters(instance); - } - } - - public static class Post0RequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForSecurityIndex, SetterForTimeout { - private final PostNullableRequest instance; - - public Post0RequestBuilder(PostNullableRequest instance) { - this.instance = instance; - } - - public PostRequest build() { - var pathParameters = instance.pathParameters; - if (pathParameters == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new PostRequest( - pathParameters, - instance.requestBody, - instance.serverIndex, - instance.securityIndex, - instance.timeout - ); - } - - public PostNullableRequest getInstance() { - return instance; - } - - public Post0RequestBuilder getBuilderAfterRequestBody(PostNullableRequest instance) { - return this; - } - - public Post0RequestBuilder getBuilderAfterServerIndex(PostNullableRequest instance) { - return this; - } - - public Post0RequestBuilder getBuilderAfterSecurityIndex(PostNullableRequest instance) { - return this; - } - - public Post0RequestBuilder getBuilderAfterTimeout(PostNullableRequest instance) { - return this; - } - } - public static class PostRequestBuilder implements SetterForPathParameters { - private final PostNullableRequest instance; - - public PostRequestBuilder() { - this.instance = new PostNullableRequest(); - } - - public PostNullableRequest getInstance() { - return instance; - } - - public Post0RequestBuilder getBuilderAfterPathParameters(PostNullableRequest instance) { - return new Post0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/HeaderParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/HeaderParameters.java deleted file mode 100644 index c5993ca0b15..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/HeaderParameters.java +++ /dev/null @@ -1,191 +0,0 @@ -package org.openapijsonschematools.client.paths.petpetid.delete; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.petpetid.delete.parameters.parameter0.Schema0; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class HeaderParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class HeaderParametersMap extends FrozenMap { - protected HeaderParametersMap(FrozenMap m) { - super(m); - } - public static final Set requiredKeys = Set.of(); - public static final Set optionalKeys = Set.of( - "api_key" - ); - public static HeaderParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return HeaderParameters1.getInstance().validate(arg, configuration); - } - - public String api_key() throws UnsetPropertyException { - return getOrThrow("api_key"); - } - } - - public interface SetterForApiKey { - Map getInstance(); - T getBuilderAfterApiKey(Map instance); - - default T api_key(String value) { - var instance = getInstance(); - instance.put("api_key", value); - return getBuilderAfterApiKey(instance); - } - } - - public static class HeaderParametersMapBuilder implements GenericBuilder>, SetterForApiKey { - private final Map instance; - private static final Set knownKeys = Set.of( - "api_key" - ); - public Set getKnownKeys() { - return knownKeys; - } - public HeaderParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map build() { - return instance; - } - public Map getInstance() { - return instance; - } - public HeaderParametersMapBuilder getBuilderAfterApiKey(Map instance) { - return this; - } - } - - - public sealed interface HeaderParameters1Boxed permits HeaderParameters1BoxedMap { - @Nullable Object getData(); - } - - public record HeaderParameters1BoxedMap(HeaderParametersMap data) implements HeaderParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class HeaderParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable HeaderParameters1 instance = null; - - protected HeaderParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("api_key", Schema0.Schema01.class) - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static HeaderParameters1 getInstance() { - if (instance == null) { - instance = new HeaderParameters1(); - } - return instance; - } - - public HeaderParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - if (!(propertyInstance instanceof String)) { - throw new RuntimeException("Invalid instantiated value"); - } - properties.put(propertyName, (String) propertyInstance); - } - FrozenMap castProperties = new FrozenMap<>(properties); - return new HeaderParametersMap(castProperties); - } - - public HeaderParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public HeaderParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new HeaderParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public HeaderParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/PathParameters.java deleted file mode 100644 index cd01da18f23..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/PathParameters.java +++ /dev/null @@ -1,223 +0,0 @@ -package org.openapijsonschematools.client.paths.petpetid.delete; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.petpetid.delete.parameters.parameter1.Schema1; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class PathParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class PathParametersMap extends FrozenMap { - protected PathParametersMap(FrozenMap m) { - super(m); - } - public static final Set requiredKeys = Set.of( - "petId" - ); - public static final Set optionalKeys = Set.of(); - public static PathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return PathParameters1.getInstance().validate(arg, configuration); - } - - public Number petId() { - try { - return getOrThrow("version"); - } catch (UnsetPropertyException e) { - throw new RuntimeException(e); - } - } - } - - public interface SetterForPetId { - Map getInstance(); - T getBuilderAfterPetId(Map instance); - - default T petId(int value) { - var instance = getInstance(); - instance.put("petId", value); - return getBuilderAfterPetId(instance); - } - - default T petId(float value) { - var instance = getInstance(); - instance.put("petId", value); - return getBuilderAfterPetId(instance); - } - - default T petId(long value) { - var instance = getInstance(); - instance.put("petId", value); - return getBuilderAfterPetId(instance); - } - - default T petId(double value) { - var instance = getInstance(); - instance.put("petId", value); - return getBuilderAfterPetId(instance); - } - } - - public static class PathParametersMap0Builder implements GenericBuilder> { - private final Map instance; - private static final Set knownKeys = Set.of( - "petId" - ); - public Set getKnownKeys() { - return knownKeys; - } - public PathParametersMap0Builder(Map instance) { - this.instance = instance; - } - public Map build() { - return instance; - } - } - - public static class PathParametersMapBuilder implements SetterForPetId { - private final Map instance; - public PathParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map getInstance() { - return instance; - } - public PathParametersMap0Builder getBuilderAfterPetId(Map instance) { - return new PathParametersMap0Builder(instance); - } - } - - - public sealed interface PathParameters1Boxed permits PathParameters1BoxedMap { - @Nullable Object getData(); - } - - public record PathParameters1BoxedMap(PathParametersMap data) implements PathParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable PathParameters1 instance = null; - - protected PathParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("petId", Schema1.Schema11.class) - )) - .required(Set.of( - "petId" - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static PathParameters1 getInstance() { - if (instance == null) { - instance = new PathParameters1(); - } - return instance; - } - - public PathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - if (!(propertyInstance instanceof Number)) { - throw new RuntimeException("Invalid instantiated value"); - } - properties.put(propertyName, (Number) propertyInstance); - } - FrozenMap castProperties = new FrozenMap<>(properties); - return new PathParametersMap(castProperties); - } - - public PathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new PathParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/PetpetidDeleteHeaderParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/PetpetidDeleteHeaderParameters.java new file mode 100644 index 00000000000..6e645c90469 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/PetpetidDeleteHeaderParameters.java @@ -0,0 +1,191 @@ +package org.openapijsonschematools.client.paths.petpetid.delete; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.petpetid.delete.parameters.parameter0.Schema0; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class PetpetidDeleteHeaderParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class PetpetidDeleteadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable PetpetidDeleteadditionalProperties instance = null; + public static PetpetidDeleteadditionalProperties getInstance() { + if (instance == null) { + instance = new PetpetidDeleteadditionalProperties(); + } + return instance; + } + } + + + public static class PetpetidDeleteHeaderParametersMap extends FrozenMap { + protected PetpetidDeleteHeaderParametersMap(FrozenMap m) { + super(m); + } + public static final Set requiredKeys = Set.of(); + public static final Set optionalKeys = Set.of( + "api_key" + ); + public static PetpetidDeleteHeaderParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return PetpetidDeleteHeaderParameters1.getInstance().validate(arg, configuration); + } + + public String api_key() throws UnsetPropertyException { + return getOrThrow("api_key"); + } + } + + public interface SetterForPetpetidDeleteapiKey { + Map getInstance(); + T getBuilderAfterPetpetidDeleteapiKey(Map instance); + + default T api_key(String value) { + var instance = getInstance(); + instance.put("api_key", value); + return getBuilderAfterPetpetidDeleteapiKey(instance); + } + } + + public static class PetpetidDeleteHeaderParametersMapBuilder implements GenericBuilder>, SetterForPetpetidDeleteapiKey { + private final Map instance; + private static final Set knownKeys = Set.of( + "api_key" + ); + public Set getKnownKeys() { + return knownKeys; + } + public PetpetidDeleteHeaderParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map build() { + return instance; + } + public Map getInstance() { + return instance; + } + public PetpetidDeleteHeaderParametersMapBuilder getBuilderAfterPetpetidDeleteapiKey(Map instance) { + return this; + } + } + + + public sealed interface PetpetidDeleteHeaderParameters1Boxed permits PetpetidDeleteHeaderParameters1BoxedMap { + @Nullable Object getData(); + } + + public record PetpetidDeleteHeaderParameters1BoxedMap(PetpetidDeleteHeaderParametersMap data) implements PetpetidDeleteHeaderParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class PetpetidDeleteHeaderParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable PetpetidDeleteHeaderParameters1 instance = null; + + protected PetpetidDeleteHeaderParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("api_key", Schema0.Schema01.class) + )) + .additionalProperties(PetpetidDeleteadditionalProperties.class) + ); + } + + public static PetpetidDeleteHeaderParameters1 getInstance() { + if (instance == null) { + instance = new PetpetidDeleteHeaderParameters1(); + } + return instance; + } + + public PetpetidDeleteHeaderParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof String)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (String) propertyInstance); + } + FrozenMap castProperties = new FrozenMap<>(properties); + return new PetpetidDeleteHeaderParametersMap(castProperties); + } + + public PetpetidDeleteHeaderParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public PetpetidDeleteHeaderParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new PetpetidDeleteHeaderParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public PetpetidDeleteHeaderParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/PetpetidDeletePathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/PetpetidDeletePathParameters.java new file mode 100644 index 00000000000..85d6e6b6684 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/PetpetidDeletePathParameters.java @@ -0,0 +1,223 @@ +package org.openapijsonschematools.client.paths.petpetid.delete; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.petpetid.delete.parameters.parameter1.Schema1; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class PetpetidDeletePathParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class PetpetidDeleteadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable PetpetidDeleteadditionalProperties instance = null; + public static PetpetidDeleteadditionalProperties getInstance() { + if (instance == null) { + instance = new PetpetidDeleteadditionalProperties(); + } + return instance; + } + } + + + public static class PetpetidDeletePathParametersMap extends FrozenMap { + protected PetpetidDeletePathParametersMap(FrozenMap m) { + super(m); + } + public static final Set requiredKeys = Set.of( + "petId" + ); + public static final Set optionalKeys = Set.of(); + public static PetpetidDeletePathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return PetpetidDeletePathParameters1.getInstance().validate(arg, configuration); + } + + public Number petId() { + try { + return getOrThrow("version"); + } catch (UnsetPropertyException e) { + throw new RuntimeException(e); + } + } + } + + public interface SetterForPetpetidDeletepetId { + Map getInstance(); + T getBuilderAfterPetpetidDeletepetId(Map instance); + + default T petId(int value) { + var instance = getInstance(); + instance.put("petId", value); + return getBuilderAfterPetpetidDeletepetId(instance); + } + + default T petId(float value) { + var instance = getInstance(); + instance.put("petId", value); + return getBuilderAfterPetpetidDeletepetId(instance); + } + + default T petId(long value) { + var instance = getInstance(); + instance.put("petId", value); + return getBuilderAfterPetpetidDeletepetId(instance); + } + + default T petId(double value) { + var instance = getInstance(); + instance.put("petId", value); + return getBuilderAfterPetpetidDeletepetId(instance); + } + } + + public static class PetpetidDeletePathParametersMap0Builder implements GenericBuilder> { + private final Map instance; + private static final Set knownKeys = Set.of( + "petId" + ); + public Set getKnownKeys() { + return knownKeys; + } + public PetpetidDeletePathParametersMap0Builder(Map instance) { + this.instance = instance; + } + public Map build() { + return instance; + } + } + + public static class PetpetidDeletePathParametersMapBuilder implements SetterForPetpetidDeletepetId { + private final Map instance; + public PetpetidDeletePathParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map getInstance() { + return instance; + } + public PetpetidDeletePathParametersMap0Builder getBuilderAfterPetpetidDeletepetId(Map instance) { + return new PetpetidDeletePathParametersMap0Builder(instance); + } + } + + + public sealed interface PetpetidDeletePathParameters1Boxed permits PetpetidDeletePathParameters1BoxedMap { + @Nullable Object getData(); + } + + public record PetpetidDeletePathParameters1BoxedMap(PetpetidDeletePathParametersMap data) implements PetpetidDeletePathParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class PetpetidDeletePathParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable PetpetidDeletePathParameters1 instance = null; + + protected PetpetidDeletePathParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("petId", Schema1.Schema11.class) + )) + .required(Set.of( + "petId" + )) + .additionalProperties(PetpetidDeleteadditionalProperties.class) + ); + } + + public static PetpetidDeletePathParameters1 getInstance() { + if (instance == null) { + instance = new PetpetidDeletePathParameters1(); + } + return instance; + } + + public PetpetidDeletePathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Number)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (Number) propertyInstance); + } + FrozenMap castProperties = new FrozenMap<>(properties); + return new PetpetidDeletePathParametersMap(castProperties); + } + + public PetpetidDeletePathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public PetpetidDeletePathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new PetpetidDeletePathParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public PetpetidDeletePathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/PetpetidDeleteResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/PetpetidDeleteResponses.java new file mode 100644 index 00000000000..e5dbf441ebb --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/PetpetidDeleteResponses.java @@ -0,0 +1,48 @@ +package org.openapijsonschematools.client.paths.petpetid.delete; + +import org.openapijsonschematools.client.paths.petpetid.delete.responses.PetpetidDeleteCode400Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class PetpetidDeleteResponses { + + public sealed interface StatusCodeResponseDeserializer permits StatusPetpetidDeleteCode400ResponseDeserializer {} + + public static final class StatusPetpetidDeleteCode400ResponseDeserializer extends PetpetidDeleteCode400Response.PetpetidDeleteCode400Response1 implements StatusCodeResponseDeserializer { + } + + public static final class PetpetidDeleteResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public PetpetidDeleteResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("400", new StatusPetpetidDeleteCode400ResponseDeserializer()) + ); + } + + public Void deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusPetpetidDeleteCode400ResponseDeserializer castDeserializer = (StatusPetpetidDeleteCode400ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + throw new PetpetidDeleteCode400Response.ResponseApiException( + "Received error statusCode response from server", + response, + deserializedResponse + ); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/Responses.java deleted file mode 100644 index 6c5d7573a1a..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/Responses.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.openapijsonschematools.client.paths.petpetid.delete; - -import org.openapijsonschematools.client.paths.petpetid.delete.responses.Code400Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - - public sealed interface StatusCodeResponseDeserializer permits StatusCode400ResponseDeserializer {} - - public static final class StatusCode400ResponseDeserializer extends Code400Response.Code400Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("400", new StatusCode400ResponseDeserializer()) - ); - } - - public Void deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode400ResponseDeserializer castDeserializer = (StatusCode400ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - throw new Code400Response.ResponseApiException( - "Received error statusCode response from server", - response, - deserializedResponse - ); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/responses/Code400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/responses/Code400Response.java deleted file mode 100644 index 48b687555cd..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/responses/Code400Response.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapijsonschematools.client.paths.petpetid.delete.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; - -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code400Response { - - public static class Code400Response1 extends ResponseDeserializer { - public Code400Response1() { - super( - MapUtils.makeMap( - ) - ); - } - - @Override - protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { - return null; - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/responses/PetpetidDeleteCode400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/responses/PetpetidDeleteCode400Response.java new file mode 100644 index 00000000000..99deaad489e --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/delete/responses/PetpetidDeleteCode400Response.java @@ -0,0 +1,45 @@ +package org.openapijsonschematools.client.paths.petpetid.delete.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class PetpetidDeleteCode400Response { + + public static class PetpetidDeleteCode400Response1 extends ResponseDeserializer { + public PetpetidDeleteCode400Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/PathParameters.java deleted file mode 100644 index e5040a92611..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/PathParameters.java +++ /dev/null @@ -1,223 +0,0 @@ -package org.openapijsonschematools.client.paths.petpetid.get; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.petpetid.get.parameters.parameter0.Schema0; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class PathParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class PathParametersMap extends FrozenMap { - protected PathParametersMap(FrozenMap m) { - super(m); - } - public static final Set requiredKeys = Set.of( - "petId" - ); - public static final Set optionalKeys = Set.of(); - public static PathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return PathParameters1.getInstance().validate(arg, configuration); - } - - public Number petId() { - try { - return getOrThrow("version"); - } catch (UnsetPropertyException e) { - throw new RuntimeException(e); - } - } - } - - public interface SetterForPetId { - Map getInstance(); - T getBuilderAfterPetId(Map instance); - - default T petId(int value) { - var instance = getInstance(); - instance.put("petId", value); - return getBuilderAfterPetId(instance); - } - - default T petId(float value) { - var instance = getInstance(); - instance.put("petId", value); - return getBuilderAfterPetId(instance); - } - - default T petId(long value) { - var instance = getInstance(); - instance.put("petId", value); - return getBuilderAfterPetId(instance); - } - - default T petId(double value) { - var instance = getInstance(); - instance.put("petId", value); - return getBuilderAfterPetId(instance); - } - } - - public static class PathParametersMap0Builder implements GenericBuilder> { - private final Map instance; - private static final Set knownKeys = Set.of( - "petId" - ); - public Set getKnownKeys() { - return knownKeys; - } - public PathParametersMap0Builder(Map instance) { - this.instance = instance; - } - public Map build() { - return instance; - } - } - - public static class PathParametersMapBuilder implements SetterForPetId { - private final Map instance; - public PathParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map getInstance() { - return instance; - } - public PathParametersMap0Builder getBuilderAfterPetId(Map instance) { - return new PathParametersMap0Builder(instance); - } - } - - - public sealed interface PathParameters1Boxed permits PathParameters1BoxedMap { - @Nullable Object getData(); - } - - public record PathParameters1BoxedMap(PathParametersMap data) implements PathParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable PathParameters1 instance = null; - - protected PathParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("petId", Schema0.Schema01.class) - )) - .required(Set.of( - "petId" - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static PathParameters1 getInstance() { - if (instance == null) { - instance = new PathParameters1(); - } - return instance; - } - - public PathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - if (!(propertyInstance instanceof Number)) { - throw new RuntimeException("Invalid instantiated value"); - } - properties.put(propertyName, (Number) propertyInstance); - } - FrozenMap castProperties = new FrozenMap<>(properties); - return new PathParametersMap(castProperties); - } - - public PathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new PathParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/PetpetidGetPathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/PetpetidGetPathParameters.java new file mode 100644 index 00000000000..8188f04af39 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/PetpetidGetPathParameters.java @@ -0,0 +1,223 @@ +package org.openapijsonschematools.client.paths.petpetid.get; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.petpetid.get.parameters.parameter0.Schema0; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class PetpetidGetPathParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class PetpetidGetadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable PetpetidGetadditionalProperties instance = null; + public static PetpetidGetadditionalProperties getInstance() { + if (instance == null) { + instance = new PetpetidGetadditionalProperties(); + } + return instance; + } + } + + + public static class PetpetidGetPathParametersMap extends FrozenMap { + protected PetpetidGetPathParametersMap(FrozenMap m) { + super(m); + } + public static final Set requiredKeys = Set.of( + "petId" + ); + public static final Set optionalKeys = Set.of(); + public static PetpetidGetPathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return PetpetidGetPathParameters1.getInstance().validate(arg, configuration); + } + + public Number petId() { + try { + return getOrThrow("version"); + } catch (UnsetPropertyException e) { + throw new RuntimeException(e); + } + } + } + + public interface SetterForPetpetidGetpetId { + Map getInstance(); + T getBuilderAfterPetpetidGetpetId(Map instance); + + default T petId(int value) { + var instance = getInstance(); + instance.put("petId", value); + return getBuilderAfterPetpetidGetpetId(instance); + } + + default T petId(float value) { + var instance = getInstance(); + instance.put("petId", value); + return getBuilderAfterPetpetidGetpetId(instance); + } + + default T petId(long value) { + var instance = getInstance(); + instance.put("petId", value); + return getBuilderAfterPetpetidGetpetId(instance); + } + + default T petId(double value) { + var instance = getInstance(); + instance.put("petId", value); + return getBuilderAfterPetpetidGetpetId(instance); + } + } + + public static class PetpetidGetPathParametersMap0Builder implements GenericBuilder> { + private final Map instance; + private static final Set knownKeys = Set.of( + "petId" + ); + public Set getKnownKeys() { + return knownKeys; + } + public PetpetidGetPathParametersMap0Builder(Map instance) { + this.instance = instance; + } + public Map build() { + return instance; + } + } + + public static class PetpetidGetPathParametersMapBuilder implements SetterForPetpetidGetpetId { + private final Map instance; + public PetpetidGetPathParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map getInstance() { + return instance; + } + public PetpetidGetPathParametersMap0Builder getBuilderAfterPetpetidGetpetId(Map instance) { + return new PetpetidGetPathParametersMap0Builder(instance); + } + } + + + public sealed interface PetpetidGetPathParameters1Boxed permits PetpetidGetPathParameters1BoxedMap { + @Nullable Object getData(); + } + + public record PetpetidGetPathParameters1BoxedMap(PetpetidGetPathParametersMap data) implements PetpetidGetPathParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class PetpetidGetPathParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable PetpetidGetPathParameters1 instance = null; + + protected PetpetidGetPathParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("petId", Schema0.Schema01.class) + )) + .required(Set.of( + "petId" + )) + .additionalProperties(PetpetidGetadditionalProperties.class) + ); + } + + public static PetpetidGetPathParameters1 getInstance() { + if (instance == null) { + instance = new PetpetidGetPathParameters1(); + } + return instance; + } + + public PetpetidGetPathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Number)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (Number) propertyInstance); + } + FrozenMap castProperties = new FrozenMap<>(properties); + return new PetpetidGetPathParametersMap(castProperties); + } + + public PetpetidGetPathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public PetpetidGetPathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new PetpetidGetPathParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public PetpetidGetPathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/PetpetidGetResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/PetpetidGetResponses.java new file mode 100644 index 00000000000..45efdb26f89 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/PetpetidGetResponses.java @@ -0,0 +1,77 @@ +package org.openapijsonschematools.client.paths.petpetid.get; + +import org.openapijsonschematools.client.paths.petpetid.get.responses.PetpetidGetCode200Response; +import org.openapijsonschematools.client.paths.petpetid.get.responses.PetpetidGetCode400Response; +import org.openapijsonschematools.client.paths.petpetid.get.responses.PetpetidGetCode404Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class PetpetidGetResponses { + public sealed interface EndpointResponse permits EndpointPetpetidGetCode200Response {} + + public record EndpointPetpetidGetCode200Response( + HttpResponse response, + PetpetidGetCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusPetpetidGetCode200ResponseDeserializer, StatusPetpetidGetCode400ResponseDeserializer, StatusPetpetidGetCode404ResponseDeserializer {} + + public static final class StatusPetpetidGetCode200ResponseDeserializer extends PetpetidGetCode200Response.PetpetidGetCode200Response1 implements StatusCodeResponseDeserializer { + } + public static final class StatusPetpetidGetCode400ResponseDeserializer extends PetpetidGetCode400Response.PetpetidGetCode400Response1 implements StatusCodeResponseDeserializer { + } + public static final class StatusPetpetidGetCode404ResponseDeserializer extends PetpetidGetCode404Response.PetpetidGetCode404Response1 implements StatusCodeResponseDeserializer { + } + + public static final class PetpetidGetResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public PetpetidGetResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusPetpetidGetCode200ResponseDeserializer()), + new AbstractMap.SimpleEntry<>("400", new StatusPetpetidGetCode400ResponseDeserializer()), + new AbstractMap.SimpleEntry<>("404", new StatusPetpetidGetCode404ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + if (statusCodeDeserializer instanceof StatusPetpetidGetCode200ResponseDeserializer castDeserializer) { + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointPetpetidGetCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } else if (statusCodeDeserializer instanceof StatusPetpetidGetCode400ResponseDeserializer castDeserializer) { + var deserializedResponse = castDeserializer.deserialize(response, configuration); + throw new PetpetidGetCode400Response.ResponseApiException( + "Received error statusCode response from server", + response, + deserializedResponse + ); + } else { + StatusPetpetidGetCode404ResponseDeserializer castDeserializer = (StatusPetpetidGetCode404ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + throw new PetpetidGetCode404Response.ResponseApiException( + "Received error statusCode response from server", + response, + deserializedResponse + ); + } + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/Responses.java deleted file mode 100644 index b0be031e585..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/Responses.java +++ /dev/null @@ -1,77 +0,0 @@ -package org.openapijsonschematools.client.paths.petpetid.get; - -import org.openapijsonschematools.client.paths.petpetid.get.responses.Code200Response; -import org.openapijsonschematools.client.paths.petpetid.get.responses.Code400Response; -import org.openapijsonschematools.client.paths.petpetid.get.responses.Code404Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer, StatusCode400ResponseDeserializer, StatusCode404ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - public static final class StatusCode400ResponseDeserializer extends Code400Response.Code400Response1 implements StatusCodeResponseDeserializer { - } - public static final class StatusCode404ResponseDeserializer extends Code404Response.Code404Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()), - new AbstractMap.SimpleEntry<>("400", new StatusCode400ResponseDeserializer()), - new AbstractMap.SimpleEntry<>("404", new StatusCode404ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - if (statusCodeDeserializer instanceof StatusCode200ResponseDeserializer castDeserializer) { - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } else if (statusCodeDeserializer instanceof StatusCode400ResponseDeserializer castDeserializer) { - var deserializedResponse = castDeserializer.deserialize(response, configuration); - throw new Code400Response.ResponseApiException( - "Received error statusCode response from server", - response, - deserializedResponse - ); - } else { - StatusCode404ResponseDeserializer castDeserializer = (StatusCode404ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - throw new Code404Response.ResponseApiException( - "Received error statusCode response from server", - response, - deserializedResponse - ); - } - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/Code200Response.java deleted file mode 100644 index 2e28a301c5d..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/Code200Response.java +++ /dev/null @@ -1,81 +0,0 @@ -package org.openapijsonschematools.client.paths.petpetid.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.petpetid.get.responses.code200response.content.applicationxml.ApplicationxmlSchema; -import org.openapijsonschematools.client.paths.petpetid.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationxmlMediaType, ApplicationjsonMediaType {} - - public record ApplicationxmlMediaType(ApplicationxmlSchema.ApplicationxmlSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationxmlMediaType() { - this(ApplicationxmlSchema.ApplicationxmlSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationxmlResponseBody, ApplicationjsonResponseBody {} - public record ApplicationxmlResponseBody(ApplicationxmlSchema.Pet1Boxed body) implements SealedResponseBody { } - public record ApplicationjsonResponseBody(ApplicationjsonSchema.Pet1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/xml", new ApplicationxmlMediaType()), - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - if (mediaType instanceof ApplicationxmlMediaType thisMediaType) { - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationxmlResponseBody(deserializedBody); - } else { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/Code400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/Code400Response.java deleted file mode 100644 index 5bbc55f84a2..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/Code400Response.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapijsonschematools.client.paths.petpetid.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; - -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code400Response { - - public static class Code400Response1 extends ResponseDeserializer { - public Code400Response1() { - super( - MapUtils.makeMap( - ) - ); - } - - @Override - protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { - return null; - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/Code404Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/Code404Response.java deleted file mode 100644 index 0aa19c5d169..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/Code404Response.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapijsonschematools.client.paths.petpetid.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; - -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code404Response { - - public static class Code404Response1 extends ResponseDeserializer { - public Code404Response1() { - super( - MapUtils.makeMap( - ) - ); - } - - @Override - protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { - return null; - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/PetpetidGetCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/PetpetidGetCode200Response.java new file mode 100644 index 00000000000..ef57c8d7c8c --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/PetpetidGetCode200Response.java @@ -0,0 +1,81 @@ +package org.openapijsonschematools.client.paths.petpetid.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.petpetid.get.responses.code200response.content.applicationxml.ApplicationxmlSchema; +import org.openapijsonschematools.client.paths.petpetid.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class PetpetidGetCode200Response { + public sealed interface SealedMediaType permits ApplicationxmlMediaType, ApplicationjsonMediaType {} + + public record ApplicationxmlMediaType(ApplicationxmlSchema.ApplicationxmlSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationxmlMediaType() { + this(ApplicationxmlSchema.ApplicationxmlSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationxmlResponseBody, ApplicationjsonResponseBody {} + public record ApplicationxmlResponseBody(ApplicationxmlSchema.Pet1Boxed body) implements SealedResponseBody { } + public record ApplicationjsonResponseBody(ApplicationjsonSchema.Pet1Boxed body) implements SealedResponseBody { } + + public static class PetpetidGetCode200Response1 extends ResponseDeserializer { + public PetpetidGetCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/xml", new ApplicationxmlMediaType()), + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + if (mediaType instanceof ApplicationxmlMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationxmlResponseBody(deserializedBody); + } else { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/PetpetidGetCode400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/PetpetidGetCode400Response.java new file mode 100644 index 00000000000..798be7c4d4b --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/PetpetidGetCode400Response.java @@ -0,0 +1,45 @@ +package org.openapijsonschematools.client.paths.petpetid.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class PetpetidGetCode400Response { + + public static class PetpetidGetCode400Response1 extends ResponseDeserializer { + public PetpetidGetCode400Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/PetpetidGetCode404Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/PetpetidGetCode404Response.java new file mode 100644 index 00000000000..8c7b60d64d7 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/get/responses/PetpetidGetCode404Response.java @@ -0,0 +1,45 @@ +package org.openapijsonschematools.client.paths.petpetid.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class PetpetidGetCode404Response { + + public static class PetpetidGetCode404Response1 extends ResponseDeserializer { + public PetpetidGetCode404Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/PathParameters.java deleted file mode 100644 index e02194fa9c3..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/PathParameters.java +++ /dev/null @@ -1,223 +0,0 @@ -package org.openapijsonschematools.client.paths.petpetid.post; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.petpetid.post.parameters.parameter0.Schema0; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class PathParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class PathParametersMap extends FrozenMap { - protected PathParametersMap(FrozenMap m) { - super(m); - } - public static final Set requiredKeys = Set.of( - "petId" - ); - public static final Set optionalKeys = Set.of(); - public static PathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return PathParameters1.getInstance().validate(arg, configuration); - } - - public Number petId() { - try { - return getOrThrow("version"); - } catch (UnsetPropertyException e) { - throw new RuntimeException(e); - } - } - } - - public interface SetterForPetId { - Map getInstance(); - T getBuilderAfterPetId(Map instance); - - default T petId(int value) { - var instance = getInstance(); - instance.put("petId", value); - return getBuilderAfterPetId(instance); - } - - default T petId(float value) { - var instance = getInstance(); - instance.put("petId", value); - return getBuilderAfterPetId(instance); - } - - default T petId(long value) { - var instance = getInstance(); - instance.put("petId", value); - return getBuilderAfterPetId(instance); - } - - default T petId(double value) { - var instance = getInstance(); - instance.put("petId", value); - return getBuilderAfterPetId(instance); - } - } - - public static class PathParametersMap0Builder implements GenericBuilder> { - private final Map instance; - private static final Set knownKeys = Set.of( - "petId" - ); - public Set getKnownKeys() { - return knownKeys; - } - public PathParametersMap0Builder(Map instance) { - this.instance = instance; - } - public Map build() { - return instance; - } - } - - public static class PathParametersMapBuilder implements SetterForPetId { - private final Map instance; - public PathParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map getInstance() { - return instance; - } - public PathParametersMap0Builder getBuilderAfterPetId(Map instance) { - return new PathParametersMap0Builder(instance); - } - } - - - public sealed interface PathParameters1Boxed permits PathParameters1BoxedMap { - @Nullable Object getData(); - } - - public record PathParameters1BoxedMap(PathParametersMap data) implements PathParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable PathParameters1 instance = null; - - protected PathParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("petId", Schema0.Schema01.class) - )) - .required(Set.of( - "petId" - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static PathParameters1 getInstance() { - if (instance == null) { - instance = new PathParameters1(); - } - return instance; - } - - public PathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - if (!(propertyInstance instanceof Number)) { - throw new RuntimeException("Invalid instantiated value"); - } - properties.put(propertyName, (Number) propertyInstance); - } - FrozenMap castProperties = new FrozenMap<>(properties); - return new PathParametersMap(castProperties); - } - - public PathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new PathParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/PetpetidPostPathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/PetpetidPostPathParameters.java new file mode 100644 index 00000000000..0548b7f1811 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/PetpetidPostPathParameters.java @@ -0,0 +1,223 @@ +package org.openapijsonschematools.client.paths.petpetid.post; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.petpetid.post.parameters.parameter0.Schema0; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class PetpetidPostPathParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class PetpetidPostadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable PetpetidPostadditionalProperties instance = null; + public static PetpetidPostadditionalProperties getInstance() { + if (instance == null) { + instance = new PetpetidPostadditionalProperties(); + } + return instance; + } + } + + + public static class PetpetidPostPathParametersMap extends FrozenMap { + protected PetpetidPostPathParametersMap(FrozenMap m) { + super(m); + } + public static final Set requiredKeys = Set.of( + "petId" + ); + public static final Set optionalKeys = Set.of(); + public static PetpetidPostPathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return PetpetidPostPathParameters1.getInstance().validate(arg, configuration); + } + + public Number petId() { + try { + return getOrThrow("version"); + } catch (UnsetPropertyException e) { + throw new RuntimeException(e); + } + } + } + + public interface SetterForPetpetidPostpetId { + Map getInstance(); + T getBuilderAfterPetpetidPostpetId(Map instance); + + default T petId(int value) { + var instance = getInstance(); + instance.put("petId", value); + return getBuilderAfterPetpetidPostpetId(instance); + } + + default T petId(float value) { + var instance = getInstance(); + instance.put("petId", value); + return getBuilderAfterPetpetidPostpetId(instance); + } + + default T petId(long value) { + var instance = getInstance(); + instance.put("petId", value); + return getBuilderAfterPetpetidPostpetId(instance); + } + + default T petId(double value) { + var instance = getInstance(); + instance.put("petId", value); + return getBuilderAfterPetpetidPostpetId(instance); + } + } + + public static class PetpetidPostPathParametersMap0Builder implements GenericBuilder> { + private final Map instance; + private static final Set knownKeys = Set.of( + "petId" + ); + public Set getKnownKeys() { + return knownKeys; + } + public PetpetidPostPathParametersMap0Builder(Map instance) { + this.instance = instance; + } + public Map build() { + return instance; + } + } + + public static class PetpetidPostPathParametersMapBuilder implements SetterForPetpetidPostpetId { + private final Map instance; + public PetpetidPostPathParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map getInstance() { + return instance; + } + public PetpetidPostPathParametersMap0Builder getBuilderAfterPetpetidPostpetId(Map instance) { + return new PetpetidPostPathParametersMap0Builder(instance); + } + } + + + public sealed interface PetpetidPostPathParameters1Boxed permits PetpetidPostPathParameters1BoxedMap { + @Nullable Object getData(); + } + + public record PetpetidPostPathParameters1BoxedMap(PetpetidPostPathParametersMap data) implements PetpetidPostPathParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class PetpetidPostPathParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable PetpetidPostPathParameters1 instance = null; + + protected PetpetidPostPathParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("petId", Schema0.Schema01.class) + )) + .required(Set.of( + "petId" + )) + .additionalProperties(PetpetidPostadditionalProperties.class) + ); + } + + public static PetpetidPostPathParameters1 getInstance() { + if (instance == null) { + instance = new PetpetidPostPathParameters1(); + } + return instance; + } + + public PetpetidPostPathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Number)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (Number) propertyInstance); + } + FrozenMap castProperties = new FrozenMap<>(properties); + return new PetpetidPostPathParametersMap(castProperties); + } + + public PetpetidPostPathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public PetpetidPostPathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new PetpetidPostPathParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public PetpetidPostPathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/PetpetidPostRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/PetpetidPostRequestBody.java new file mode 100644 index 00000000000..5a90f83cf0b --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/PetpetidPostRequestBody.java @@ -0,0 +1,53 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.petpetid.post; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.petpetid.post.requestbody.content.applicationxwwwformurlencoded.ApplicationxwwwformurlencodedSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class PetpetidPostRequestBody { + public sealed interface SealedMediaType permits ApplicationxwwwformurlencodedMediaType {} + + public record ApplicationxwwwformurlencodedMediaType(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationxwwwformurlencodedMediaType() { + this(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class PetpetidPostRequestBody1 extends RequestBodySerializer { + public PetpetidPostRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/x-www-form-urlencoded", new ApplicationxwwwformurlencodedMediaType()) + ), + false + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + ApplicationxwwwformurlencodedRequestBody requestBody0 = (ApplicationxwwwformurlencodedRequestBody) requestBody; + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } + } + + public sealed interface SealedRequestBody permits ApplicationxwwwformurlencodedRequestBody {} + public record ApplicationxwwwformurlencodedRequestBody(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "application/x-www-form-urlencoded"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/PetpetidPostResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/PetpetidPostResponses.java new file mode 100644 index 00000000000..f7d62e199a3 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/PetpetidPostResponses.java @@ -0,0 +1,48 @@ +package org.openapijsonschematools.client.paths.petpetid.post; + +import org.openapijsonschematools.client.paths.petpetid.post.responses.PetpetidPostCode405Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class PetpetidPostResponses { + + public sealed interface StatusCodeResponseDeserializer permits StatusPetpetidPostCode405ResponseDeserializer {} + + public static final class StatusPetpetidPostCode405ResponseDeserializer extends PetpetidPostCode405Response.PetpetidPostCode405Response1 implements StatusCodeResponseDeserializer { + } + + public static final class PetpetidPostResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public PetpetidPostResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("405", new StatusPetpetidPostCode405ResponseDeserializer()) + ); + } + + public Void deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusPetpetidPostCode405ResponseDeserializer castDeserializer = (StatusPetpetidPostCode405ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + throw new PetpetidPostCode405Response.ResponseApiException( + "Received error statusCode response from server", + response, + deserializedResponse + ); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/RequestBody.java deleted file mode 100644 index 00ba6ed79f2..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/RequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.petpetid.post; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.petpetid.post.requestbody.content.applicationxwwwformurlencoded.ApplicationxwwwformurlencodedSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits ApplicationxwwwformurlencodedMediaType {} - - public record ApplicationxwwwformurlencodedMediaType(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationxwwwformurlencodedMediaType() { - this(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/x-www-form-urlencoded", new ApplicationxwwwformurlencodedMediaType()) - ), - false - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - ApplicationxwwwformurlencodedRequestBody requestBody0 = (ApplicationxwwwformurlencodedRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } - } - - public sealed interface SealedRequestBody permits ApplicationxwwwformurlencodedRequestBody {} - public record ApplicationxwwwformurlencodedRequestBody(ApplicationxwwwformurlencodedSchema.ApplicationxwwwformurlencodedSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "application/x-www-form-urlencoded"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/Responses.java deleted file mode 100644 index 0f129ddcc1d..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/Responses.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.openapijsonschematools.client.paths.petpetid.post; - -import org.openapijsonschematools.client.paths.petpetid.post.responses.Code405Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - - public sealed interface StatusCodeResponseDeserializer permits StatusCode405ResponseDeserializer {} - - public static final class StatusCode405ResponseDeserializer extends Code405Response.Code405Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("405", new StatusCode405ResponseDeserializer()) - ); - } - - public Void deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode405ResponseDeserializer castDeserializer = (StatusCode405ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - throw new Code405Response.ResponseApiException( - "Received error statusCode response from server", - response, - deserializedResponse - ); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/responses/Code405Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/responses/Code405Response.java deleted file mode 100644 index 4dfaf36ff01..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/responses/Code405Response.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapijsonschematools.client.paths.petpetid.post.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; - -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code405Response { - - public static class Code405Response1 extends ResponseDeserializer { - public Code405Response1() { - super( - MapUtils.makeMap( - ) - ); - } - - @Override - protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { - return null; - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/responses/PetpetidPostCode405Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/responses/PetpetidPostCode405Response.java new file mode 100644 index 00000000000..63a84f81656 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetid/post/responses/PetpetidPostCode405Response.java @@ -0,0 +1,45 @@ +package org.openapijsonschematools.client.paths.petpetid.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class PetpetidPostCode405Response { + + public static class PetpetidPostCode405Response1 extends ResponseDeserializer { + public PetpetidPostCode405Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/PetpetiduploadimagePost.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/PetpetiduploadimagePost.java new file mode 100644 index 00000000000..8ad3eaff4a4 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/PetpetiduploadimagePost.java @@ -0,0 +1,243 @@ +package org.openapijsonschematools.client.paths.petpetiduploadimage; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.paths.petpetiduploadimage.post.PetpetiduploadimagePostRequestBody; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.petpetiduploadimage.post.PetpetiduploadimagePostSecurityInfo; +import org.openapijsonschematools.client.paths.petpetiduploadimage.post.PetpetiduploadimagePostPathParameters; +import org.openapijsonschematools.client.paths.petpetiduploadimage.post.Parameters; +import org.openapijsonschematools.client.paths.petpetiduploadimage.post.PetpetiduploadimagePostResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Petpetiduploadimage; +import org.openapijsonschematools.client.securityrequirementobjects.SecurityRequirementObject; +import org.openapijsonschematools.client.securityrequirementobjects.AuthApplier; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class PetpetiduploadimagePost { + private static class PostProvider extends AuthApplier { + private static final String method = "post"; + + public static PetpetiduploadimagePostResponses.EndpointResponse post( + PostRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + @Nullable SerializedRequestBody serializedRequestBody; + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + if (request.requestBody != null) { + serializedRequestBody = new PetpetiduploadimagePostRequestBody.PetpetiduploadimagePostRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + bodyPublisher = serializedRequestBody.bodyPublisher; + } + + var pathSerializer = new Parameters.PathParametersSerializer(); + String updatedPath = pathSerializer.serialize(request.pathParameters, Petpetiduploadimage.path); + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + SecurityRequirementObject securityRequirementObject = apiConfiguration.getSecurityRequirementObject(request.securityIndex); + updateParamsForAuth( + securityRequirementObject, + headers, + updatedPath, + method, + bodyPublisher, + queryMap, + apiConfiguration + ); + + String url = host + updatedPath; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new PetpetiduploadimagePostResponses.PetpetiduploadimagePostResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PostOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default PetpetiduploadimagePostResponses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface UploadImageOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default PetpetiduploadimagePostResponses.EndpointResponse uploadImage(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Post extends ApiClient implements PostOperation { + public Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PostRequest { + public PetpetiduploadimagePostPathParameters.PetpetiduploadimagePostPathParametersMap pathParameters; + public PetpetiduploadimagePostRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public PetpetiduploadimagePostSecurityInfo.@Nullable SecurityIndex securityIndex; + public @Nullable Duration timeout; + + public PostRequest( + PetpetiduploadimagePostPathParameters.PetpetiduploadimagePostPathParametersMap pathParameters, + PetpetiduploadimagePostRequestBody.@Nullable SealedRequestBody requestBody, + RootServerInfo.@Nullable ServerIndex serverIndex, + PetpetiduploadimagePostSecurityInfo.@Nullable SecurityIndex securityIndex, + @Nullable Duration timeout + ) { + this.pathParameters = pathParameters; + this.requestBody = requestBody; + this.serverIndex = serverIndex; + this.securityIndex = securityIndex; + this.timeout = timeout; + } + } + + public static class PostNullableRequest { + public PetpetiduploadimagePostPathParameters.@Nullable PetpetiduploadimagePostPathParametersMap pathParameters; + public PetpetiduploadimagePostRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public PetpetiduploadimagePostSecurityInfo.@Nullable SecurityIndex securityIndex; + public @Nullable Duration timeout; + } + + public interface SetterForRequestBody { + PostNullableRequest getInstance(); + T getBuilderAfterRequestBody(PostNullableRequest instance); + default T requestBody(PetpetiduploadimagePostRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public interface SetterForServerIndex { + PostNullableRequest getInstance(); + T getBuilderAfterServerIndex(PostNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForSecurityIndex { + PostNullableRequest getInstance(); + T getBuilderAfterSecurityIndex(PostNullableRequest instance); + default T securityIndex(PetpetiduploadimagePostSecurityInfo.SecurityIndex securityIndex) { + var instance = getInstance(); + instance.securityIndex = securityIndex; + return getBuilderAfterSecurityIndex(instance); + } + } + + public interface SetterForTimeout { + PostNullableRequest getInstance(); + T getBuilderAfterTimeout(PostNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForPathParameters { + PostNullableRequest getInstance(); + T getBuilderAfterPathParameters(PostNullableRequest instance); + default T pathParameters(PetpetiduploadimagePostPathParameters.PetpetiduploadimagePostPathParametersMap pathParameters) { + var instance = getInstance(); + instance.pathParameters = pathParameters; + return getBuilderAfterPathParameters(instance); + } + } + + public static class Post0RequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForSecurityIndex, SetterForTimeout { + private final PostNullableRequest instance; + + public Post0RequestBuilder(PostNullableRequest instance) { + this.instance = instance; + } + + public PostRequest build() { + var pathParameters = instance.pathParameters; + if (pathParameters == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new PostRequest( + pathParameters, + instance.requestBody, + instance.serverIndex, + instance.securityIndex, + instance.timeout + ); + } + + public PostNullableRequest getInstance() { + return instance; + } + + public Post0RequestBuilder getBuilderAfterRequestBody(PostNullableRequest instance) { + return this; + } + + public Post0RequestBuilder getBuilderAfterServerIndex(PostNullableRequest instance) { + return this; + } + + public Post0RequestBuilder getBuilderAfterSecurityIndex(PostNullableRequest instance) { + return this; + } + + public Post0RequestBuilder getBuilderAfterTimeout(PostNullableRequest instance) { + return this; + } + } + public static class PostRequestBuilder implements SetterForPathParameters { + private final PostNullableRequest instance; + + public PostRequestBuilder() { + this.instance = new PostNullableRequest(); + } + + public PostNullableRequest getInstance() { + return instance; + } + + public Post0RequestBuilder getBuilderAfterPathParameters(PostNullableRequest instance) { + return new Post0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/Post.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/Post.java deleted file mode 100644 index 372c6fffde0..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/Post.java +++ /dev/null @@ -1,234 +0,0 @@ -package org.openapijsonschematools.client.paths.petpetiduploadimage; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.paths.petpetiduploadimage.post.RequestBody; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.petpetiduploadimage.post.PetpetiduploadimagePostSecurityInfo; -import org.openapijsonschematools.client.paths.petpetiduploadimage.post.PathParameters; -import org.openapijsonschematools.client.paths.petpetiduploadimage.post.Parameters; -import org.openapijsonschematools.client.paths.petpetiduploadimage.post.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Petpetiduploadimage; -import org.openapijsonschematools.client.securityrequirementobjects.SecurityRequirementObject; -import org.openapijsonschematools.client.securityrequirementobjects.AuthApplier; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Post { - private static class PostProvider extends AuthApplier { - private static final String method = "post"; - - public static Responses.EndpointResponse post( - PostRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - @Nullable SerializedRequestBody serializedRequestBody; - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - if (request.requestBody != null) { - serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - bodyPublisher = serializedRequestBody.bodyPublisher; - } - - var pathSerializer = new Parameters.PathParametersSerializer(); - String updatedPath = pathSerializer.serialize(request.pathParameters, Petpetiduploadimage.path); - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - SecurityRequirementObject securityRequirementObject = apiConfiguration.getSecurityRequirementObject(request.securityIndex); - updateParamsForAuth( - securityRequirementObject, - headers, - updatedPath, - method, - bodyPublisher, - queryMap, - apiConfiguration - ); - - String url = host + updatedPath; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PostOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Post1 extends ApiClient implements PostOperation { - public Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PostRequest { - public PathParameters.PathParametersMap pathParameters; - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public PetpetiduploadimagePostSecurityInfo.@Nullable SecurityIndex securityIndex; - public @Nullable Duration timeout; - - public PostRequest( - PathParameters.PathParametersMap pathParameters, - RequestBody.@Nullable SealedRequestBody requestBody, - RootServerInfo.@Nullable ServerIndex serverIndex, - PetpetiduploadimagePostSecurityInfo.@Nullable SecurityIndex securityIndex, - @Nullable Duration timeout - ) { - this.pathParameters = pathParameters; - this.requestBody = requestBody; - this.serverIndex = serverIndex; - this.securityIndex = securityIndex; - this.timeout = timeout; - } - } - - public static class PostNullableRequest { - public PathParameters.@Nullable PathParametersMap pathParameters; - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public PetpetiduploadimagePostSecurityInfo.@Nullable SecurityIndex securityIndex; - public @Nullable Duration timeout; - } - - public interface SetterForRequestBody { - PostNullableRequest getInstance(); - T getBuilderAfterRequestBody(PostNullableRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public interface SetterForServerIndex { - PostNullableRequest getInstance(); - T getBuilderAfterServerIndex(PostNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForSecurityIndex { - PostNullableRequest getInstance(); - T getBuilderAfterSecurityIndex(PostNullableRequest instance); - default T securityIndex(PetpetiduploadimagePostSecurityInfo.SecurityIndex securityIndex) { - var instance = getInstance(); - instance.securityIndex = securityIndex; - return getBuilderAfterSecurityIndex(instance); - } - } - - public interface SetterForTimeout { - PostNullableRequest getInstance(); - T getBuilderAfterTimeout(PostNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForPathParameters { - PostNullableRequest getInstance(); - T getBuilderAfterPathParameters(PostNullableRequest instance); - default T pathParameters(PathParameters.PathParametersMap pathParameters) { - var instance = getInstance(); - instance.pathParameters = pathParameters; - return getBuilderAfterPathParameters(instance); - } - } - - public static class Post0RequestBuilder implements SetterForRequestBody, SetterForServerIndex, SetterForSecurityIndex, SetterForTimeout { - private final PostNullableRequest instance; - - public Post0RequestBuilder(PostNullableRequest instance) { - this.instance = instance; - } - - public PostRequest build() { - var pathParameters = instance.pathParameters; - if (pathParameters == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new PostRequest( - pathParameters, - instance.requestBody, - instance.serverIndex, - instance.securityIndex, - instance.timeout - ); - } - - public PostNullableRequest getInstance() { - return instance; - } - - public Post0RequestBuilder getBuilderAfterRequestBody(PostNullableRequest instance) { - return this; - } - - public Post0RequestBuilder getBuilderAfterServerIndex(PostNullableRequest instance) { - return this; - } - - public Post0RequestBuilder getBuilderAfterSecurityIndex(PostNullableRequest instance) { - return this; - } - - public Post0RequestBuilder getBuilderAfterTimeout(PostNullableRequest instance) { - return this; - } - } - public static class PostRequestBuilder implements SetterForPathParameters { - private final PostNullableRequest instance; - - public PostRequestBuilder() { - this.instance = new PostNullableRequest(); - } - - public PostNullableRequest getInstance() { - return instance; - } - - public Post0RequestBuilder getBuilderAfterPathParameters(PostNullableRequest instance) { - return new Post0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/PathParameters.java deleted file mode 100644 index 9241d858285..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/PathParameters.java +++ /dev/null @@ -1,223 +0,0 @@ -package org.openapijsonschematools.client.paths.petpetiduploadimage.post; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.petpetiduploadimage.post.parameters.parameter0.Schema0; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class PathParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class PathParametersMap extends FrozenMap { - protected PathParametersMap(FrozenMap m) { - super(m); - } - public static final Set requiredKeys = Set.of( - "petId" - ); - public static final Set optionalKeys = Set.of(); - public static PathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return PathParameters1.getInstance().validate(arg, configuration); - } - - public Number petId() { - try { - return getOrThrow("version"); - } catch (UnsetPropertyException e) { - throw new RuntimeException(e); - } - } - } - - public interface SetterForPetId { - Map getInstance(); - T getBuilderAfterPetId(Map instance); - - default T petId(int value) { - var instance = getInstance(); - instance.put("petId", value); - return getBuilderAfterPetId(instance); - } - - default T petId(float value) { - var instance = getInstance(); - instance.put("petId", value); - return getBuilderAfterPetId(instance); - } - - default T petId(long value) { - var instance = getInstance(); - instance.put("petId", value); - return getBuilderAfterPetId(instance); - } - - default T petId(double value) { - var instance = getInstance(); - instance.put("petId", value); - return getBuilderAfterPetId(instance); - } - } - - public static class PathParametersMap0Builder implements GenericBuilder> { - private final Map instance; - private static final Set knownKeys = Set.of( - "petId" - ); - public Set getKnownKeys() { - return knownKeys; - } - public PathParametersMap0Builder(Map instance) { - this.instance = instance; - } - public Map build() { - return instance; - } - } - - public static class PathParametersMapBuilder implements SetterForPetId { - private final Map instance; - public PathParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map getInstance() { - return instance; - } - public PathParametersMap0Builder getBuilderAfterPetId(Map instance) { - return new PathParametersMap0Builder(instance); - } - } - - - public sealed interface PathParameters1Boxed permits PathParameters1BoxedMap { - @Nullable Object getData(); - } - - public record PathParameters1BoxedMap(PathParametersMap data) implements PathParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable PathParameters1 instance = null; - - protected PathParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("petId", Schema0.Schema01.class) - )) - .required(Set.of( - "petId" - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static PathParameters1 getInstance() { - if (instance == null) { - instance = new PathParameters1(); - } - return instance; - } - - public PathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - if (!(propertyInstance instanceof Number)) { - throw new RuntimeException("Invalid instantiated value"); - } - properties.put(propertyName, (Number) propertyInstance); - } - FrozenMap castProperties = new FrozenMap<>(properties); - return new PathParametersMap(castProperties); - } - - public PathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new PathParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/PetpetiduploadimagePostPathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/PetpetiduploadimagePostPathParameters.java new file mode 100644 index 00000000000..dcc8d641199 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/PetpetiduploadimagePostPathParameters.java @@ -0,0 +1,223 @@ +package org.openapijsonschematools.client.paths.petpetiduploadimage.post; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.petpetiduploadimage.post.parameters.parameter0.Schema0; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class PetpetiduploadimagePostPathParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class PetpetiduploadimagePostadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable PetpetiduploadimagePostadditionalProperties instance = null; + public static PetpetiduploadimagePostadditionalProperties getInstance() { + if (instance == null) { + instance = new PetpetiduploadimagePostadditionalProperties(); + } + return instance; + } + } + + + public static class PetpetiduploadimagePostPathParametersMap extends FrozenMap { + protected PetpetiduploadimagePostPathParametersMap(FrozenMap m) { + super(m); + } + public static final Set requiredKeys = Set.of( + "petId" + ); + public static final Set optionalKeys = Set.of(); + public static PetpetiduploadimagePostPathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return PetpetiduploadimagePostPathParameters1.getInstance().validate(arg, configuration); + } + + public Number petId() { + try { + return getOrThrow("version"); + } catch (UnsetPropertyException e) { + throw new RuntimeException(e); + } + } + } + + public interface SetterForPetpetiduploadimagePostpetId { + Map getInstance(); + T getBuilderAfterPetpetiduploadimagePostpetId(Map instance); + + default T petId(int value) { + var instance = getInstance(); + instance.put("petId", value); + return getBuilderAfterPetpetiduploadimagePostpetId(instance); + } + + default T petId(float value) { + var instance = getInstance(); + instance.put("petId", value); + return getBuilderAfterPetpetiduploadimagePostpetId(instance); + } + + default T petId(long value) { + var instance = getInstance(); + instance.put("petId", value); + return getBuilderAfterPetpetiduploadimagePostpetId(instance); + } + + default T petId(double value) { + var instance = getInstance(); + instance.put("petId", value); + return getBuilderAfterPetpetiduploadimagePostpetId(instance); + } + } + + public static class PetpetiduploadimagePostPathParametersMap0Builder implements GenericBuilder> { + private final Map instance; + private static final Set knownKeys = Set.of( + "petId" + ); + public Set getKnownKeys() { + return knownKeys; + } + public PetpetiduploadimagePostPathParametersMap0Builder(Map instance) { + this.instance = instance; + } + public Map build() { + return instance; + } + } + + public static class PetpetiduploadimagePostPathParametersMapBuilder implements SetterForPetpetiduploadimagePostpetId { + private final Map instance; + public PetpetiduploadimagePostPathParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map getInstance() { + return instance; + } + public PetpetiduploadimagePostPathParametersMap0Builder getBuilderAfterPetpetiduploadimagePostpetId(Map instance) { + return new PetpetiduploadimagePostPathParametersMap0Builder(instance); + } + } + + + public sealed interface PetpetiduploadimagePostPathParameters1Boxed permits PetpetiduploadimagePostPathParameters1BoxedMap { + @Nullable Object getData(); + } + + public record PetpetiduploadimagePostPathParameters1BoxedMap(PetpetiduploadimagePostPathParametersMap data) implements PetpetiduploadimagePostPathParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class PetpetiduploadimagePostPathParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable PetpetiduploadimagePostPathParameters1 instance = null; + + protected PetpetiduploadimagePostPathParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("petId", Schema0.Schema01.class) + )) + .required(Set.of( + "petId" + )) + .additionalProperties(PetpetiduploadimagePostadditionalProperties.class) + ); + } + + public static PetpetiduploadimagePostPathParameters1 getInstance() { + if (instance == null) { + instance = new PetpetiduploadimagePostPathParameters1(); + } + return instance; + } + + public PetpetiduploadimagePostPathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Number)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (Number) propertyInstance); + } + FrozenMap castProperties = new FrozenMap<>(properties); + return new PetpetiduploadimagePostPathParametersMap(castProperties); + } + + public PetpetiduploadimagePostPathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public PetpetiduploadimagePostPathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new PetpetiduploadimagePostPathParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public PetpetiduploadimagePostPathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/PetpetiduploadimagePostRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/PetpetiduploadimagePostRequestBody.java new file mode 100644 index 00000000000..eec826e462c --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/PetpetiduploadimagePostRequestBody.java @@ -0,0 +1,53 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.petpetiduploadimage.post; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.petpetiduploadimage.post.requestbody.content.multipartformdata.MultipartformdataSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class PetpetiduploadimagePostRequestBody { + public sealed interface SealedMediaType permits MultipartformdataMediaType {} + + public record MultipartformdataMediaType(MultipartformdataSchema.MultipartformdataSchema1 schema) implements SealedMediaType, MediaType { + public MultipartformdataMediaType() { + this(MultipartformdataSchema.MultipartformdataSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class PetpetiduploadimagePostRequestBody1 extends RequestBodySerializer { + public PetpetiduploadimagePostRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("multipart/form-data", new MultipartformdataMediaType()) + ), + false + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + MultipartformdataRequestBody requestBody0 = (MultipartformdataRequestBody) requestBody; + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } + } + + public sealed interface SealedRequestBody permits MultipartformdataRequestBody {} + public record MultipartformdataRequestBody(MultipartformdataSchema.MultipartformdataSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "multipart/form-data"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/PetpetiduploadimagePostResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/PetpetiduploadimagePostResponses.java new file mode 100644 index 00000000000..ef9ecbb0b8a --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/PetpetiduploadimagePostResponses.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.petpetiduploadimage.post; + +import org.openapijsonschematools.client.paths.petpetiduploadimage.post.responses.PetpetiduploadimagePostCode200Response; +import org.openapijsonschematools.client.components.responses.successwithjsonapiresponse.SuccessWithJsonApiResponseHeadersSchema; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class PetpetiduploadimagePostResponses { + public sealed interface EndpointResponse permits EndpointPetpetiduploadimagePostCode200Response {} + + public record EndpointPetpetiduploadimagePostCode200Response( + HttpResponse response, + PetpetiduploadimagePostCode200Response.SealedResponseBody body, + SuccessWithJsonApiResponseHeadersSchema.SuccessWithJsonApiResponseHeadersSchemaMap headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusPetpetiduploadimagePostCode200ResponseDeserializer {} + + public static final class StatusPetpetiduploadimagePostCode200ResponseDeserializer extends PetpetiduploadimagePostCode200Response.PetpetiduploadimagePostCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class PetpetiduploadimagePostResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public PetpetiduploadimagePostResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusPetpetiduploadimagePostCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusPetpetiduploadimagePostCode200ResponseDeserializer castDeserializer = (StatusPetpetiduploadimagePostCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointPetpetiduploadimagePostCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/RequestBody.java deleted file mode 100644 index 81fe04dc837..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/RequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.petpetiduploadimage.post; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.petpetiduploadimage.post.requestbody.content.multipartformdata.MultipartformdataSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits MultipartformdataMediaType {} - - public record MultipartformdataMediaType(MultipartformdataSchema.MultipartformdataSchema1 schema) implements SealedMediaType, MediaType { - public MultipartformdataMediaType() { - this(MultipartformdataSchema.MultipartformdataSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("multipart/form-data", new MultipartformdataMediaType()) - ), - false - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - MultipartformdataRequestBody requestBody0 = (MultipartformdataRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } - } - - public sealed interface SealedRequestBody permits MultipartformdataRequestBody {} - public record MultipartformdataRequestBody(MultipartformdataSchema.MultipartformdataSchema1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "multipart/form-data"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/Responses.java deleted file mode 100644 index ed5b656f912..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/Responses.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.openapijsonschematools.client.paths.petpetiduploadimage.post; - -import org.openapijsonschematools.client.paths.petpetiduploadimage.post.responses.Code200Response; -import org.openapijsonschematools.client.components.responses.successwithjsonapiresponse.SuccessWithJsonApiResponseHeadersSchema; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - SuccessWithJsonApiResponseHeadersSchema.SuccessWithJsonApiResponseHeadersSchemaMap headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/responses/Code200Response.java deleted file mode 100644 index 593e5a8bd71..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/responses/Code200Response.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.openapijsonschematools.client.paths.petpetiduploadimage.post.responses; - -import org.openapijsonschematools.client.components.responses.SuccessWithJsonApiResponse; - -public class Code200Response extends SuccessWithJsonApiResponse { - public static class Code200Response1 extends SuccessWithJsonApiResponse1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/responses/PetpetiduploadimagePostCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/responses/PetpetiduploadimagePostCode200Response.java new file mode 100644 index 00000000000..c597f9f42d7 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/petpetiduploadimage/post/responses/PetpetiduploadimagePostCode200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.petpetiduploadimage.post.responses; + +import org.openapijsonschematools.client.components.responses.SuccessWithJsonApiResponse; + +public class PetpetiduploadimagePostCode200Response extends SuccessWithJsonApiResponse { + public static class PetpetiduploadimagePostCode200Response1 extends SuccessWithJsonApiResponse1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/solidus/Get.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/solidus/Get.java deleted file mode 100644 index 111e91bdcf4..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/solidus/Get.java +++ /dev/null @@ -1,115 +0,0 @@ -package org.openapijsonschematools.client.paths.solidus; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.solidus.get.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.paths.Solidus; - -import java.io.IOException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Get { - private static class GetProvider { - private static final String method = "get"; - - public static Responses.EndpointResponse get( - GetRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Solidus.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface GetOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Get1 extends ApiClient implements GetOperation { - public Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class GetRequest { - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - GetRequest getInstance(); - T getBuilderAfterServerIndex(GetRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - GetRequest getInstance(); - T getBuilderAfterTimeout(GetRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class GetRequestBuilder implements SetterForServerIndex, SetterForTimeout { - private final GetRequest instance; - - public GetRequestBuilder() { - this.instance = new GetRequest(); - } - - public GetRequest build() { - return instance; - } - - public GetRequest getInstance() { - return instance; - } - - public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { - return this; - } - - public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/solidus/SolidusGet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/solidus/SolidusGet.java new file mode 100644 index 00000000000..6d03a9384b5 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/solidus/SolidusGet.java @@ -0,0 +1,124 @@ +package org.openapijsonschematools.client.paths.solidus; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.solidus.get.SolidusGetResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.paths.Solidus; + +import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class SolidusGet { + private static class GetProvider { + private static final String method = "get"; + + public static SolidusGetResponses.EndpointResponse get( + GetRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Solidus.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new SolidusGetResponses.SolidusGetResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface GetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default SolidusGetResponses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface SlashRouteOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default SolidusGetResponses.EndpointResponse slashRoute(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Get extends ApiClient implements GetOperation { + public Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class GetRequest { + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + GetRequest getInstance(); + T getBuilderAfterServerIndex(GetRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + GetRequest getInstance(); + T getBuilderAfterTimeout(GetRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class GetRequestBuilder implements SetterForServerIndex, SetterForTimeout { + private final GetRequest instance; + + public GetRequestBuilder() { + this.instance = new GetRequest(); + } + + public GetRequest build() { + return instance; + } + + public GetRequest getInstance() { + return instance; + } + + public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { + return this; + } + + public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/solidus/get/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/solidus/get/Responses.java deleted file mode 100644 index 2c1b302e62b..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/solidus/get/Responses.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapijsonschematools.client.paths.solidus.get; - -import org.openapijsonschematools.client.paths.solidus.get.responses.Code200Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/solidus/get/SolidusGetResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/solidus/get/SolidusGetResponses.java new file mode 100644 index 00000000000..b6d5295cdce --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/solidus/get/SolidusGetResponses.java @@ -0,0 +1,53 @@ +package org.openapijsonschematools.client.paths.solidus.get; + +import org.openapijsonschematools.client.paths.solidus.get.responses.SolidusGetCode200Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class SolidusGetResponses { + public sealed interface EndpointResponse permits EndpointSolidusGetCode200Response {} + + public record EndpointSolidusGetCode200Response( + HttpResponse response, + Void body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusSolidusGetCode200ResponseDeserializer {} + + public static final class StatusSolidusGetCode200ResponseDeserializer extends SolidusGetCode200Response.SolidusGetCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class SolidusGetResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public SolidusGetResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusSolidusGetCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusSolidusGetCode200ResponseDeserializer castDeserializer = (StatusSolidusGetCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointSolidusGetCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/solidus/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/solidus/get/responses/Code200Response.java deleted file mode 100644 index cc3db94ea0f..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/solidus/get/responses/Code200Response.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.openapijsonschematools.client.paths.solidus.get.responses; - -import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; - -public class Code200Response extends SuccessDescriptionOnly { - public static class Code200Response1 extends SuccessDescriptionOnly1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/solidus/get/responses/SolidusGetCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/solidus/get/responses/SolidusGetCode200Response.java new file mode 100644 index 00000000000..9560cc160dd --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/solidus/get/responses/SolidusGetCode200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.solidus.get.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class SolidusGetCode200Response extends SuccessDescriptionOnly { + public static class SolidusGetCode200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeinventory/Get.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeinventory/Get.java deleted file mode 100644 index 49e7b1d5ab7..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeinventory/Get.java +++ /dev/null @@ -1,143 +0,0 @@ -package org.openapijsonschematools.client.paths.storeinventory; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.storeinventory.get.StoreinventoryGetSecurityInfo; -import org.openapijsonschematools.client.paths.storeinventory.get.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.paths.Storeinventory; -import org.openapijsonschematools.client.securityrequirementobjects.SecurityRequirementObject; -import org.openapijsonschematools.client.securityrequirementobjects.AuthApplier; - -import java.io.IOException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Get { - private static class GetProvider extends AuthApplier { - private static final String method = "get"; - - public static Responses.EndpointResponse get( - GetRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - SecurityRequirementObject securityRequirementObject = apiConfiguration.getSecurityRequirementObject(request.securityIndex); - updateParamsForAuth( - securityRequirementObject, - headers, - Storeinventory.path, - method, - bodyPublisher, - queryMap, - apiConfiguration - ); - - String url = host + Storeinventory.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface GetOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Get1 extends ApiClient implements GetOperation { - public Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class GetRequest { - public RootServerInfo.@Nullable ServerIndex serverIndex; - public StoreinventoryGetSecurityInfo.@Nullable SecurityIndex securityIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - GetRequest getInstance(); - T getBuilderAfterServerIndex(GetRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForSecurityIndex { - GetRequest getInstance(); - T getBuilderAfterSecurityIndex(GetRequest instance); - default T securityIndex(StoreinventoryGetSecurityInfo.SecurityIndex securityIndex) { - var instance = getInstance(); - instance.securityIndex = securityIndex; - return getBuilderAfterSecurityIndex(instance); - } - } - - public interface SetterForTimeout { - GetRequest getInstance(); - T getBuilderAfterTimeout(GetRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class GetRequestBuilder implements SetterForServerIndex, SetterForSecurityIndex, SetterForTimeout { - private final GetRequest instance; - - public GetRequestBuilder() { - this.instance = new GetRequest(); - } - - public GetRequest build() { - return instance; - } - - public GetRequest getInstance() { - return instance; - } - - public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { - return this; - } - - public GetRequestBuilder getBuilderAfterSecurityIndex(GetRequest instance) { - return this; - } - - public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeinventory/StoreinventoryGet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeinventory/StoreinventoryGet.java new file mode 100644 index 00000000000..13cf7cda7a6 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeinventory/StoreinventoryGet.java @@ -0,0 +1,152 @@ +package org.openapijsonschematools.client.paths.storeinventory; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.storeinventory.get.StoreinventoryGetSecurityInfo; +import org.openapijsonschematools.client.paths.storeinventory.get.StoreinventoryGetResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.paths.Storeinventory; +import org.openapijsonschematools.client.securityrequirementobjects.SecurityRequirementObject; +import org.openapijsonschematools.client.securityrequirementobjects.AuthApplier; + +import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class StoreinventoryGet { + private static class GetProvider extends AuthApplier { + private static final String method = "get"; + + public static StoreinventoryGetResponses.EndpointResponse get( + GetRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + SecurityRequirementObject securityRequirementObject = apiConfiguration.getSecurityRequirementObject(request.securityIndex); + updateParamsForAuth( + securityRequirementObject, + headers, + Storeinventory.path, + method, + bodyPublisher, + queryMap, + apiConfiguration + ); + + String url = host + Storeinventory.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new StoreinventoryGetResponses.StoreinventoryGetResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface GetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default StoreinventoryGetResponses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface GetInventoryOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default StoreinventoryGetResponses.EndpointResponse getInventory(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Get extends ApiClient implements GetOperation { + public Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class GetRequest { + public RootServerInfo.@Nullable ServerIndex serverIndex; + public StoreinventoryGetSecurityInfo.@Nullable SecurityIndex securityIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + GetRequest getInstance(); + T getBuilderAfterServerIndex(GetRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForSecurityIndex { + GetRequest getInstance(); + T getBuilderAfterSecurityIndex(GetRequest instance); + default T securityIndex(StoreinventoryGetSecurityInfo.SecurityIndex securityIndex) { + var instance = getInstance(); + instance.securityIndex = securityIndex; + return getBuilderAfterSecurityIndex(instance); + } + } + + public interface SetterForTimeout { + GetRequest getInstance(); + T getBuilderAfterTimeout(GetRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class GetRequestBuilder implements SetterForServerIndex, SetterForSecurityIndex, SetterForTimeout { + private final GetRequest instance; + + public GetRequestBuilder() { + this.instance = new GetRequest(); + } + + public GetRequest build() { + return instance; + } + + public GetRequest getInstance() { + return instance; + } + + public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { + return this; + } + + public GetRequestBuilder getBuilderAfterSecurityIndex(GetRequest instance) { + return this; + } + + public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeinventory/get/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeinventory/get/Responses.java deleted file mode 100644 index 1390a3b9d94..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeinventory/get/Responses.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.openapijsonschematools.client.paths.storeinventory.get; - -import org.openapijsonschematools.client.paths.storeinventory.get.responses.Code200Response; -import org.openapijsonschematools.client.components.responses.successinlinecontentandheader.SuccessInlineContentAndHeaderHeadersSchema; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - SuccessInlineContentAndHeaderHeadersSchema.SuccessInlineContentAndHeaderHeadersSchemaMap headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - StatusCode200ResponseDeserializer castDeserializer = (StatusCode200ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeinventory/get/StoreinventoryGetResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeinventory/get/StoreinventoryGetResponses.java new file mode 100644 index 00000000000..389cb0617a3 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeinventory/get/StoreinventoryGetResponses.java @@ -0,0 +1,54 @@ +package org.openapijsonschematools.client.paths.storeinventory.get; + +import org.openapijsonschematools.client.paths.storeinventory.get.responses.StoreinventoryGetCode200Response; +import org.openapijsonschematools.client.components.responses.successinlinecontentandheader.SuccessInlineContentAndHeaderHeadersSchema; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class StoreinventoryGetResponses { + public sealed interface EndpointResponse permits EndpointStoreinventoryGetCode200Response {} + + public record EndpointStoreinventoryGetCode200Response( + HttpResponse response, + StoreinventoryGetCode200Response.SealedResponseBody body, + SuccessInlineContentAndHeaderHeadersSchema.SuccessInlineContentAndHeaderHeadersSchemaMap headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusStoreinventoryGetCode200ResponseDeserializer {} + + public static final class StatusStoreinventoryGetCode200ResponseDeserializer extends StoreinventoryGetCode200Response.StoreinventoryGetCode200Response1 implements StatusCodeResponseDeserializer { + } + + public static final class StoreinventoryGetResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public StoreinventoryGetResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusStoreinventoryGetCode200ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + StatusStoreinventoryGetCode200ResponseDeserializer castDeserializer = (StatusStoreinventoryGetCode200ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointStoreinventoryGetCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeinventory/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeinventory/get/responses/Code200Response.java deleted file mode 100644 index 0dcc3b8d63f..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeinventory/get/responses/Code200Response.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.openapijsonschematools.client.paths.storeinventory.get.responses; - -import org.openapijsonschematools.client.components.responses.SuccessInlineContentAndHeader; - -public class Code200Response extends SuccessInlineContentAndHeader { - public static class Code200Response1 extends SuccessInlineContentAndHeader1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeinventory/get/responses/StoreinventoryGetCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeinventory/get/responses/StoreinventoryGetCode200Response.java new file mode 100644 index 00000000000..16275bedfdf --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeinventory/get/responses/StoreinventoryGetCode200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.storeinventory.get.responses; + +import org.openapijsonschematools.client.components.responses.SuccessInlineContentAndHeader; + +public class StoreinventoryGetCode200Response extends SuccessInlineContentAndHeader { + public static class StoreinventoryGetCode200Response1 extends SuccessInlineContentAndHeader1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/Post.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/Post.java deleted file mode 100644 index ba0d5c15793..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/Post.java +++ /dev/null @@ -1,174 +0,0 @@ -package org.openapijsonschematools.client.paths.storeorder; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.storeorder.post.RequestBody; -import org.openapijsonschematools.client.paths.storeorder.post.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Storeorder; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Post { - private static class PostProvider { - private static final String method = "post"; - - public static Responses.EndpointResponse post( - PostRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - SerializedRequestBody serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Storeorder.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PostOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Post1 extends ApiClient implements PostOperation { - public Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PostRequest { - public RequestBody.SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - - public PostRequest( - RequestBody.SealedRequestBody requestBody, - RootServerInfo.@Nullable ServerIndex serverIndex, - @Nullable Duration timeout - ) { - this.requestBody = requestBody; - this.serverIndex = serverIndex; - this.timeout = timeout; - } - } - - public static class PostNullableRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - PostNullableRequest getInstance(); - T getBuilderAfterServerIndex(PostNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PostNullableRequest getInstance(); - T getBuilderAfterTimeout(PostNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForRequestBody { - PostNullableRequest getInstance(); - T getBuilderAfterRequestBody(PostNullableRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public static class Post0RequestBuilder implements SetterForServerIndex, SetterForTimeout { - private final PostNullableRequest instance; - - public Post0RequestBuilder(PostNullableRequest instance) { - this.instance = instance; - } - - public PostRequest build() { - var requestBody = instance.requestBody; - if (requestBody == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new PostRequest( - requestBody, - instance.serverIndex, - instance.timeout - ); - } - - public PostNullableRequest getInstance() { - return instance; - } - - public Post0RequestBuilder getBuilderAfterServerIndex(PostNullableRequest instance) { - return this; - } - - public Post0RequestBuilder getBuilderAfterTimeout(PostNullableRequest instance) { - return this; - } - } - public static class PostRequestBuilder implements SetterForRequestBody { - private final PostNullableRequest instance; - - public PostRequestBuilder() { - this.instance = new PostNullableRequest(); - } - - public PostNullableRequest getInstance() { - return instance; - } - - public Post0RequestBuilder getBuilderAfterRequestBody(PostNullableRequest instance) { - return new Post0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/StoreorderPost.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/StoreorderPost.java new file mode 100644 index 00000000000..7a9de50a73b --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/StoreorderPost.java @@ -0,0 +1,183 @@ +package org.openapijsonschematools.client.paths.storeorder; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.storeorder.post.StoreorderPostRequestBody; +import org.openapijsonschematools.client.paths.storeorder.post.StoreorderPostResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Storeorder; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class StoreorderPost { + private static class PostProvider { + private static final String method = "post"; + + public static StoreorderPostResponses.EndpointResponse post( + PostRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + SerializedRequestBody serializedRequestBody = new StoreorderPostRequestBody.StoreorderPostRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Storeorder.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new StoreorderPostResponses.StoreorderPostResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PostOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default StoreorderPostResponses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface PlaceOrderOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default StoreorderPostResponses.EndpointResponse placeOrder(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Post extends ApiClient implements PostOperation { + public Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PostRequest { + public StoreorderPostRequestBody.SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + + public PostRequest( + StoreorderPostRequestBody.SealedRequestBody requestBody, + RootServerInfo.@Nullable ServerIndex serverIndex, + @Nullable Duration timeout + ) { + this.requestBody = requestBody; + this.serverIndex = serverIndex; + this.timeout = timeout; + } + } + + public static class PostNullableRequest { + public StoreorderPostRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + PostNullableRequest getInstance(); + T getBuilderAfterServerIndex(PostNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PostNullableRequest getInstance(); + T getBuilderAfterTimeout(PostNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForRequestBody { + PostNullableRequest getInstance(); + T getBuilderAfterRequestBody(PostNullableRequest instance); + default T requestBody(StoreorderPostRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public static class Post0RequestBuilder implements SetterForServerIndex, SetterForTimeout { + private final PostNullableRequest instance; + + public Post0RequestBuilder(PostNullableRequest instance) { + this.instance = instance; + } + + public PostRequest build() { + var requestBody = instance.requestBody; + if (requestBody == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new PostRequest( + requestBody, + instance.serverIndex, + instance.timeout + ); + } + + public PostNullableRequest getInstance() { + return instance; + } + + public Post0RequestBuilder getBuilderAfterServerIndex(PostNullableRequest instance) { + return this; + } + + public Post0RequestBuilder getBuilderAfterTimeout(PostNullableRequest instance) { + return this; + } + } + public static class PostRequestBuilder implements SetterForRequestBody { + private final PostNullableRequest instance; + + public PostRequestBuilder() { + this.instance = new PostNullableRequest(); + } + + public PostNullableRequest getInstance() { + return instance; + } + + public Post0RequestBuilder getBuilderAfterRequestBody(PostNullableRequest instance) { + return new Post0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/RequestBody.java deleted file mode 100644 index 917836e859f..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/RequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.storeorder.post; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.storeorder.post.requestbody.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ), - true - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } - } - - public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} - public record ApplicationjsonRequestBody(ApplicationjsonSchema.Order1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "application/json"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/Responses.java deleted file mode 100644 index c62c12edaf2..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/Responses.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.openapijsonschematools.client.paths.storeorder.post; - -import org.openapijsonschematools.client.paths.storeorder.post.responses.Code200Response; -import org.openapijsonschematools.client.paths.storeorder.post.responses.Code400Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer, StatusCode400ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - public static final class StatusCode400ResponseDeserializer extends Code400Response.Code400Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()), - new AbstractMap.SimpleEntry<>("400", new StatusCode400ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - if (statusCodeDeserializer instanceof StatusCode200ResponseDeserializer castDeserializer) { - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } else { - StatusCode400ResponseDeserializer castDeserializer = (StatusCode400ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - throw new Code400Response.ResponseApiException( - "Received error statusCode response from server", - response, - deserializedResponse - ); - } - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/StoreorderPostRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/StoreorderPostRequestBody.java new file mode 100644 index 00000000000..0c0a1dbc175 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/StoreorderPostRequestBody.java @@ -0,0 +1,53 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.storeorder.post; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.storeorder.post.requestbody.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class StoreorderPostRequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class StoreorderPostRequestBody1 extends RequestBodySerializer { + public StoreorderPostRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ), + true + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } + } + + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.Order1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "application/json"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/StoreorderPostResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/StoreorderPostResponses.java new file mode 100644 index 00000000000..5afb42352d9 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/StoreorderPostResponses.java @@ -0,0 +1,66 @@ +package org.openapijsonschematools.client.paths.storeorder.post; + +import org.openapijsonschematools.client.paths.storeorder.post.responses.StoreorderPostCode200Response; +import org.openapijsonschematools.client.paths.storeorder.post.responses.StoreorderPostCode400Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class StoreorderPostResponses { + public sealed interface EndpointResponse permits EndpointStoreorderPostCode200Response {} + + public record EndpointStoreorderPostCode200Response( + HttpResponse response, + StoreorderPostCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusStoreorderPostCode200ResponseDeserializer, StatusStoreorderPostCode400ResponseDeserializer {} + + public static final class StatusStoreorderPostCode200ResponseDeserializer extends StoreorderPostCode200Response.StoreorderPostCode200Response1 implements StatusCodeResponseDeserializer { + } + public static final class StatusStoreorderPostCode400ResponseDeserializer extends StoreorderPostCode400Response.StoreorderPostCode400Response1 implements StatusCodeResponseDeserializer { + } + + public static final class StoreorderPostResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public StoreorderPostResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusStoreorderPostCode200ResponseDeserializer()), + new AbstractMap.SimpleEntry<>("400", new StatusStoreorderPostCode400ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + if (statusCodeDeserializer instanceof StatusStoreorderPostCode200ResponseDeserializer castDeserializer) { + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointStoreorderPostCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } else { + StatusStoreorderPostCode400ResponseDeserializer castDeserializer = (StatusStoreorderPostCode400ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + throw new StoreorderPostCode400Response.ResponseApiException( + "Received error statusCode response from server", + response, + deserializedResponse + ); + } + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/Code200Response.java deleted file mode 100644 index fc535ab3955..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/Code200Response.java +++ /dev/null @@ -1,81 +0,0 @@ -package org.openapijsonschematools.client.paths.storeorder.post.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.storeorder.post.responses.code200response.content.applicationxml.ApplicationxmlSchema; -import org.openapijsonschematools.client.paths.storeorder.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationxmlMediaType, ApplicationjsonMediaType {} - - public record ApplicationxmlMediaType(ApplicationxmlSchema.ApplicationxmlSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationxmlMediaType() { - this(ApplicationxmlSchema.ApplicationxmlSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationxmlResponseBody, ApplicationjsonResponseBody {} - public record ApplicationxmlResponseBody(ApplicationxmlSchema.Order1Boxed body) implements SealedResponseBody { } - public record ApplicationjsonResponseBody(ApplicationjsonSchema.Order1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/xml", new ApplicationxmlMediaType()), - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - if (mediaType instanceof ApplicationxmlMediaType thisMediaType) { - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationxmlResponseBody(deserializedBody); - } else { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/Code400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/Code400Response.java deleted file mode 100644 index 3d9ae44d402..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/Code400Response.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapijsonschematools.client.paths.storeorder.post.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; - -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code400Response { - - public static class Code400Response1 extends ResponseDeserializer { - public Code400Response1() { - super( - MapUtils.makeMap( - ) - ); - } - - @Override - protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { - return null; - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/StoreorderPostCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/StoreorderPostCode200Response.java new file mode 100644 index 00000000000..233b54e530b --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/StoreorderPostCode200Response.java @@ -0,0 +1,81 @@ +package org.openapijsonschematools.client.paths.storeorder.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.storeorder.post.responses.code200response.content.applicationxml.ApplicationxmlSchema; +import org.openapijsonschematools.client.paths.storeorder.post.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class StoreorderPostCode200Response { + public sealed interface SealedMediaType permits ApplicationxmlMediaType, ApplicationjsonMediaType {} + + public record ApplicationxmlMediaType(ApplicationxmlSchema.ApplicationxmlSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationxmlMediaType() { + this(ApplicationxmlSchema.ApplicationxmlSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationxmlResponseBody, ApplicationjsonResponseBody {} + public record ApplicationxmlResponseBody(ApplicationxmlSchema.Order1Boxed body) implements SealedResponseBody { } + public record ApplicationjsonResponseBody(ApplicationjsonSchema.Order1Boxed body) implements SealedResponseBody { } + + public static class StoreorderPostCode200Response1 extends ResponseDeserializer { + public StoreorderPostCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/xml", new ApplicationxmlMediaType()), + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + if (mediaType instanceof ApplicationxmlMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationxmlResponseBody(deserializedBody); + } else { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/StoreorderPostCode400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/StoreorderPostCode400Response.java new file mode 100644 index 00000000000..255fd7c4195 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorder/post/responses/StoreorderPostCode400Response.java @@ -0,0 +1,45 @@ +package org.openapijsonschematools.client.paths.storeorder.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class StoreorderPostCode400Response { + + public static class StoreorderPostCode400Response1 extends ResponseDeserializer { + public StoreorderPostCode400Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/Delete.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/Delete.java deleted file mode 100644 index 12139abd4b9..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/Delete.java +++ /dev/null @@ -1,170 +0,0 @@ -package org.openapijsonschematools.client.paths.storeorderorderid; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.storeorderorderid.delete.PathParameters; -import org.openapijsonschematools.client.paths.storeorderorderid.delete.Parameters; -import org.openapijsonschematools.client.paths.storeorderorderid.delete.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.paths.Storeorderorderid; - -import java.io.IOException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Delete { - private static class DeleteProvider { - private static final String method = "delete"; - - public static Void delete( - DeleteRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - - var pathSerializer = new Parameters.PathParametersSerializer(); - String updatedPath = pathSerializer.serialize(request.pathParameters, Storeorderorderid.path); - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + updatedPath; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface DeleteOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Void delete(DeleteRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return DeleteProvider.delete(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Delete1 extends ApiClient implements DeleteOperation { - public Delete1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class DeleteRequest { - public PathParameters.PathParametersMap pathParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - - public DeleteRequest( - PathParameters.PathParametersMap pathParameters, - RootServerInfo.@Nullable ServerIndex serverIndex, - @Nullable Duration timeout - ) { - this.pathParameters = pathParameters; - this.serverIndex = serverIndex; - this.timeout = timeout; - } - } - - public static class DeleteNullableRequest { - public PathParameters.@Nullable PathParametersMap pathParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - DeleteNullableRequest getInstance(); - T getBuilderAfterServerIndex(DeleteNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - DeleteNullableRequest getInstance(); - T getBuilderAfterTimeout(DeleteNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForPathParameters { - DeleteNullableRequest getInstance(); - T getBuilderAfterPathParameters(DeleteNullableRequest instance); - default T pathParameters(PathParameters.PathParametersMap pathParameters) { - var instance = getInstance(); - instance.pathParameters = pathParameters; - return getBuilderAfterPathParameters(instance); - } - } - - public static class Delete0RequestBuilder implements SetterForServerIndex, SetterForTimeout { - private final DeleteNullableRequest instance; - - public Delete0RequestBuilder(DeleteNullableRequest instance) { - this.instance = instance; - } - - public DeleteRequest build() { - var pathParameters = instance.pathParameters; - if (pathParameters == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new DeleteRequest( - pathParameters, - instance.serverIndex, - instance.timeout - ); - } - - public DeleteNullableRequest getInstance() { - return instance; - } - - public Delete0RequestBuilder getBuilderAfterServerIndex(DeleteNullableRequest instance) { - return this; - } - - public Delete0RequestBuilder getBuilderAfterTimeout(DeleteNullableRequest instance) { - return this; - } - } - public static class DeleteRequestBuilder implements SetterForPathParameters { - private final DeleteNullableRequest instance; - - public DeleteRequestBuilder() { - this.instance = new DeleteNullableRequest(); - } - - public DeleteNullableRequest getInstance() { - return instance; - } - - public Delete0RequestBuilder getBuilderAfterPathParameters(DeleteNullableRequest instance) { - return new Delete0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/Get.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/Get.java deleted file mode 100644 index e585a91d120..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/Get.java +++ /dev/null @@ -1,170 +0,0 @@ -package org.openapijsonschematools.client.paths.storeorderorderid; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.storeorderorderid.get.PathParameters; -import org.openapijsonschematools.client.paths.storeorderorderid.get.Parameters; -import org.openapijsonschematools.client.paths.storeorderorderid.get.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.paths.Storeorderorderid; - -import java.io.IOException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Get { - private static class GetProvider { - private static final String method = "get"; - - public static Responses.EndpointResponse get( - GetRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - - var pathSerializer = new Parameters.PathParametersSerializer(); - String updatedPath = pathSerializer.serialize(request.pathParameters, Storeorderorderid.path); - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + updatedPath; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface GetOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Get1 extends ApiClient implements GetOperation { - public Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class GetRequest { - public PathParameters.PathParametersMap pathParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - - public GetRequest( - PathParameters.PathParametersMap pathParameters, - RootServerInfo.@Nullable ServerIndex serverIndex, - @Nullable Duration timeout - ) { - this.pathParameters = pathParameters; - this.serverIndex = serverIndex; - this.timeout = timeout; - } - } - - public static class GetNullableRequest { - public PathParameters.@Nullable PathParametersMap pathParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - GetNullableRequest getInstance(); - T getBuilderAfterServerIndex(GetNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - GetNullableRequest getInstance(); - T getBuilderAfterTimeout(GetNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForPathParameters { - GetNullableRequest getInstance(); - T getBuilderAfterPathParameters(GetNullableRequest instance); - default T pathParameters(PathParameters.PathParametersMap pathParameters) { - var instance = getInstance(); - instance.pathParameters = pathParameters; - return getBuilderAfterPathParameters(instance); - } - } - - public static class Get0RequestBuilder implements SetterForServerIndex, SetterForTimeout { - private final GetNullableRequest instance; - - public Get0RequestBuilder(GetNullableRequest instance) { - this.instance = instance; - } - - public GetRequest build() { - var pathParameters = instance.pathParameters; - if (pathParameters == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new GetRequest( - pathParameters, - instance.serverIndex, - instance.timeout - ); - } - - public GetNullableRequest getInstance() { - return instance; - } - - public Get0RequestBuilder getBuilderAfterServerIndex(GetNullableRequest instance) { - return this; - } - - public Get0RequestBuilder getBuilderAfterTimeout(GetNullableRequest instance) { - return this; - } - } - public static class GetRequestBuilder implements SetterForPathParameters { - private final GetNullableRequest instance; - - public GetRequestBuilder() { - this.instance = new GetNullableRequest(); - } - - public GetNullableRequest getInstance() { - return instance; - } - - public Get0RequestBuilder getBuilderAfterPathParameters(GetNullableRequest instance) { - return new Get0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/StoreorderorderidDelete.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/StoreorderorderidDelete.java new file mode 100644 index 00000000000..6ad421950d5 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/StoreorderorderidDelete.java @@ -0,0 +1,178 @@ +package org.openapijsonschematools.client.paths.storeorderorderid; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.storeorderorderid.delete.StoreorderorderidDeletePathParameters; +import org.openapijsonschematools.client.paths.storeorderorderid.delete.Parameters; +import org.openapijsonschematools.client.paths.storeorderorderid.delete.StoreorderorderidDeleteResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.paths.Storeorderorderid; + +import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class StoreorderorderidDelete { + private static class DeleteProvider { + private static final String method = "delete"; + + public static Void delete( + DeleteRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + + var pathSerializer = new Parameters.PathParametersSerializer(); + String updatedPath = pathSerializer.serialize(request.pathParameters, Storeorderorderid.path); + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + updatedPath; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + return (Void) null; + } + } + + public interface DeleteOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default Void delete(DeleteRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return DeleteProvider.delete(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface DeleteOrderOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default Void deleteOrder(DeleteRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return DeleteProvider.delete(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Delete extends ApiClient implements DeleteOperation { + public Delete(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class DeleteRequest { + public StoreorderorderidDeletePathParameters.StoreorderorderidDeletePathParametersMap pathParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + + public DeleteRequest( + StoreorderorderidDeletePathParameters.StoreorderorderidDeletePathParametersMap pathParameters, + RootServerInfo.@Nullable ServerIndex serverIndex, + @Nullable Duration timeout + ) { + this.pathParameters = pathParameters; + this.serverIndex = serverIndex; + this.timeout = timeout; + } + } + + public static class DeleteNullableRequest { + public StoreorderorderidDeletePathParameters.@Nullable StoreorderorderidDeletePathParametersMap pathParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + DeleteNullableRequest getInstance(); + T getBuilderAfterServerIndex(DeleteNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + DeleteNullableRequest getInstance(); + T getBuilderAfterTimeout(DeleteNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForPathParameters { + DeleteNullableRequest getInstance(); + T getBuilderAfterPathParameters(DeleteNullableRequest instance); + default T pathParameters(StoreorderorderidDeletePathParameters.StoreorderorderidDeletePathParametersMap pathParameters) { + var instance = getInstance(); + instance.pathParameters = pathParameters; + return getBuilderAfterPathParameters(instance); + } + } + + public static class Delete0RequestBuilder implements SetterForServerIndex, SetterForTimeout { + private final DeleteNullableRequest instance; + + public Delete0RequestBuilder(DeleteNullableRequest instance) { + this.instance = instance; + } + + public DeleteRequest build() { + var pathParameters = instance.pathParameters; + if (pathParameters == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new DeleteRequest( + pathParameters, + instance.serverIndex, + instance.timeout + ); + } + + public DeleteNullableRequest getInstance() { + return instance; + } + + public Delete0RequestBuilder getBuilderAfterServerIndex(DeleteNullableRequest instance) { + return this; + } + + public Delete0RequestBuilder getBuilderAfterTimeout(DeleteNullableRequest instance) { + return this; + } + } + public static class DeleteRequestBuilder implements SetterForPathParameters { + private final DeleteNullableRequest instance; + + public DeleteRequestBuilder() { + this.instance = new DeleteNullableRequest(); + } + + public DeleteNullableRequest getInstance() { + return instance; + } + + public Delete0RequestBuilder getBuilderAfterPathParameters(DeleteNullableRequest instance) { + return new Delete0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/StoreorderorderidGet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/StoreorderorderidGet.java new file mode 100644 index 00000000000..05b1240c04d --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/StoreorderorderidGet.java @@ -0,0 +1,179 @@ +package org.openapijsonschematools.client.paths.storeorderorderid; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.storeorderorderid.get.StoreorderorderidGetPathParameters; +import org.openapijsonschematools.client.paths.storeorderorderid.get.Parameters; +import org.openapijsonschematools.client.paths.storeorderorderid.get.StoreorderorderidGetResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.paths.Storeorderorderid; + +import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class StoreorderorderidGet { + private static class GetProvider { + private static final String method = "get"; + + public static StoreorderorderidGetResponses.EndpointResponse get( + GetRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + + var pathSerializer = new Parameters.PathParametersSerializer(); + String updatedPath = pathSerializer.serialize(request.pathParameters, Storeorderorderid.path); + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + updatedPath; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new StoreorderorderidGetResponses.StoreorderorderidGetResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface GetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default StoreorderorderidGetResponses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface GetOrderByIdOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default StoreorderorderidGetResponses.EndpointResponse getOrderById(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Get extends ApiClient implements GetOperation { + public Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class GetRequest { + public StoreorderorderidGetPathParameters.StoreorderorderidGetPathParametersMap pathParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + + public GetRequest( + StoreorderorderidGetPathParameters.StoreorderorderidGetPathParametersMap pathParameters, + RootServerInfo.@Nullable ServerIndex serverIndex, + @Nullable Duration timeout + ) { + this.pathParameters = pathParameters; + this.serverIndex = serverIndex; + this.timeout = timeout; + } + } + + public static class GetNullableRequest { + public StoreorderorderidGetPathParameters.@Nullable StoreorderorderidGetPathParametersMap pathParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + GetNullableRequest getInstance(); + T getBuilderAfterServerIndex(GetNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + GetNullableRequest getInstance(); + T getBuilderAfterTimeout(GetNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForPathParameters { + GetNullableRequest getInstance(); + T getBuilderAfterPathParameters(GetNullableRequest instance); + default T pathParameters(StoreorderorderidGetPathParameters.StoreorderorderidGetPathParametersMap pathParameters) { + var instance = getInstance(); + instance.pathParameters = pathParameters; + return getBuilderAfterPathParameters(instance); + } + } + + public static class Get0RequestBuilder implements SetterForServerIndex, SetterForTimeout { + private final GetNullableRequest instance; + + public Get0RequestBuilder(GetNullableRequest instance) { + this.instance = instance; + } + + public GetRequest build() { + var pathParameters = instance.pathParameters; + if (pathParameters == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new GetRequest( + pathParameters, + instance.serverIndex, + instance.timeout + ); + } + + public GetNullableRequest getInstance() { + return instance; + } + + public Get0RequestBuilder getBuilderAfterServerIndex(GetNullableRequest instance) { + return this; + } + + public Get0RequestBuilder getBuilderAfterTimeout(GetNullableRequest instance) { + return this; + } + } + public static class GetRequestBuilder implements SetterForPathParameters { + private final GetNullableRequest instance; + + public GetRequestBuilder() { + this.instance = new GetNullableRequest(); + } + + public GetNullableRequest getInstance() { + return instance; + } + + public Get0RequestBuilder getBuilderAfterPathParameters(GetNullableRequest instance) { + return new Get0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/PathParameters.java deleted file mode 100644 index fa7565f0555..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/PathParameters.java +++ /dev/null @@ -1,205 +0,0 @@ -package org.openapijsonschematools.client.paths.storeorderorderid.delete; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.storeorderorderid.delete.parameters.parameter0.Schema0; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class PathParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class PathParametersMap extends FrozenMap { - protected PathParametersMap(FrozenMap m) { - super(m); - } - public static final Set requiredKeys = Set.of( - "order_id" - ); - public static final Set optionalKeys = Set.of(); - public static PathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return PathParameters1.getInstance().validate(arg, configuration); - } - - public String order_id() { - try { - return getOrThrow("version"); - } catch (UnsetPropertyException e) { - throw new RuntimeException(e); - } - } - } - - public interface SetterForOrderId { - Map getInstance(); - T getBuilderAfterOrderId(Map instance); - - default T order_id(String value) { - var instance = getInstance(); - instance.put("order_id", value); - return getBuilderAfterOrderId(instance); - } - } - - public static class PathParametersMap0Builder implements GenericBuilder> { - private final Map instance; - private static final Set knownKeys = Set.of( - "order_id" - ); - public Set getKnownKeys() { - return knownKeys; - } - public PathParametersMap0Builder(Map instance) { - this.instance = instance; - } - public Map build() { - return instance; - } - } - - public static class PathParametersMapBuilder implements SetterForOrderId { - private final Map instance; - public PathParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map getInstance() { - return instance; - } - public PathParametersMap0Builder getBuilderAfterOrderId(Map instance) { - return new PathParametersMap0Builder(instance); - } - } - - - public sealed interface PathParameters1Boxed permits PathParameters1BoxedMap { - @Nullable Object getData(); - } - - public record PathParameters1BoxedMap(PathParametersMap data) implements PathParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable PathParameters1 instance = null; - - protected PathParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("order_id", Schema0.Schema01.class) - )) - .required(Set.of( - "order_id" - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static PathParameters1 getInstance() { - if (instance == null) { - instance = new PathParameters1(); - } - return instance; - } - - public PathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - if (!(propertyInstance instanceof String)) { - throw new RuntimeException("Invalid instantiated value"); - } - properties.put(propertyName, (String) propertyInstance); - } - FrozenMap castProperties = new FrozenMap<>(properties); - return new PathParametersMap(castProperties); - } - - public PathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new PathParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/Responses.java deleted file mode 100644 index 5e9f34d93b7..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/Responses.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.openapijsonschematools.client.paths.storeorderorderid.delete; - -import org.openapijsonschematools.client.paths.storeorderorderid.delete.responses.Code400Response; -import org.openapijsonschematools.client.paths.storeorderorderid.delete.responses.Code404Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - - public sealed interface StatusCodeResponseDeserializer permits StatusCode400ResponseDeserializer, StatusCode404ResponseDeserializer {} - - public static final class StatusCode400ResponseDeserializer extends Code400Response.Code400Response1 implements StatusCodeResponseDeserializer { - } - public static final class StatusCode404ResponseDeserializer extends Code404Response.Code404Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("400", new StatusCode400ResponseDeserializer()), - new AbstractMap.SimpleEntry<>("404", new StatusCode404ResponseDeserializer()) - ); - } - - public Void deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - if (statusCodeDeserializer instanceof StatusCode400ResponseDeserializer castDeserializer) { - var deserializedResponse = castDeserializer.deserialize(response, configuration); - throw new Code400Response.ResponseApiException( - "Received error statusCode response from server", - response, - deserializedResponse - ); - } else { - StatusCode404ResponseDeserializer castDeserializer = (StatusCode404ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - throw new Code404Response.ResponseApiException( - "Received error statusCode response from server", - response, - deserializedResponse - ); - } - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/StoreorderorderidDeletePathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/StoreorderorderidDeletePathParameters.java new file mode 100644 index 00000000000..91cc3045110 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/StoreorderorderidDeletePathParameters.java @@ -0,0 +1,205 @@ +package org.openapijsonschematools.client.paths.storeorderorderid.delete; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.storeorderorderid.delete.parameters.parameter0.Schema0; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class StoreorderorderidDeletePathParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class StoreorderorderidDeleteadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable StoreorderorderidDeleteadditionalProperties instance = null; + public static StoreorderorderidDeleteadditionalProperties getInstance() { + if (instance == null) { + instance = new StoreorderorderidDeleteadditionalProperties(); + } + return instance; + } + } + + + public static class StoreorderorderidDeletePathParametersMap extends FrozenMap { + protected StoreorderorderidDeletePathParametersMap(FrozenMap m) { + super(m); + } + public static final Set requiredKeys = Set.of( + "order_id" + ); + public static final Set optionalKeys = Set.of(); + public static StoreorderorderidDeletePathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return StoreorderorderidDeletePathParameters1.getInstance().validate(arg, configuration); + } + + public String order_id() { + try { + return getOrThrow("version"); + } catch (UnsetPropertyException e) { + throw new RuntimeException(e); + } + } + } + + public interface SetterForStoreorderorderidDeleteorderId { + Map getInstance(); + T getBuilderAfterStoreorderorderidDeleteorderId(Map instance); + + default T order_id(String value) { + var instance = getInstance(); + instance.put("order_id", value); + return getBuilderAfterStoreorderorderidDeleteorderId(instance); + } + } + + public static class StoreorderorderidDeletePathParametersMap0Builder implements GenericBuilder> { + private final Map instance; + private static final Set knownKeys = Set.of( + "order_id" + ); + public Set getKnownKeys() { + return knownKeys; + } + public StoreorderorderidDeletePathParametersMap0Builder(Map instance) { + this.instance = instance; + } + public Map build() { + return instance; + } + } + + public static class StoreorderorderidDeletePathParametersMapBuilder implements SetterForStoreorderorderidDeleteorderId { + private final Map instance; + public StoreorderorderidDeletePathParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map getInstance() { + return instance; + } + public StoreorderorderidDeletePathParametersMap0Builder getBuilderAfterStoreorderorderidDeleteorderId(Map instance) { + return new StoreorderorderidDeletePathParametersMap0Builder(instance); + } + } + + + public sealed interface StoreorderorderidDeletePathParameters1Boxed permits StoreorderorderidDeletePathParameters1BoxedMap { + @Nullable Object getData(); + } + + public record StoreorderorderidDeletePathParameters1BoxedMap(StoreorderorderidDeletePathParametersMap data) implements StoreorderorderidDeletePathParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class StoreorderorderidDeletePathParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable StoreorderorderidDeletePathParameters1 instance = null; + + protected StoreorderorderidDeletePathParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("order_id", Schema0.Schema01.class) + )) + .required(Set.of( + "order_id" + )) + .additionalProperties(StoreorderorderidDeleteadditionalProperties.class) + ); + } + + public static StoreorderorderidDeletePathParameters1 getInstance() { + if (instance == null) { + instance = new StoreorderorderidDeletePathParameters1(); + } + return instance; + } + + public StoreorderorderidDeletePathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof String)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (String) propertyInstance); + } + FrozenMap castProperties = new FrozenMap<>(properties); + return new StoreorderorderidDeletePathParametersMap(castProperties); + } + + public StoreorderorderidDeletePathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public StoreorderorderidDeletePathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new StoreorderorderidDeletePathParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public StoreorderorderidDeletePathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/StoreorderorderidDeleteResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/StoreorderorderidDeleteResponses.java new file mode 100644 index 00000000000..4e2878c3135 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/StoreorderorderidDeleteResponses.java @@ -0,0 +1,61 @@ +package org.openapijsonschematools.client.paths.storeorderorderid.delete; + +import org.openapijsonschematools.client.paths.storeorderorderid.delete.responses.StoreorderorderidDeleteCode400Response; +import org.openapijsonschematools.client.paths.storeorderorderid.delete.responses.StoreorderorderidDeleteCode404Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class StoreorderorderidDeleteResponses { + + public sealed interface StatusCodeResponseDeserializer permits StatusStoreorderorderidDeleteCode400ResponseDeserializer, StatusStoreorderorderidDeleteCode404ResponseDeserializer {} + + public static final class StatusStoreorderorderidDeleteCode400ResponseDeserializer extends StoreorderorderidDeleteCode400Response.StoreorderorderidDeleteCode400Response1 implements StatusCodeResponseDeserializer { + } + public static final class StatusStoreorderorderidDeleteCode404ResponseDeserializer extends StoreorderorderidDeleteCode404Response.StoreorderorderidDeleteCode404Response1 implements StatusCodeResponseDeserializer { + } + + public static final class StoreorderorderidDeleteResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public StoreorderorderidDeleteResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("400", new StatusStoreorderorderidDeleteCode400ResponseDeserializer()), + new AbstractMap.SimpleEntry<>("404", new StatusStoreorderorderidDeleteCode404ResponseDeserializer()) + ); + } + + public Void deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + if (statusCodeDeserializer instanceof StatusStoreorderorderidDeleteCode400ResponseDeserializer castDeserializer) { + var deserializedResponse = castDeserializer.deserialize(response, configuration); + throw new StoreorderorderidDeleteCode400Response.ResponseApiException( + "Received error statusCode response from server", + response, + deserializedResponse + ); + } else { + StatusStoreorderorderidDeleteCode404ResponseDeserializer castDeserializer = (StatusStoreorderorderidDeleteCode404ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + throw new StoreorderorderidDeleteCode404Response.ResponseApiException( + "Received error statusCode response from server", + response, + deserializedResponse + ); + } + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/responses/Code400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/responses/Code400Response.java deleted file mode 100644 index 7ad936566fc..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/responses/Code400Response.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapijsonschematools.client.paths.storeorderorderid.delete.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; - -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code400Response { - - public static class Code400Response1 extends ResponseDeserializer { - public Code400Response1() { - super( - MapUtils.makeMap( - ) - ); - } - - @Override - protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { - return null; - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/responses/Code404Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/responses/Code404Response.java deleted file mode 100644 index 565b71b9a4f..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/responses/Code404Response.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapijsonschematools.client.paths.storeorderorderid.delete.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; - -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code404Response { - - public static class Code404Response1 extends ResponseDeserializer { - public Code404Response1() { - super( - MapUtils.makeMap( - ) - ); - } - - @Override - protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { - return null; - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/responses/StoreorderorderidDeleteCode400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/responses/StoreorderorderidDeleteCode400Response.java new file mode 100644 index 00000000000..9cb784d6247 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/responses/StoreorderorderidDeleteCode400Response.java @@ -0,0 +1,45 @@ +package org.openapijsonschematools.client.paths.storeorderorderid.delete.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class StoreorderorderidDeleteCode400Response { + + public static class StoreorderorderidDeleteCode400Response1 extends ResponseDeserializer { + public StoreorderorderidDeleteCode400Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/responses/StoreorderorderidDeleteCode404Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/responses/StoreorderorderidDeleteCode404Response.java new file mode 100644 index 00000000000..db72a798656 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/delete/responses/StoreorderorderidDeleteCode404Response.java @@ -0,0 +1,45 @@ +package org.openapijsonschematools.client.paths.storeorderorderid.delete.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class StoreorderorderidDeleteCode404Response { + + public static class StoreorderorderidDeleteCode404Response1 extends ResponseDeserializer { + public StoreorderorderidDeleteCode404Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/PathParameters.java deleted file mode 100644 index f9fb4048dc0..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/PathParameters.java +++ /dev/null @@ -1,223 +0,0 @@ -package org.openapijsonschematools.client.paths.storeorderorderid.get; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.storeorderorderid.get.parameters.parameter0.Schema0; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class PathParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class PathParametersMap extends FrozenMap { - protected PathParametersMap(FrozenMap m) { - super(m); - } - public static final Set requiredKeys = Set.of( - "order_id" - ); - public static final Set optionalKeys = Set.of(); - public static PathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return PathParameters1.getInstance().validate(arg, configuration); - } - - public Number order_id() { - try { - return getOrThrow("version"); - } catch (UnsetPropertyException e) { - throw new RuntimeException(e); - } - } - } - - public interface SetterForOrderId { - Map getInstance(); - T getBuilderAfterOrderId(Map instance); - - default T order_id(int value) { - var instance = getInstance(); - instance.put("order_id", value); - return getBuilderAfterOrderId(instance); - } - - default T order_id(float value) { - var instance = getInstance(); - instance.put("order_id", value); - return getBuilderAfterOrderId(instance); - } - - default T order_id(long value) { - var instance = getInstance(); - instance.put("order_id", value); - return getBuilderAfterOrderId(instance); - } - - default T order_id(double value) { - var instance = getInstance(); - instance.put("order_id", value); - return getBuilderAfterOrderId(instance); - } - } - - public static class PathParametersMap0Builder implements GenericBuilder> { - private final Map instance; - private static final Set knownKeys = Set.of( - "order_id" - ); - public Set getKnownKeys() { - return knownKeys; - } - public PathParametersMap0Builder(Map instance) { - this.instance = instance; - } - public Map build() { - return instance; - } - } - - public static class PathParametersMapBuilder implements SetterForOrderId { - private final Map instance; - public PathParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map getInstance() { - return instance; - } - public PathParametersMap0Builder getBuilderAfterOrderId(Map instance) { - return new PathParametersMap0Builder(instance); - } - } - - - public sealed interface PathParameters1Boxed permits PathParameters1BoxedMap { - @Nullable Object getData(); - } - - public record PathParameters1BoxedMap(PathParametersMap data) implements PathParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable PathParameters1 instance = null; - - protected PathParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("order_id", Schema0.Schema01.class) - )) - .required(Set.of( - "order_id" - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static PathParameters1 getInstance() { - if (instance == null) { - instance = new PathParameters1(); - } - return instance; - } - - public PathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - if (!(propertyInstance instanceof Number)) { - throw new RuntimeException("Invalid instantiated value"); - } - properties.put(propertyName, (Number) propertyInstance); - } - FrozenMap castProperties = new FrozenMap<>(properties); - return new PathParametersMap(castProperties); - } - - public PathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new PathParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/Responses.java deleted file mode 100644 index 5c23d3cc14c..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/Responses.java +++ /dev/null @@ -1,77 +0,0 @@ -package org.openapijsonschematools.client.paths.storeorderorderid.get; - -import org.openapijsonschematools.client.paths.storeorderorderid.get.responses.Code200Response; -import org.openapijsonschematools.client.paths.storeorderorderid.get.responses.Code400Response; -import org.openapijsonschematools.client.paths.storeorderorderid.get.responses.Code404Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer, StatusCode400ResponseDeserializer, StatusCode404ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - public static final class StatusCode400ResponseDeserializer extends Code400Response.Code400Response1 implements StatusCodeResponseDeserializer { - } - public static final class StatusCode404ResponseDeserializer extends Code404Response.Code404Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()), - new AbstractMap.SimpleEntry<>("400", new StatusCode400ResponseDeserializer()), - new AbstractMap.SimpleEntry<>("404", new StatusCode404ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - if (statusCodeDeserializer instanceof StatusCode200ResponseDeserializer castDeserializer) { - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } else if (statusCodeDeserializer instanceof StatusCode400ResponseDeserializer castDeserializer) { - var deserializedResponse = castDeserializer.deserialize(response, configuration); - throw new Code400Response.ResponseApiException( - "Received error statusCode response from server", - response, - deserializedResponse - ); - } else { - StatusCode404ResponseDeserializer castDeserializer = (StatusCode404ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - throw new Code404Response.ResponseApiException( - "Received error statusCode response from server", - response, - deserializedResponse - ); - } - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/StoreorderorderidGetPathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/StoreorderorderidGetPathParameters.java new file mode 100644 index 00000000000..5cd36c42b58 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/StoreorderorderidGetPathParameters.java @@ -0,0 +1,223 @@ +package org.openapijsonschematools.client.paths.storeorderorderid.get; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.storeorderorderid.get.parameters.parameter0.Schema0; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class StoreorderorderidGetPathParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class StoreorderorderidGetadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable StoreorderorderidGetadditionalProperties instance = null; + public static StoreorderorderidGetadditionalProperties getInstance() { + if (instance == null) { + instance = new StoreorderorderidGetadditionalProperties(); + } + return instance; + } + } + + + public static class StoreorderorderidGetPathParametersMap extends FrozenMap { + protected StoreorderorderidGetPathParametersMap(FrozenMap m) { + super(m); + } + public static final Set requiredKeys = Set.of( + "order_id" + ); + public static final Set optionalKeys = Set.of(); + public static StoreorderorderidGetPathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return StoreorderorderidGetPathParameters1.getInstance().validate(arg, configuration); + } + + public Number order_id() { + try { + return getOrThrow("version"); + } catch (UnsetPropertyException e) { + throw new RuntimeException(e); + } + } + } + + public interface SetterForStoreorderorderidGetorderId { + Map getInstance(); + T getBuilderAfterStoreorderorderidGetorderId(Map instance); + + default T order_id(int value) { + var instance = getInstance(); + instance.put("order_id", value); + return getBuilderAfterStoreorderorderidGetorderId(instance); + } + + default T order_id(float value) { + var instance = getInstance(); + instance.put("order_id", value); + return getBuilderAfterStoreorderorderidGetorderId(instance); + } + + default T order_id(long value) { + var instance = getInstance(); + instance.put("order_id", value); + return getBuilderAfterStoreorderorderidGetorderId(instance); + } + + default T order_id(double value) { + var instance = getInstance(); + instance.put("order_id", value); + return getBuilderAfterStoreorderorderidGetorderId(instance); + } + } + + public static class StoreorderorderidGetPathParametersMap0Builder implements GenericBuilder> { + private final Map instance; + private static final Set knownKeys = Set.of( + "order_id" + ); + public Set getKnownKeys() { + return knownKeys; + } + public StoreorderorderidGetPathParametersMap0Builder(Map instance) { + this.instance = instance; + } + public Map build() { + return instance; + } + } + + public static class StoreorderorderidGetPathParametersMapBuilder implements SetterForStoreorderorderidGetorderId { + private final Map instance; + public StoreorderorderidGetPathParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map getInstance() { + return instance; + } + public StoreorderorderidGetPathParametersMap0Builder getBuilderAfterStoreorderorderidGetorderId(Map instance) { + return new StoreorderorderidGetPathParametersMap0Builder(instance); + } + } + + + public sealed interface StoreorderorderidGetPathParameters1Boxed permits StoreorderorderidGetPathParameters1BoxedMap { + @Nullable Object getData(); + } + + public record StoreorderorderidGetPathParameters1BoxedMap(StoreorderorderidGetPathParametersMap data) implements StoreorderorderidGetPathParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class StoreorderorderidGetPathParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable StoreorderorderidGetPathParameters1 instance = null; + + protected StoreorderorderidGetPathParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("order_id", Schema0.Schema01.class) + )) + .required(Set.of( + "order_id" + )) + .additionalProperties(StoreorderorderidGetadditionalProperties.class) + ); + } + + public static StoreorderorderidGetPathParameters1 getInstance() { + if (instance == null) { + instance = new StoreorderorderidGetPathParameters1(); + } + return instance; + } + + public StoreorderorderidGetPathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof Number)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (Number) propertyInstance); + } + FrozenMap castProperties = new FrozenMap<>(properties); + return new StoreorderorderidGetPathParametersMap(castProperties); + } + + public StoreorderorderidGetPathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public StoreorderorderidGetPathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new StoreorderorderidGetPathParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public StoreorderorderidGetPathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/StoreorderorderidGetResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/StoreorderorderidGetResponses.java new file mode 100644 index 00000000000..fe5a0ecb10f --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/StoreorderorderidGetResponses.java @@ -0,0 +1,77 @@ +package org.openapijsonschematools.client.paths.storeorderorderid.get; + +import org.openapijsonschematools.client.paths.storeorderorderid.get.responses.StoreorderorderidGetCode200Response; +import org.openapijsonschematools.client.paths.storeorderorderid.get.responses.StoreorderorderidGetCode400Response; +import org.openapijsonschematools.client.paths.storeorderorderid.get.responses.StoreorderorderidGetCode404Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class StoreorderorderidGetResponses { + public sealed interface EndpointResponse permits EndpointStoreorderorderidGetCode200Response {} + + public record EndpointStoreorderorderidGetCode200Response( + HttpResponse response, + StoreorderorderidGetCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusStoreorderorderidGetCode200ResponseDeserializer, StatusStoreorderorderidGetCode400ResponseDeserializer, StatusStoreorderorderidGetCode404ResponseDeserializer {} + + public static final class StatusStoreorderorderidGetCode200ResponseDeserializer extends StoreorderorderidGetCode200Response.StoreorderorderidGetCode200Response1 implements StatusCodeResponseDeserializer { + } + public static final class StatusStoreorderorderidGetCode400ResponseDeserializer extends StoreorderorderidGetCode400Response.StoreorderorderidGetCode400Response1 implements StatusCodeResponseDeserializer { + } + public static final class StatusStoreorderorderidGetCode404ResponseDeserializer extends StoreorderorderidGetCode404Response.StoreorderorderidGetCode404Response1 implements StatusCodeResponseDeserializer { + } + + public static final class StoreorderorderidGetResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public StoreorderorderidGetResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusStoreorderorderidGetCode200ResponseDeserializer()), + new AbstractMap.SimpleEntry<>("400", new StatusStoreorderorderidGetCode400ResponseDeserializer()), + new AbstractMap.SimpleEntry<>("404", new StatusStoreorderorderidGetCode404ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + if (statusCodeDeserializer instanceof StatusStoreorderorderidGetCode200ResponseDeserializer castDeserializer) { + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointStoreorderorderidGetCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } else if (statusCodeDeserializer instanceof StatusStoreorderorderidGetCode400ResponseDeserializer castDeserializer) { + var deserializedResponse = castDeserializer.deserialize(response, configuration); + throw new StoreorderorderidGetCode400Response.ResponseApiException( + "Received error statusCode response from server", + response, + deserializedResponse + ); + } else { + StatusStoreorderorderidGetCode404ResponseDeserializer castDeserializer = (StatusStoreorderorderidGetCode404ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + throw new StoreorderorderidGetCode404Response.ResponseApiException( + "Received error statusCode response from server", + response, + deserializedResponse + ); + } + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/Code200Response.java deleted file mode 100644 index e0cea6e6191..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/Code200Response.java +++ /dev/null @@ -1,81 +0,0 @@ -package org.openapijsonschematools.client.paths.storeorderorderid.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.storeorderorderid.get.responses.code200response.content.applicationxml.ApplicationxmlSchema; -import org.openapijsonschematools.client.paths.storeorderorderid.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationxmlMediaType, ApplicationjsonMediaType {} - - public record ApplicationxmlMediaType(ApplicationxmlSchema.ApplicationxmlSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationxmlMediaType() { - this(ApplicationxmlSchema.ApplicationxmlSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationxmlResponseBody, ApplicationjsonResponseBody {} - public record ApplicationxmlResponseBody(ApplicationxmlSchema.Order1Boxed body) implements SealedResponseBody { } - public record ApplicationjsonResponseBody(ApplicationjsonSchema.Order1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/xml", new ApplicationxmlMediaType()), - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - if (mediaType instanceof ApplicationxmlMediaType thisMediaType) { - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationxmlResponseBody(deserializedBody); - } else { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/Code400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/Code400Response.java deleted file mode 100644 index c3304e02b39..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/Code400Response.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapijsonschematools.client.paths.storeorderorderid.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; - -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code400Response { - - public static class Code400Response1 extends ResponseDeserializer { - public Code400Response1() { - super( - MapUtils.makeMap( - ) - ); - } - - @Override - protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { - return null; - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/Code404Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/Code404Response.java deleted file mode 100644 index 5de14a5ccd1..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/Code404Response.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapijsonschematools.client.paths.storeorderorderid.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; - -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code404Response { - - public static class Code404Response1 extends ResponseDeserializer { - public Code404Response1() { - super( - MapUtils.makeMap( - ) - ); - } - - @Override - protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { - return null; - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/StoreorderorderidGetCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/StoreorderorderidGetCode200Response.java new file mode 100644 index 00000000000..f15a3a49f9f --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/StoreorderorderidGetCode200Response.java @@ -0,0 +1,81 @@ +package org.openapijsonschematools.client.paths.storeorderorderid.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.storeorderorderid.get.responses.code200response.content.applicationxml.ApplicationxmlSchema; +import org.openapijsonschematools.client.paths.storeorderorderid.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class StoreorderorderidGetCode200Response { + public sealed interface SealedMediaType permits ApplicationxmlMediaType, ApplicationjsonMediaType {} + + public record ApplicationxmlMediaType(ApplicationxmlSchema.ApplicationxmlSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationxmlMediaType() { + this(ApplicationxmlSchema.ApplicationxmlSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationxmlResponseBody, ApplicationjsonResponseBody {} + public record ApplicationxmlResponseBody(ApplicationxmlSchema.Order1Boxed body) implements SealedResponseBody { } + public record ApplicationjsonResponseBody(ApplicationjsonSchema.Order1Boxed body) implements SealedResponseBody { } + + public static class StoreorderorderidGetCode200Response1 extends ResponseDeserializer { + public StoreorderorderidGetCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/xml", new ApplicationxmlMediaType()), + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + if (mediaType instanceof ApplicationxmlMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationxmlResponseBody(deserializedBody); + } else { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/StoreorderorderidGetCode400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/StoreorderorderidGetCode400Response.java new file mode 100644 index 00000000000..c444b171ea4 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/StoreorderorderidGetCode400Response.java @@ -0,0 +1,45 @@ +package org.openapijsonschematools.client.paths.storeorderorderid.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class StoreorderorderidGetCode400Response { + + public static class StoreorderorderidGetCode400Response1 extends ResponseDeserializer { + public StoreorderorderidGetCode400Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/StoreorderorderidGetCode404Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/StoreorderorderidGetCode404Response.java new file mode 100644 index 00000000000..39125cd7b5e --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/storeorderorderid/get/responses/StoreorderorderidGetCode404Response.java @@ -0,0 +1,45 @@ +package org.openapijsonschematools.client.paths.storeorderorderid.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class StoreorderorderidGetCode404Response { + + public static class StoreorderorderidGetCode404Response1 extends ResponseDeserializer { + public StoreorderorderidGetCode404Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/Post.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/Post.java deleted file mode 100644 index 51f43cc60ac..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/Post.java +++ /dev/null @@ -1,174 +0,0 @@ -package org.openapijsonschematools.client.paths.user; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.user.post.RequestBody; -import org.openapijsonschematools.client.paths.user.post.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.User; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Post { - private static class PostProvider { - private static final String method = "post"; - - public static Responses.EndpointResponse post( - PostRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - SerializedRequestBody serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + User.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PostOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Post1 extends ApiClient implements PostOperation { - public Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PostRequest { - public RequestBody.SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - - public PostRequest( - RequestBody.SealedRequestBody requestBody, - RootServerInfo.@Nullable ServerIndex serverIndex, - @Nullable Duration timeout - ) { - this.requestBody = requestBody; - this.serverIndex = serverIndex; - this.timeout = timeout; - } - } - - public static class PostNullableRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - PostNullableRequest getInstance(); - T getBuilderAfterServerIndex(PostNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PostNullableRequest getInstance(); - T getBuilderAfterTimeout(PostNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForRequestBody { - PostNullableRequest getInstance(); - T getBuilderAfterRequestBody(PostNullableRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public static class Post0RequestBuilder implements SetterForServerIndex, SetterForTimeout { - private final PostNullableRequest instance; - - public Post0RequestBuilder(PostNullableRequest instance) { - this.instance = instance; - } - - public PostRequest build() { - var requestBody = instance.requestBody; - if (requestBody == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new PostRequest( - requestBody, - instance.serverIndex, - instance.timeout - ); - } - - public PostNullableRequest getInstance() { - return instance; - } - - public Post0RequestBuilder getBuilderAfterServerIndex(PostNullableRequest instance) { - return this; - } - - public Post0RequestBuilder getBuilderAfterTimeout(PostNullableRequest instance) { - return this; - } - } - public static class PostRequestBuilder implements SetterForRequestBody { - private final PostNullableRequest instance; - - public PostRequestBuilder() { - this.instance = new PostNullableRequest(); - } - - public PostNullableRequest getInstance() { - return instance; - } - - public Post0RequestBuilder getBuilderAfterRequestBody(PostNullableRequest instance) { - return new Post0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/UserPost.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/UserPost.java new file mode 100644 index 00000000000..9881c39c507 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/UserPost.java @@ -0,0 +1,183 @@ +package org.openapijsonschematools.client.paths.user; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.user.post.UserPostRequestBody; +import org.openapijsonschematools.client.paths.user.post.UserPostResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.User; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class UserPost { + private static class PostProvider { + private static final String method = "post"; + + public static UserPostResponses.EndpointResponse post( + PostRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + SerializedRequestBody serializedRequestBody = new UserPostRequestBody.UserPostRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + User.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new UserPostResponses.UserPostResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PostOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default UserPostResponses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface CreateUserOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default UserPostResponses.EndpointResponse createUser(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Post extends ApiClient implements PostOperation { + public Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PostRequest { + public UserPostRequestBody.SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + + public PostRequest( + UserPostRequestBody.SealedRequestBody requestBody, + RootServerInfo.@Nullable ServerIndex serverIndex, + @Nullable Duration timeout + ) { + this.requestBody = requestBody; + this.serverIndex = serverIndex; + this.timeout = timeout; + } + } + + public static class PostNullableRequest { + public UserPostRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + PostNullableRequest getInstance(); + T getBuilderAfterServerIndex(PostNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PostNullableRequest getInstance(); + T getBuilderAfterTimeout(PostNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForRequestBody { + PostNullableRequest getInstance(); + T getBuilderAfterRequestBody(PostNullableRequest instance); + default T requestBody(UserPostRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public static class Post0RequestBuilder implements SetterForServerIndex, SetterForTimeout { + private final PostNullableRequest instance; + + public Post0RequestBuilder(PostNullableRequest instance) { + this.instance = instance; + } + + public PostRequest build() { + var requestBody = instance.requestBody; + if (requestBody == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new PostRequest( + requestBody, + instance.serverIndex, + instance.timeout + ); + } + + public PostNullableRequest getInstance() { + return instance; + } + + public Post0RequestBuilder getBuilderAfterServerIndex(PostNullableRequest instance) { + return this; + } + + public Post0RequestBuilder getBuilderAfterTimeout(PostNullableRequest instance) { + return this; + } + } + public static class PostRequestBuilder implements SetterForRequestBody { + private final PostNullableRequest instance; + + public PostRequestBuilder() { + this.instance = new PostNullableRequest(); + } + + public PostNullableRequest getInstance() { + return instance; + } + + public Post0RequestBuilder getBuilderAfterRequestBody(PostNullableRequest instance) { + return new Post0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/post/RequestBody.java deleted file mode 100644 index 52a467ba8dd..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/post/RequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.user.post; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.user.post.requestbody.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ), - true - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } - } - - public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} - public record ApplicationjsonRequestBody(ApplicationjsonSchema.User1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "application/json"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/post/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/post/Responses.java deleted file mode 100644 index c1cc62b43da..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/post/Responses.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.openapijsonschematools.client.paths.user.post; - -import org.openapijsonschematools.client.paths.user.post.responses.CodedefaultResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCodedefaultResponse {} - - public record EndpointCodedefaultResponse( - HttpResponse response, - Void body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public static final class Responses1 implements ResponsesDeserializer { - private final CodedefaultResponse.CodedefaultResponse1 defaultResponseDeserializer; - public Responses1() { - this.defaultResponseDeserializer = new CodedefaultResponse.CodedefaultResponse1(); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - var deserializedResponse = defaultResponseDeserializer.deserialize(response, configuration); - return new EndpointCodedefaultResponse(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/post/UserPostRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/post/UserPostRequestBody.java new file mode 100644 index 00000000000..ba6a1c6372e --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/post/UserPostRequestBody.java @@ -0,0 +1,53 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.user.post; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.user.post.requestbody.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class UserPostRequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class UserPostRequestBody1 extends RequestBodySerializer { + public UserPostRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ), + true + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } + } + + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.User1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "application/json"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/post/UserPostResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/post/UserPostResponses.java new file mode 100644 index 00000000000..f87b60de8c9 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/post/UserPostResponses.java @@ -0,0 +1,37 @@ +package org.openapijsonschematools.client.paths.user.post; + +import org.openapijsonschematools.client.paths.user.post.responses.UserPostCodedefaultResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class UserPostResponses { + public sealed interface EndpointResponse permits EndpointUserPostCodedefaultResponse {} + + public record EndpointUserPostCodedefaultResponse( + HttpResponse response, + Void body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public static final class UserPostResponses1 implements ResponsesDeserializer { + private final UserPostCodedefaultResponse.UserPostCodedefaultResponse1 defaultResponseDeserializer; + public UserPostResponses1() { + this.defaultResponseDeserializer = new UserPostCodedefaultResponse.UserPostCodedefaultResponse1(); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + var deserializedResponse = defaultResponseDeserializer.deserialize(response, configuration); + return new EndpointUserPostCodedefaultResponse(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/post/responses/CodedefaultResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/post/responses/CodedefaultResponse.java deleted file mode 100644 index 20148c56e39..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/post/responses/CodedefaultResponse.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapijsonschematools.client.paths.user.post.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; - -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class CodedefaultResponse { - - public static class CodedefaultResponse1 extends ResponseDeserializer { - public CodedefaultResponse1() { - super( - MapUtils.makeMap( - ) - ); - } - - @Override - protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { - return null; - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/post/responses/UserPostCodedefaultResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/post/responses/UserPostCodedefaultResponse.java new file mode 100644 index 00000000000..c5be0393da1 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/user/post/responses/UserPostCodedefaultResponse.java @@ -0,0 +1,45 @@ +package org.openapijsonschematools.client.paths.user.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class UserPostCodedefaultResponse { + + public static class UserPostCodedefaultResponse1 extends ResponseDeserializer { + public UserPostCodedefaultResponse1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/Post.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/Post.java deleted file mode 100644 index a2d805d6d78..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/Post.java +++ /dev/null @@ -1,174 +0,0 @@ -package org.openapijsonschematools.client.paths.usercreatewitharray; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.usercreatewitharray.post.RequestBody; -import org.openapijsonschematools.client.paths.usercreatewitharray.post.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Usercreatewitharray; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Post { - private static class PostProvider { - private static final String method = "post"; - - public static Responses.EndpointResponse post( - PostRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - SerializedRequestBody serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Usercreatewitharray.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PostOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Post1 extends ApiClient implements PostOperation { - public Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PostRequest { - public RequestBody.SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - - public PostRequest( - RequestBody.SealedRequestBody requestBody, - RootServerInfo.@Nullable ServerIndex serverIndex, - @Nullable Duration timeout - ) { - this.requestBody = requestBody; - this.serverIndex = serverIndex; - this.timeout = timeout; - } - } - - public static class PostNullableRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - PostNullableRequest getInstance(); - T getBuilderAfterServerIndex(PostNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PostNullableRequest getInstance(); - T getBuilderAfterTimeout(PostNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForRequestBody { - PostNullableRequest getInstance(); - T getBuilderAfterRequestBody(PostNullableRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public static class Post0RequestBuilder implements SetterForServerIndex, SetterForTimeout { - private final PostNullableRequest instance; - - public Post0RequestBuilder(PostNullableRequest instance) { - this.instance = instance; - } - - public PostRequest build() { - var requestBody = instance.requestBody; - if (requestBody == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new PostRequest( - requestBody, - instance.serverIndex, - instance.timeout - ); - } - - public PostNullableRequest getInstance() { - return instance; - } - - public Post0RequestBuilder getBuilderAfterServerIndex(PostNullableRequest instance) { - return this; - } - - public Post0RequestBuilder getBuilderAfterTimeout(PostNullableRequest instance) { - return this; - } - } - public static class PostRequestBuilder implements SetterForRequestBody { - private final PostNullableRequest instance; - - public PostRequestBuilder() { - this.instance = new PostNullableRequest(); - } - - public PostNullableRequest getInstance() { - return instance; - } - - public Post0RequestBuilder getBuilderAfterRequestBody(PostNullableRequest instance) { - return new Post0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/UsercreatewitharrayPost.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/UsercreatewitharrayPost.java new file mode 100644 index 00000000000..e3c07ef1234 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/UsercreatewitharrayPost.java @@ -0,0 +1,183 @@ +package org.openapijsonschematools.client.paths.usercreatewitharray; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.usercreatewitharray.post.UsercreatewitharrayPostRequestBody; +import org.openapijsonschematools.client.paths.usercreatewitharray.post.UsercreatewitharrayPostResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Usercreatewitharray; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class UsercreatewitharrayPost { + private static class PostProvider { + private static final String method = "post"; + + public static UsercreatewitharrayPostResponses.EndpointResponse post( + PostRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + SerializedRequestBody serializedRequestBody = new UsercreatewitharrayPostRequestBody.UsercreatewitharrayPostRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Usercreatewitharray.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new UsercreatewitharrayPostResponses.UsercreatewitharrayPostResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PostOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default UsercreatewitharrayPostResponses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface CreateUsersWithArrayInputOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default UsercreatewitharrayPostResponses.EndpointResponse createUsersWithArrayInput(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Post extends ApiClient implements PostOperation { + public Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PostRequest { + public UsercreatewitharrayPostRequestBody.SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + + public PostRequest( + UsercreatewitharrayPostRequestBody.SealedRequestBody requestBody, + RootServerInfo.@Nullable ServerIndex serverIndex, + @Nullable Duration timeout + ) { + this.requestBody = requestBody; + this.serverIndex = serverIndex; + this.timeout = timeout; + } + } + + public static class PostNullableRequest { + public UsercreatewitharrayPostRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + PostNullableRequest getInstance(); + T getBuilderAfterServerIndex(PostNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PostNullableRequest getInstance(); + T getBuilderAfterTimeout(PostNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForRequestBody { + PostNullableRequest getInstance(); + T getBuilderAfterRequestBody(PostNullableRequest instance); + default T requestBody(UsercreatewitharrayPostRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public static class Post0RequestBuilder implements SetterForServerIndex, SetterForTimeout { + private final PostNullableRequest instance; + + public Post0RequestBuilder(PostNullableRequest instance) { + this.instance = instance; + } + + public PostRequest build() { + var requestBody = instance.requestBody; + if (requestBody == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new PostRequest( + requestBody, + instance.serverIndex, + instance.timeout + ); + } + + public PostNullableRequest getInstance() { + return instance; + } + + public Post0RequestBuilder getBuilderAfterServerIndex(PostNullableRequest instance) { + return this; + } + + public Post0RequestBuilder getBuilderAfterTimeout(PostNullableRequest instance) { + return this; + } + } + public static class PostRequestBuilder implements SetterForRequestBody { + private final PostNullableRequest instance; + + public PostRequestBuilder() { + this.instance = new PostNullableRequest(); + } + + public PostNullableRequest getInstance() { + return instance; + } + + public Post0RequestBuilder getBuilderAfterRequestBody(PostNullableRequest instance) { + return new Post0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/post/RequestBody.java deleted file mode 100644 index 8d2d3a4bc61..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/post/RequestBody.java +++ /dev/null @@ -1,11 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.usercreatewitharray.post; - -import org.openapijsonschematools.client.components.requestbodies.UserArray; - -public class RequestBody extends UserArray { - public static class RequestBody1 extends UserArray1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/post/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/post/Responses.java deleted file mode 100644 index 79c988e4f1b..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/post/Responses.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.openapijsonschematools.client.paths.usercreatewitharray.post; - -import org.openapijsonschematools.client.paths.usercreatewitharray.post.responses.CodedefaultResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCodedefaultResponse {} - - public record EndpointCodedefaultResponse( - HttpResponse response, - Void body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public static final class Responses1 implements ResponsesDeserializer { - private final CodedefaultResponse.CodedefaultResponse1 defaultResponseDeserializer; - public Responses1() { - this.defaultResponseDeserializer = new CodedefaultResponse.CodedefaultResponse1(); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - var deserializedResponse = defaultResponseDeserializer.deserialize(response, configuration); - return new EndpointCodedefaultResponse(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/post/UsercreatewitharrayPostRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/post/UsercreatewitharrayPostRequestBody.java new file mode 100644 index 00000000000..b662a0bbb6c --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/post/UsercreatewitharrayPostRequestBody.java @@ -0,0 +1,11 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.usercreatewitharray.post; + +import org.openapijsonschematools.client.components.requestbodies.UserArray; + +public class UsercreatewitharrayPostRequestBody extends UserArray { + public static class UsercreatewitharrayPostRequestBody1 extends UserArray1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/post/UsercreatewitharrayPostResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/post/UsercreatewitharrayPostResponses.java new file mode 100644 index 00000000000..6e7f68122fb --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/post/UsercreatewitharrayPostResponses.java @@ -0,0 +1,37 @@ +package org.openapijsonschematools.client.paths.usercreatewitharray.post; + +import org.openapijsonschematools.client.paths.usercreatewitharray.post.responses.UsercreatewitharrayPostCodedefaultResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class UsercreatewitharrayPostResponses { + public sealed interface EndpointResponse permits EndpointUsercreatewitharrayPostCodedefaultResponse {} + + public record EndpointUsercreatewitharrayPostCodedefaultResponse( + HttpResponse response, + Void body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public static final class UsercreatewitharrayPostResponses1 implements ResponsesDeserializer { + private final UsercreatewitharrayPostCodedefaultResponse.UsercreatewitharrayPostCodedefaultResponse1 defaultResponseDeserializer; + public UsercreatewitharrayPostResponses1() { + this.defaultResponseDeserializer = new UsercreatewitharrayPostCodedefaultResponse.UsercreatewitharrayPostCodedefaultResponse1(); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + var deserializedResponse = defaultResponseDeserializer.deserialize(response, configuration); + return new EndpointUsercreatewitharrayPostCodedefaultResponse(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/post/responses/CodedefaultResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/post/responses/CodedefaultResponse.java deleted file mode 100644 index bd617d9262d..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/post/responses/CodedefaultResponse.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapijsonschematools.client.paths.usercreatewitharray.post.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; - -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class CodedefaultResponse { - - public static class CodedefaultResponse1 extends ResponseDeserializer { - public CodedefaultResponse1() { - super( - MapUtils.makeMap( - ) - ); - } - - @Override - protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { - return null; - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/post/responses/UsercreatewitharrayPostCodedefaultResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/post/responses/UsercreatewitharrayPostCodedefaultResponse.java new file mode 100644 index 00000000000..9f3410d1091 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewitharray/post/responses/UsercreatewitharrayPostCodedefaultResponse.java @@ -0,0 +1,45 @@ +package org.openapijsonschematools.client.paths.usercreatewitharray.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class UsercreatewitharrayPostCodedefaultResponse { + + public static class UsercreatewitharrayPostCodedefaultResponse1 extends ResponseDeserializer { + public UsercreatewitharrayPostCodedefaultResponse1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/Post.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/Post.java deleted file mode 100644 index f8f78fabe13..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/Post.java +++ /dev/null @@ -1,174 +0,0 @@ -package org.openapijsonschematools.client.paths.usercreatewithlist; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.usercreatewithlist.post.RequestBody; -import org.openapijsonschematools.client.paths.usercreatewithlist.post.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Usercreatewithlist; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Post { - private static class PostProvider { - private static final String method = "post"; - - public static Responses.EndpointResponse post( - PostRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - SerializedRequestBody serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Usercreatewithlist.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PostOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Post1 extends ApiClient implements PostOperation { - public Post1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PostRequest { - public RequestBody.SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - - public PostRequest( - RequestBody.SealedRequestBody requestBody, - RootServerInfo.@Nullable ServerIndex serverIndex, - @Nullable Duration timeout - ) { - this.requestBody = requestBody; - this.serverIndex = serverIndex; - this.timeout = timeout; - } - } - - public static class PostNullableRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - PostNullableRequest getInstance(); - T getBuilderAfterServerIndex(PostNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PostNullableRequest getInstance(); - T getBuilderAfterTimeout(PostNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForRequestBody { - PostNullableRequest getInstance(); - T getBuilderAfterRequestBody(PostNullableRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public static class Post0RequestBuilder implements SetterForServerIndex, SetterForTimeout { - private final PostNullableRequest instance; - - public Post0RequestBuilder(PostNullableRequest instance) { - this.instance = instance; - } - - public PostRequest build() { - var requestBody = instance.requestBody; - if (requestBody == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new PostRequest( - requestBody, - instance.serverIndex, - instance.timeout - ); - } - - public PostNullableRequest getInstance() { - return instance; - } - - public Post0RequestBuilder getBuilderAfterServerIndex(PostNullableRequest instance) { - return this; - } - - public Post0RequestBuilder getBuilderAfterTimeout(PostNullableRequest instance) { - return this; - } - } - public static class PostRequestBuilder implements SetterForRequestBody { - private final PostNullableRequest instance; - - public PostRequestBuilder() { - this.instance = new PostNullableRequest(); - } - - public PostNullableRequest getInstance() { - return instance; - } - - public Post0RequestBuilder getBuilderAfterRequestBody(PostNullableRequest instance) { - return new Post0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/UsercreatewithlistPost.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/UsercreatewithlistPost.java new file mode 100644 index 00000000000..0d346b0d866 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/UsercreatewithlistPost.java @@ -0,0 +1,183 @@ +package org.openapijsonschematools.client.paths.usercreatewithlist; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.usercreatewithlist.post.UsercreatewithlistPostRequestBody; +import org.openapijsonschematools.client.paths.usercreatewithlist.post.UsercreatewithlistPostResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Usercreatewithlist; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class UsercreatewithlistPost { + private static class PostProvider { + private static final String method = "post"; + + public static UsercreatewithlistPostResponses.EndpointResponse post( + PostRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + SerializedRequestBody serializedRequestBody = new UsercreatewithlistPostRequestBody.UsercreatewithlistPostRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Usercreatewithlist.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new UsercreatewithlistPostResponses.UsercreatewithlistPostResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface PostOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default UsercreatewithlistPostResponses.EndpointResponse post(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface CreateUsersWithListInputOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default UsercreatewithlistPostResponses.EndpointResponse createUsersWithListInput(PostRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PostProvider.post(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Post extends ApiClient implements PostOperation { + public Post(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PostRequest { + public UsercreatewithlistPostRequestBody.SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + + public PostRequest( + UsercreatewithlistPostRequestBody.SealedRequestBody requestBody, + RootServerInfo.@Nullable ServerIndex serverIndex, + @Nullable Duration timeout + ) { + this.requestBody = requestBody; + this.serverIndex = serverIndex; + this.timeout = timeout; + } + } + + public static class PostNullableRequest { + public UsercreatewithlistPostRequestBody.@Nullable SealedRequestBody requestBody; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + PostNullableRequest getInstance(); + T getBuilderAfterServerIndex(PostNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PostNullableRequest getInstance(); + T getBuilderAfterTimeout(PostNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForRequestBody { + PostNullableRequest getInstance(); + T getBuilderAfterRequestBody(PostNullableRequest instance); + default T requestBody(UsercreatewithlistPostRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public static class Post0RequestBuilder implements SetterForServerIndex, SetterForTimeout { + private final PostNullableRequest instance; + + public Post0RequestBuilder(PostNullableRequest instance) { + this.instance = instance; + } + + public PostRequest build() { + var requestBody = instance.requestBody; + if (requestBody == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new PostRequest( + requestBody, + instance.serverIndex, + instance.timeout + ); + } + + public PostNullableRequest getInstance() { + return instance; + } + + public Post0RequestBuilder getBuilderAfterServerIndex(PostNullableRequest instance) { + return this; + } + + public Post0RequestBuilder getBuilderAfterTimeout(PostNullableRequest instance) { + return this; + } + } + public static class PostRequestBuilder implements SetterForRequestBody { + private final PostNullableRequest instance; + + public PostRequestBuilder() { + this.instance = new PostNullableRequest(); + } + + public PostNullableRequest getInstance() { + return instance; + } + + public Post0RequestBuilder getBuilderAfterRequestBody(PostNullableRequest instance) { + return new Post0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/post/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/post/RequestBody.java deleted file mode 100644 index 2bfea109c73..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/post/RequestBody.java +++ /dev/null @@ -1,11 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.usercreatewithlist.post; - -import org.openapijsonschematools.client.components.requestbodies.RefUserArray; - -public class RequestBody extends RefUserArray { - public static class RequestBody1 extends RefUserArray1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/post/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/post/Responses.java deleted file mode 100644 index 8c24f5ea31e..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/post/Responses.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.openapijsonschematools.client.paths.usercreatewithlist.post; - -import org.openapijsonschematools.client.paths.usercreatewithlist.post.responses.CodedefaultResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCodedefaultResponse {} - - public record EndpointCodedefaultResponse( - HttpResponse response, - Void body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public static final class Responses1 implements ResponsesDeserializer { - private final CodedefaultResponse.CodedefaultResponse1 defaultResponseDeserializer; - public Responses1() { - this.defaultResponseDeserializer = new CodedefaultResponse.CodedefaultResponse1(); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - var deserializedResponse = defaultResponseDeserializer.deserialize(response, configuration); - return new EndpointCodedefaultResponse(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/post/UsercreatewithlistPostRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/post/UsercreatewithlistPostRequestBody.java new file mode 100644 index 00000000000..29018a348a5 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/post/UsercreatewithlistPostRequestBody.java @@ -0,0 +1,11 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.usercreatewithlist.post; + +import org.openapijsonschematools.client.components.requestbodies.RefUserArray; + +public class UsercreatewithlistPostRequestBody extends RefUserArray { + public static class UsercreatewithlistPostRequestBody1 extends RefUserArray1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/post/UsercreatewithlistPostResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/post/UsercreatewithlistPostResponses.java new file mode 100644 index 00000000000..082e179676e --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/post/UsercreatewithlistPostResponses.java @@ -0,0 +1,37 @@ +package org.openapijsonschematools.client.paths.usercreatewithlist.post; + +import org.openapijsonschematools.client.paths.usercreatewithlist.post.responses.UsercreatewithlistPostCodedefaultResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class UsercreatewithlistPostResponses { + public sealed interface EndpointResponse permits EndpointUsercreatewithlistPostCodedefaultResponse {} + + public record EndpointUsercreatewithlistPostCodedefaultResponse( + HttpResponse response, + Void body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public static final class UsercreatewithlistPostResponses1 implements ResponsesDeserializer { + private final UsercreatewithlistPostCodedefaultResponse.UsercreatewithlistPostCodedefaultResponse1 defaultResponseDeserializer; + public UsercreatewithlistPostResponses1() { + this.defaultResponseDeserializer = new UsercreatewithlistPostCodedefaultResponse.UsercreatewithlistPostCodedefaultResponse1(); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + var deserializedResponse = defaultResponseDeserializer.deserialize(response, configuration); + return new EndpointUsercreatewithlistPostCodedefaultResponse(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/post/responses/CodedefaultResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/post/responses/CodedefaultResponse.java deleted file mode 100644 index a8989114b04..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/post/responses/CodedefaultResponse.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapijsonschematools.client.paths.usercreatewithlist.post.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; - -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class CodedefaultResponse { - - public static class CodedefaultResponse1 extends ResponseDeserializer { - public CodedefaultResponse1() { - super( - MapUtils.makeMap( - ) - ); - } - - @Override - protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { - return null; - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/post/responses/UsercreatewithlistPostCodedefaultResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/post/responses/UsercreatewithlistPostCodedefaultResponse.java new file mode 100644 index 00000000000..6966b53669d --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/usercreatewithlist/post/responses/UsercreatewithlistPostCodedefaultResponse.java @@ -0,0 +1,45 @@ +package org.openapijsonschematools.client.paths.usercreatewithlist.post.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class UsercreatewithlistPostCodedefaultResponse { + + public static class UsercreatewithlistPostCodedefaultResponse1 extends ResponseDeserializer { + public UsercreatewithlistPostCodedefaultResponse1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/Get.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/Get.java deleted file mode 100644 index c2660417c71..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/Get.java +++ /dev/null @@ -1,171 +0,0 @@ -package org.openapijsonschematools.client.paths.userlogin; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.userlogin.get.QueryParameters; -import org.openapijsonschematools.client.paths.userlogin.get.Parameters; -import org.openapijsonschematools.client.paths.userlogin.get.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.paths.Userlogin; - -import java.io.IOException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Get { - private static class GetProvider { - private static final String method = "get"; - - public static Responses.EndpointResponse get( - GetRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - - var querySerializer = new Parameters.QueryParametersSerializer(); - @Nullable Map queryMap = querySerializer.getQueryMap(request.queryParameters); - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Userlogin.path; - if (queryMap != null) { - url = url + querySerializer.serialize(queryMap); - } - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface GetOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Get1 extends ApiClient implements GetOperation { - public Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class GetRequest { - public QueryParameters.QueryParametersMap queryParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - - public GetRequest( - QueryParameters.QueryParametersMap queryParameters, - RootServerInfo.@Nullable ServerIndex serverIndex, - @Nullable Duration timeout - ) { - this.queryParameters = queryParameters; - this.serverIndex = serverIndex; - this.timeout = timeout; - } - } - - public static class GetNullableRequest { - public QueryParameters.@Nullable QueryParametersMap queryParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - GetNullableRequest getInstance(); - T getBuilderAfterServerIndex(GetNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - GetNullableRequest getInstance(); - T getBuilderAfterTimeout(GetNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForQueryParameters { - GetNullableRequest getInstance(); - T getBuilderAfterQueryParameters(GetNullableRequest instance); - default T queryParameters(QueryParameters.QueryParametersMap queryParameters) { - var instance = getInstance(); - instance.queryParameters = queryParameters; - return getBuilderAfterQueryParameters(instance); - } - } - - public static class Get0RequestBuilder implements SetterForServerIndex, SetterForTimeout { - private final GetNullableRequest instance; - - public Get0RequestBuilder(GetNullableRequest instance) { - this.instance = instance; - } - - public GetRequest build() { - var queryParameters = instance.queryParameters; - if (queryParameters == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new GetRequest( - queryParameters, - instance.serverIndex, - instance.timeout - ); - } - - public GetNullableRequest getInstance() { - return instance; - } - - public Get0RequestBuilder getBuilderAfterServerIndex(GetNullableRequest instance) { - return this; - } - - public Get0RequestBuilder getBuilderAfterTimeout(GetNullableRequest instance) { - return this; - } - } - public static class GetRequestBuilder implements SetterForQueryParameters { - private final GetNullableRequest instance; - - public GetRequestBuilder() { - this.instance = new GetNullableRequest(); - } - - public GetNullableRequest getInstance() { - return instance; - } - - public Get0RequestBuilder getBuilderAfterQueryParameters(GetNullableRequest instance) { - return new Get0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/UserloginGet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/UserloginGet.java new file mode 100644 index 00000000000..15b691bd5c7 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/UserloginGet.java @@ -0,0 +1,180 @@ +package org.openapijsonschematools.client.paths.userlogin; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.userlogin.get.UserloginGetQueryParameters; +import org.openapijsonschematools.client.paths.userlogin.get.Parameters; +import org.openapijsonschematools.client.paths.userlogin.get.UserloginGetResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.paths.Userlogin; + +import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class UserloginGet { + private static class GetProvider { + private static final String method = "get"; + + public static UserloginGetResponses.EndpointResponse get( + GetRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + + var querySerializer = new Parameters.QueryParametersSerializer(); + @Nullable Map queryMap = querySerializer.getQueryMap(request.queryParameters); + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Userlogin.path; + if (queryMap != null) { + url = url + querySerializer.serialize(queryMap); + } + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new UserloginGetResponses.UserloginGetResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface GetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default UserloginGetResponses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface LoginUserOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default UserloginGetResponses.EndpointResponse loginUser(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Get extends ApiClient implements GetOperation { + public Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class GetRequest { + public UserloginGetQueryParameters.UserloginGetQueryParametersMap queryParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + + public GetRequest( + UserloginGetQueryParameters.UserloginGetQueryParametersMap queryParameters, + RootServerInfo.@Nullable ServerIndex serverIndex, + @Nullable Duration timeout + ) { + this.queryParameters = queryParameters; + this.serverIndex = serverIndex; + this.timeout = timeout; + } + } + + public static class GetNullableRequest { + public UserloginGetQueryParameters.@Nullable UserloginGetQueryParametersMap queryParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + GetNullableRequest getInstance(); + T getBuilderAfterServerIndex(GetNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + GetNullableRequest getInstance(); + T getBuilderAfterTimeout(GetNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForQueryParameters { + GetNullableRequest getInstance(); + T getBuilderAfterQueryParameters(GetNullableRequest instance); + default T queryParameters(UserloginGetQueryParameters.UserloginGetQueryParametersMap queryParameters) { + var instance = getInstance(); + instance.queryParameters = queryParameters; + return getBuilderAfterQueryParameters(instance); + } + } + + public static class Get0RequestBuilder implements SetterForServerIndex, SetterForTimeout { + private final GetNullableRequest instance; + + public Get0RequestBuilder(GetNullableRequest instance) { + this.instance = instance; + } + + public GetRequest build() { + var queryParameters = instance.queryParameters; + if (queryParameters == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new GetRequest( + queryParameters, + instance.serverIndex, + instance.timeout + ); + } + + public GetNullableRequest getInstance() { + return instance; + } + + public Get0RequestBuilder getBuilderAfterServerIndex(GetNullableRequest instance) { + return this; + } + + public Get0RequestBuilder getBuilderAfterTimeout(GetNullableRequest instance) { + return this; + } + } + public static class GetRequestBuilder implements SetterForQueryParameters { + private final GetNullableRequest instance; + + public GetRequestBuilder() { + this.instance = new GetNullableRequest(); + } + + public GetNullableRequest getInstance() { + return instance; + } + + public Get0RequestBuilder getBuilderAfterQueryParameters(GetNullableRequest instance) { + return new Get0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/QueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/QueryParameters.java deleted file mode 100644 index 6da4b7ec867..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/QueryParameters.java +++ /dev/null @@ -1,255 +0,0 @@ -package org.openapijsonschematools.client.paths.userlogin.get; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.userlogin.get.parameters.parameter0.Schema0; -import org.openapijsonschematools.client.paths.userlogin.get.parameters.parameter1.Schema1; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class QueryParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class QueryParametersMap extends FrozenMap<@Nullable Object> { - protected QueryParametersMap(FrozenMap<@Nullable Object> m) { - super(m); - } - public static final Set requiredKeys = Set.of( - "password", - "username" - ); - public static final Set optionalKeys = Set.of(); - public static QueryParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return QueryParameters1.getInstance().validate(arg, configuration); - } - - public String password() { - @Nullable Object value = get("password"); - if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for password"); - } - return (String) value; - } - - public String username() { - @Nullable Object value = get("username"); - if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for username"); - } - return (String) value; - } - } - - public interface SetterForPassword { - Map getInstance(); - T getBuilderAfterPassword(Map instance); - - default T password(String value) { - var instance = getInstance(); - instance.put("password", value); - return getBuilderAfterPassword(instance); - } - } - - public interface SetterForUsername { - Map getInstance(); - T getBuilderAfterUsername(Map instance); - - default T username(String value) { - var instance = getInstance(); - instance.put("username", value); - return getBuilderAfterUsername(instance); - } - } - - public static class QueryParametersMap00Builder implements GenericBuilder> { - private final Map instance; - private static final Set knownKeys = Set.of( - "password", - "username" - ); - public Set getKnownKeys() { - return knownKeys; - } - public QueryParametersMap00Builder(Map instance) { - this.instance = instance; - } - public Map build() { - return instance; - } - } - - public static class QueryParametersMap01Builder implements SetterForUsername { - private final Map instance; - public QueryParametersMap01Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap00Builder getBuilderAfterUsername(Map instance) { - return new QueryParametersMap00Builder(instance); - } - } - - public static class QueryParametersMap10Builder implements SetterForPassword { - private final Map instance; - public QueryParametersMap10Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public QueryParametersMap00Builder getBuilderAfterPassword(Map instance) { - return new QueryParametersMap00Builder(instance); - } - } - - public static class QueryParametersMapBuilder implements SetterForPassword, SetterForUsername { - private final Map instance; - public QueryParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map getInstance() { - return instance; - } - public QueryParametersMap01Builder getBuilderAfterPassword(Map instance) { - return new QueryParametersMap01Builder(instance); - } - public QueryParametersMap10Builder getBuilderAfterUsername(Map instance) { - return new QueryParametersMap10Builder(instance); - } - } - - - public sealed interface QueryParameters1Boxed permits QueryParameters1BoxedMap { - @Nullable Object getData(); - } - - public record QueryParameters1BoxedMap(QueryParametersMap data) implements QueryParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class QueryParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable QueryParameters1 instance = null; - - protected QueryParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("password", Schema1.Schema11.class), - new PropertyEntry("username", Schema0.Schema01.class) - )) - .required(Set.of( - "password", - "username" - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static QueryParameters1 getInstance() { - if (instance == null) { - instance = new QueryParameters1(); - } - return instance; - } - - public QueryParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, propertyInstance); - } - FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); - return new QueryParametersMap(castProperties); - } - - public QueryParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public QueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new QueryParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public QueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/Responses.java deleted file mode 100644 index 0df32af2421..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/Responses.java +++ /dev/null @@ -1,67 +0,0 @@ -package org.openapijsonschematools.client.paths.userlogin.get; - -import org.openapijsonschematools.client.paths.userlogin.get.responses.Code200Response; -import org.openapijsonschematools.client.paths.userlogin.get.responses.code200response.Code200ResponseHeadersSchema; -import org.openapijsonschematools.client.paths.userlogin.get.responses.Code400Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Code200ResponseHeadersSchema.Code200ResponseHeadersSchemaMap headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer, StatusCode400ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - public static final class StatusCode400ResponseDeserializer extends Code400Response.Code400Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()), - new AbstractMap.SimpleEntry<>("400", new StatusCode400ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - if (statusCodeDeserializer instanceof StatusCode200ResponseDeserializer castDeserializer) { - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } else { - StatusCode400ResponseDeserializer castDeserializer = (StatusCode400ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - throw new Code400Response.ResponseApiException( - "Received error statusCode response from server", - response, - deserializedResponse - ); - } - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/UserloginGetQueryParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/UserloginGetQueryParameters.java new file mode 100644 index 00000000000..700107d32e1 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/UserloginGetQueryParameters.java @@ -0,0 +1,255 @@ +package org.openapijsonschematools.client.paths.userlogin.get; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.userlogin.get.parameters.parameter0.Schema0; +import org.openapijsonschematools.client.paths.userlogin.get.parameters.parameter1.Schema1; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class UserloginGetQueryParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class UserloginGetadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable UserloginGetadditionalProperties instance = null; + public static UserloginGetadditionalProperties getInstance() { + if (instance == null) { + instance = new UserloginGetadditionalProperties(); + } + return instance; + } + } + + + public static class UserloginGetQueryParametersMap extends FrozenMap<@Nullable Object> { + protected UserloginGetQueryParametersMap(FrozenMap<@Nullable Object> m) { + super(m); + } + public static final Set requiredKeys = Set.of( + "password", + "username" + ); + public static final Set optionalKeys = Set.of(); + public static UserloginGetQueryParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return UserloginGetQueryParameters1.getInstance().validate(arg, configuration); + } + + public String password() { + @Nullable Object value = get("password"); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for password"); + } + return (String) value; + } + + public String username() { + @Nullable Object value = get("username"); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for username"); + } + return (String) value; + } + } + + public interface SetterForUserloginGetpassword { + Map getInstance(); + T getBuilderAfterUserloginGetpassword(Map instance); + + default T password(String value) { + var instance = getInstance(); + instance.put("password", value); + return getBuilderAfterUserloginGetpassword(instance); + } + } + + public interface SetterForUserloginGetusername { + Map getInstance(); + T getBuilderAfterUserloginGetusername(Map instance); + + default T username(String value) { + var instance = getInstance(); + instance.put("username", value); + return getBuilderAfterUserloginGetusername(instance); + } + } + + public static class UserloginGetQueryParametersMap00Builder implements GenericBuilder> { + private final Map instance; + private static final Set knownKeys = Set.of( + "password", + "username" + ); + public Set getKnownKeys() { + return knownKeys; + } + public UserloginGetQueryParametersMap00Builder(Map instance) { + this.instance = instance; + } + public Map build() { + return instance; + } + } + + public static class UserloginGetQueryParametersMap01Builder implements SetterForUserloginGetusername { + private final Map instance; + public UserloginGetQueryParametersMap01Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public UserloginGetQueryParametersMap00Builder getBuilderAfterUserloginGetusername(Map instance) { + return new UserloginGetQueryParametersMap00Builder(instance); + } + } + + public static class UserloginGetQueryParametersMap10Builder implements SetterForUserloginGetpassword { + private final Map instance; + public UserloginGetQueryParametersMap10Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public UserloginGetQueryParametersMap00Builder getBuilderAfterUserloginGetpassword(Map instance) { + return new UserloginGetQueryParametersMap00Builder(instance); + } + } + + public static class UserloginGetQueryParametersMapBuilder implements SetterForUserloginGetpassword, SetterForUserloginGetusername { + private final Map instance; + public UserloginGetQueryParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map getInstance() { + return instance; + } + public UserloginGetQueryParametersMap01Builder getBuilderAfterUserloginGetpassword(Map instance) { + return new UserloginGetQueryParametersMap01Builder(instance); + } + public UserloginGetQueryParametersMap10Builder getBuilderAfterUserloginGetusername(Map instance) { + return new UserloginGetQueryParametersMap10Builder(instance); + } + } + + + public sealed interface UserloginGetQueryParameters1Boxed permits UserloginGetQueryParameters1BoxedMap { + @Nullable Object getData(); + } + + public record UserloginGetQueryParameters1BoxedMap(UserloginGetQueryParametersMap data) implements UserloginGetQueryParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class UserloginGetQueryParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable UserloginGetQueryParameters1 instance = null; + + protected UserloginGetQueryParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("password", Schema1.Schema11.class), + new PropertyEntry("username", Schema0.Schema01.class) + )) + .required(Set.of( + "password", + "username" + )) + .additionalProperties(UserloginGetadditionalProperties.class) + ); + } + + public static UserloginGetQueryParameters1 getInstance() { + if (instance == null) { + instance = new UserloginGetQueryParameters1(); + } + return instance; + } + + public UserloginGetQueryParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + properties.put(propertyName, propertyInstance); + } + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); + return new UserloginGetQueryParametersMap(castProperties); + } + + public UserloginGetQueryParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public UserloginGetQueryParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new UserloginGetQueryParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public UserloginGetQueryParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/UserloginGetResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/UserloginGetResponses.java new file mode 100644 index 00000000000..8e5613c7641 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/UserloginGetResponses.java @@ -0,0 +1,67 @@ +package org.openapijsonschematools.client.paths.userlogin.get; + +import org.openapijsonschematools.client.paths.userlogin.get.responses.UserloginGetCode200Response; +import org.openapijsonschematools.client.paths.userlogin.get.responses.code200response.UserloginGetCode200ResponseHeadersSchema; +import org.openapijsonschematools.client.paths.userlogin.get.responses.UserloginGetCode400Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class UserloginGetResponses { + public sealed interface EndpointResponse permits EndpointUserloginGetCode200Response {} + + public record EndpointUserloginGetCode200Response( + HttpResponse response, + UserloginGetCode200Response.SealedResponseBody body, + UserloginGetCode200ResponseHeadersSchema.UserloginGetCode200ResponseHeadersSchemaMap headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusUserloginGetCode200ResponseDeserializer, StatusUserloginGetCode400ResponseDeserializer {} + + public static final class StatusUserloginGetCode200ResponseDeserializer extends UserloginGetCode200Response.UserloginGetCode200Response1 implements StatusCodeResponseDeserializer { + } + public static final class StatusUserloginGetCode400ResponseDeserializer extends UserloginGetCode400Response.UserloginGetCode400Response1 implements StatusCodeResponseDeserializer { + } + + public static final class UserloginGetResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public UserloginGetResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusUserloginGetCode200ResponseDeserializer()), + new AbstractMap.SimpleEntry<>("400", new StatusUserloginGetCode400ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + if (statusCodeDeserializer instanceof StatusUserloginGetCode200ResponseDeserializer castDeserializer) { + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointUserloginGetCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } else { + StatusUserloginGetCode400ResponseDeserializer castDeserializer = (StatusUserloginGetCode400ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + throw new UserloginGetCode400Response.ResponseApiException( + "Received error statusCode response from server", + response, + deserializedResponse + ); + } + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/Code200Response.java deleted file mode 100644 index 399cc9fd94f..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/Code200Response.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.openapijsonschematools.client.paths.userlogin.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.userlogin.get.responses.code200response.content.applicationxml.ApplicationxmlSchema; -import org.openapijsonschematools.client.paths.userlogin.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; -import org.openapijsonschematools.client.paths.userlogin.get.responses.code200response.Code200ResponseHeadersSchema; -import org.openapijsonschematools.client.paths.userlogin.get.responses.code200response.Headers; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationxmlMediaType, ApplicationjsonMediaType {} - - public record ApplicationxmlMediaType(ApplicationxmlSchema.ApplicationxmlSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationxmlMediaType() { - this(ApplicationxmlSchema.ApplicationxmlSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationxmlResponseBody, ApplicationjsonResponseBody {} - public record ApplicationxmlResponseBody(ApplicationxmlSchema.StringJsonSchema1Boxed body) implements SealedResponseBody { } - public record ApplicationjsonResponseBody(ApplicationjsonSchema.StringJsonSchema1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/xml", new ApplicationxmlMediaType()), - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - if (mediaType instanceof ApplicationxmlMediaType thisMediaType) { - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationxmlResponseBody(deserializedBody); - } else { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - } - - @Override - protected Code200ResponseHeadersSchema.Code200ResponseHeadersSchemaMap getHeaders(HttpHeaders headers, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - return new Headers().deserialize(headers, configuration); - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/Code400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/Code400Response.java deleted file mode 100644 index a30d61bec1a..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/Code400Response.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapijsonschematools.client.paths.userlogin.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; - -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code400Response { - - public static class Code400Response1 extends ResponseDeserializer { - public Code400Response1() { - super( - MapUtils.makeMap( - ) - ); - } - - @Override - protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { - return null; - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/UserloginGetCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/UserloginGetCode200Response.java new file mode 100644 index 00000000000..07992812d1e --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/UserloginGetCode200Response.java @@ -0,0 +1,83 @@ +package org.openapijsonschematools.client.paths.userlogin.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.userlogin.get.responses.code200response.content.applicationxml.ApplicationxmlSchema; +import org.openapijsonschematools.client.paths.userlogin.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; +import org.openapijsonschematools.client.paths.userlogin.get.responses.code200response.UserloginGetCode200ResponseHeadersSchema; +import org.openapijsonschematools.client.paths.userlogin.get.responses.code200response.Headers; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class UserloginGetCode200Response { + public sealed interface SealedMediaType permits ApplicationxmlMediaType, ApplicationjsonMediaType {} + + public record ApplicationxmlMediaType(ApplicationxmlSchema.ApplicationxmlSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationxmlMediaType() { + this(ApplicationxmlSchema.ApplicationxmlSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationxmlResponseBody, ApplicationjsonResponseBody {} + public record ApplicationxmlResponseBody(ApplicationxmlSchema.StringJsonSchema1Boxed body) implements SealedResponseBody { } + public record ApplicationjsonResponseBody(ApplicationjsonSchema.StringJsonSchema1Boxed body) implements SealedResponseBody { } + + public static class UserloginGetCode200Response1 extends ResponseDeserializer { + public UserloginGetCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/xml", new ApplicationxmlMediaType()), + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + if (mediaType instanceof ApplicationxmlMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationxmlResponseBody(deserializedBody); + } else { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + } + + @Override + protected UserloginGetCode200ResponseHeadersSchema.UserloginGetCode200ResponseHeadersSchemaMap getHeaders(HttpHeaders headers, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + return new Headers().deserialize(headers, configuration); + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/UserloginGetCode400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/UserloginGetCode400Response.java new file mode 100644 index 00000000000..a9e9d3cb6b0 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/UserloginGetCode400Response.java @@ -0,0 +1,45 @@ +package org.openapijsonschematools.client.paths.userlogin.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class UserloginGetCode400Response { + + public static class UserloginGetCode400Response1 extends ResponseDeserializer { + public UserloginGetCode400Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/Code200ResponseHeadersSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/Code200ResponseHeadersSchema.java deleted file mode 100644 index 26bd7f377fc..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/Code200ResponseHeadersSchema.java +++ /dev/null @@ -1,389 +0,0 @@ -package org.openapijsonschematools.client.paths.userlogin.get.responses.code200response; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.components.headers.int32jsoncontenttypeheader.content.applicationjson.Int32JsonContentTypeHeaderSchema; -import org.openapijsonschematools.client.components.headers.numberheader.NumberHeaderSchema; -import org.openapijsonschematools.client.components.schemas.StringWithValidation; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.paths.userlogin.get.responses.code200response.headers.xexpiresafter.XExpiresAfterSchema; -import org.openapijsonschematools.client.paths.userlogin.get.responses.code200response.headers.xratelimit.content.applicationjson.XRateLimitSchema; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class Code200ResponseHeadersSchema { - // nest classes so all schemas and input/output classes can be public - - - public static class Code200ResponseAdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable Code200ResponseAdditionalProperties instance = null; - public static Code200ResponseAdditionalProperties getInstance() { - if (instance == null) { - instance = new Code200ResponseAdditionalProperties(); - } - return instance; - } - } - - - public static class Code200ResponseHeadersSchemaMap extends FrozenMap<@Nullable Object> { - protected Code200ResponseHeadersSchemaMap(FrozenMap<@Nullable Object> m) { - super(m); - } - public static final Set requiredKeys = Set.of( - "X-Rate-Limit", - "int32", - "ref-content-schema-header" - ); - public static final Set optionalKeys = Set.of( - "X-Expires-After", - "numberHeader" - ); - public static Code200ResponseHeadersSchemaMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return Code200ResponseHeadersSchema1.getInstance().validate(arg, configuration); - } - - public Number int32() { - @Nullable Object value = get("int32"); - if (!(value instanceof Number)) { - throw new RuntimeException("Invalid value stored for int32"); - } - return (Number) value; - } - - public String numberHeader() throws UnsetPropertyException { - String key = "numberHeader"; - throwIfKeyNotPresent(key); - @Nullable Object value = get(key); - if (!(value instanceof String)) { - throw new RuntimeException("Invalid value stored for numberHeader"); - } - return (String) value; - } - } - - public interface SetterForCode200ResponseXRateLimit { - Map getInstance(); - T getBuilderAfterCode200ResponseXRateLimit(Map instance); - - default T xHyphenMinusRateHyphenMinusLimit(int value) { - var instance = getInstance(); - instance.put("X-Rate-Limit", value); - return getBuilderAfterCode200ResponseXRateLimit(instance); - } - - default T xHyphenMinusRateHyphenMinusLimit(float value) { - var instance = getInstance(); - instance.put("X-Rate-Limit", value); - return getBuilderAfterCode200ResponseXRateLimit(instance); - } - } - - public interface SetterForCode200ResponseInt32 { - Map getInstance(); - T getBuilderAfterCode200ResponseInt32(Map instance); - - default T int32(int value) { - var instance = getInstance(); - instance.put("int32", value); - return getBuilderAfterCode200ResponseInt32(instance); - } - - default T int32(float value) { - var instance = getInstance(); - instance.put("int32", value); - return getBuilderAfterCode200ResponseInt32(instance); - } - } - - public interface SetterForCode200ResponseRefcontentschemaheader { - Map getInstance(); - T getBuilderAfterCode200ResponseRefcontentschemaheader(Map instance); - - default T refHyphenMinusContentHyphenMinusSchemaHyphenMinusHeader(String value) { - var instance = getInstance(); - instance.put("ref-content-schema-header", value); - return getBuilderAfterCode200ResponseRefcontentschemaheader(instance); - } - } - - public interface SetterForCode200ResponseXExpiresAfter { - Map getInstance(); - T getBuilderAfterCode200ResponseXExpiresAfter(Map instance); - - default T xHyphenMinusExpiresHyphenMinusAfter(String value) { - var instance = getInstance(); - instance.put("X-Expires-After", value); - return getBuilderAfterCode200ResponseXExpiresAfter(instance); - } - } - - public interface SetterForCode200ResponseNumberHeader { - Map getInstance(); - T getBuilderAfterCode200ResponseNumberHeader(Map instance); - - default T numberHeader(String value) { - var instance = getInstance(); - instance.put("numberHeader", value); - return getBuilderAfterCode200ResponseNumberHeader(instance); - } - } - - public static class Code200ResponseHeadersSchemaMap000Builder implements GenericBuilder>, SetterForCode200ResponseXExpiresAfter, SetterForCode200ResponseNumberHeader { - private final Map instance; - private static final Set knownKeys = Set.of( - "X-Rate-Limit", - "int32", - "ref-content-schema-header", - "X-Expires-After", - "numberHeader" - ); - public Set getKnownKeys() { - return knownKeys; - } - public Code200ResponseHeadersSchemaMap000Builder(Map instance) { - this.instance = instance; - } - public Map build() { - return instance; - } - public Map getInstance() { - return instance; - } - public Code200ResponseHeadersSchemaMap000Builder getBuilderAfterCode200ResponseXExpiresAfter(Map instance) { - return this; - } - public Code200ResponseHeadersSchemaMap000Builder getBuilderAfterCode200ResponseNumberHeader(Map instance) { - return this; - } - } - - public static class Code200ResponseHeadersSchemaMap001Builder implements SetterForCode200ResponseRefcontentschemaheader { - private final Map instance; - public Code200ResponseHeadersSchemaMap001Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public Code200ResponseHeadersSchemaMap000Builder getBuilderAfterCode200ResponseRefcontentschemaheader(Map instance) { - return new Code200ResponseHeadersSchemaMap000Builder(instance); - } - } - - public static class Code200ResponseHeadersSchemaMap010Builder implements SetterForCode200ResponseInt32 { - private final Map instance; - public Code200ResponseHeadersSchemaMap010Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public Code200ResponseHeadersSchemaMap000Builder getBuilderAfterCode200ResponseInt32(Map instance) { - return new Code200ResponseHeadersSchemaMap000Builder(instance); - } - } - - public static class Code200ResponseHeadersSchemaMap011Builder implements SetterForCode200ResponseInt32, SetterForCode200ResponseRefcontentschemaheader { - private final Map instance; - public Code200ResponseHeadersSchemaMap011Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public Code200ResponseHeadersSchemaMap001Builder getBuilderAfterCode200ResponseInt32(Map instance) { - return new Code200ResponseHeadersSchemaMap001Builder(instance); - } - public Code200ResponseHeadersSchemaMap010Builder getBuilderAfterCode200ResponseRefcontentschemaheader(Map instance) { - return new Code200ResponseHeadersSchemaMap010Builder(instance); - } - } - - public static class Code200ResponseHeadersSchemaMap100Builder implements SetterForCode200ResponseXRateLimit { - private final Map instance; - public Code200ResponseHeadersSchemaMap100Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public Code200ResponseHeadersSchemaMap000Builder getBuilderAfterCode200ResponseXRateLimit(Map instance) { - return new Code200ResponseHeadersSchemaMap000Builder(instance); - } - } - - public static class Code200ResponseHeadersSchemaMap101Builder implements SetterForCode200ResponseXRateLimit, SetterForCode200ResponseRefcontentschemaheader { - private final Map instance; - public Code200ResponseHeadersSchemaMap101Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public Code200ResponseHeadersSchemaMap001Builder getBuilderAfterCode200ResponseXRateLimit(Map instance) { - return new Code200ResponseHeadersSchemaMap001Builder(instance); - } - public Code200ResponseHeadersSchemaMap100Builder getBuilderAfterCode200ResponseRefcontentschemaheader(Map instance) { - return new Code200ResponseHeadersSchemaMap100Builder(instance); - } - } - - public static class Code200ResponseHeadersSchemaMap110Builder implements SetterForCode200ResponseXRateLimit, SetterForCode200ResponseInt32 { - private final Map instance; - public Code200ResponseHeadersSchemaMap110Builder(Map instance) { - this.instance = instance; - } - public Map getInstance() { - return instance; - } - public Code200ResponseHeadersSchemaMap010Builder getBuilderAfterCode200ResponseXRateLimit(Map instance) { - return new Code200ResponseHeadersSchemaMap010Builder(instance); - } - public Code200ResponseHeadersSchemaMap100Builder getBuilderAfterCode200ResponseInt32(Map instance) { - return new Code200ResponseHeadersSchemaMap100Builder(instance); - } - } - - public static class Code200ResponseHeadersSchemaMapBuilder implements SetterForCode200ResponseXRateLimit, SetterForCode200ResponseInt32, SetterForCode200ResponseRefcontentschemaheader { - private final Map instance; - public Code200ResponseHeadersSchemaMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map getInstance() { - return instance; - } - public Code200ResponseHeadersSchemaMap011Builder getBuilderAfterCode200ResponseXRateLimit(Map instance) { - return new Code200ResponseHeadersSchemaMap011Builder(instance); - } - public Code200ResponseHeadersSchemaMap101Builder getBuilderAfterCode200ResponseInt32(Map instance) { - return new Code200ResponseHeadersSchemaMap101Builder(instance); - } - public Code200ResponseHeadersSchemaMap110Builder getBuilderAfterCode200ResponseRefcontentschemaheader(Map instance) { - return new Code200ResponseHeadersSchemaMap110Builder(instance); - } - } - - - public sealed interface Code200ResponseHeadersSchema1Boxed permits Code200ResponseHeadersSchema1BoxedMap { - @Nullable Object getData(); - } - - public record Code200ResponseHeadersSchema1BoxedMap(Code200ResponseHeadersSchemaMap data) implements Code200ResponseHeadersSchema1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class Code200ResponseHeadersSchema1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable Code200ResponseHeadersSchema1 instance = null; - - protected Code200ResponseHeadersSchema1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("X-Rate-Limit", XRateLimitSchema.XRateLimitSchema1.class), - new PropertyEntry("int32", Int32JsonContentTypeHeaderSchema.Int32JsonContentTypeHeaderSchema1.class), - new PropertyEntry("X-Expires-After", XExpiresAfterSchema.XExpiresAfterSchema1.class), - new PropertyEntry("ref-content-schema-header", StringWithValidation.StringWithValidation1.class), - new PropertyEntry("numberHeader", NumberHeaderSchema.NumberHeaderSchema1.class) - )) - .required(Set.of( - "X-Rate-Limit", - "int32", - "ref-content-schema-header" - )) - .additionalProperties(Code200ResponseAdditionalProperties.class) - ); - } - - public static Code200ResponseHeadersSchema1 getInstance() { - if (instance == null) { - instance = new Code200ResponseHeadersSchema1(); - } - return instance; - } - - public Code200ResponseHeadersSchemaMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - properties.put(propertyName, propertyInstance); - } - FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); - return new Code200ResponseHeadersSchemaMap(castProperties); - } - - public Code200ResponseHeadersSchemaMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public Code200ResponseHeadersSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new Code200ResponseHeadersSchema1BoxedMap(validate(arg, configuration)); - } - @Override - public Code200ResponseHeadersSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/Headers.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/Headers.java index 7c88b23b59b..5c6b5922c54 100644 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/Headers.java +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/Headers.java @@ -10,7 +10,7 @@ import java.util.Map; import java.util.AbstractMap; -public class Headers extends HeadersDeserializer { +public class Headers extends HeadersDeserializer { public Headers() { super( Map.ofEntries( @@ -20,7 +20,7 @@ public Headers() { new AbstractMap.SimpleEntry<>("ref-content-schema-header", new Refcontentschemaheader.Refcontentschemaheader1()), new AbstractMap.SimpleEntry<>("numberHeader", new NumberHeader.NumberHeader1()) ), - Code200ResponseHeadersSchema.Code200ResponseHeadersSchema1.getInstance() + UserloginGetCode200ResponseHeadersSchema.UserloginGetCode200ResponseHeadersSchema1.getInstance() ); } } \ No newline at end of file diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/UserloginGetCode200ResponseHeadersSchema.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/UserloginGetCode200ResponseHeadersSchema.java new file mode 100644 index 00000000000..49828653caa --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogin/get/responses/code200response/UserloginGetCode200ResponseHeadersSchema.java @@ -0,0 +1,389 @@ +package org.openapijsonschematools.client.paths.userlogin.get.responses.code200response; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.components.headers.int32jsoncontenttypeheader.content.applicationjson.Int32JsonContentTypeHeaderSchema; +import org.openapijsonschematools.client.components.headers.numberheader.NumberHeaderSchema; +import org.openapijsonschematools.client.components.schemas.StringWithValidation; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.paths.userlogin.get.responses.code200response.headers.xexpiresafter.XExpiresAfterSchema; +import org.openapijsonschematools.client.paths.userlogin.get.responses.code200response.headers.xratelimit.content.applicationjson.XRateLimitSchema; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class UserloginGetCode200ResponseHeadersSchema { + // nest classes so all schemas and input/output classes can be public + + + public static class UserloginGetCode200ResponseAdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable UserloginGetCode200ResponseAdditionalProperties instance = null; + public static UserloginGetCode200ResponseAdditionalProperties getInstance() { + if (instance == null) { + instance = new UserloginGetCode200ResponseAdditionalProperties(); + } + return instance; + } + } + + + public static class UserloginGetCode200ResponseHeadersSchemaMap extends FrozenMap<@Nullable Object> { + protected UserloginGetCode200ResponseHeadersSchemaMap(FrozenMap<@Nullable Object> m) { + super(m); + } + public static final Set requiredKeys = Set.of( + "X-Rate-Limit", + "int32", + "ref-content-schema-header" + ); + public static final Set optionalKeys = Set.of( + "X-Expires-After", + "numberHeader" + ); + public static UserloginGetCode200ResponseHeadersSchemaMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return UserloginGetCode200ResponseHeadersSchema1.getInstance().validate(arg, configuration); + } + + public Number int32() { + @Nullable Object value = get("int32"); + if (!(value instanceof Number)) { + throw new RuntimeException("Invalid value stored for int32"); + } + return (Number) value; + } + + public String numberHeader() throws UnsetPropertyException { + String key = "numberHeader"; + throwIfKeyNotPresent(key); + @Nullable Object value = get(key); + if (!(value instanceof String)) { + throw new RuntimeException("Invalid value stored for numberHeader"); + } + return (String) value; + } + } + + public interface SetterForUserloginGetCode200ResponseXRateLimit { + Map getInstance(); + T getBuilderAfterUserloginGetCode200ResponseXRateLimit(Map instance); + + default T xHyphenMinusRateHyphenMinusLimit(int value) { + var instance = getInstance(); + instance.put("X-Rate-Limit", value); + return getBuilderAfterUserloginGetCode200ResponseXRateLimit(instance); + } + + default T xHyphenMinusRateHyphenMinusLimit(float value) { + var instance = getInstance(); + instance.put("X-Rate-Limit", value); + return getBuilderAfterUserloginGetCode200ResponseXRateLimit(instance); + } + } + + public interface SetterForUserloginGetCode200ResponseInt32 { + Map getInstance(); + T getBuilderAfterUserloginGetCode200ResponseInt32(Map instance); + + default T int32(int value) { + var instance = getInstance(); + instance.put("int32", value); + return getBuilderAfterUserloginGetCode200ResponseInt32(instance); + } + + default T int32(float value) { + var instance = getInstance(); + instance.put("int32", value); + return getBuilderAfterUserloginGetCode200ResponseInt32(instance); + } + } + + public interface SetterForUserloginGetCode200ResponseRefcontentschemaheader { + Map getInstance(); + T getBuilderAfterUserloginGetCode200ResponseRefcontentschemaheader(Map instance); + + default T refHyphenMinusContentHyphenMinusSchemaHyphenMinusHeader(String value) { + var instance = getInstance(); + instance.put("ref-content-schema-header", value); + return getBuilderAfterUserloginGetCode200ResponseRefcontentschemaheader(instance); + } + } + + public interface SetterForUserloginGetCode200ResponseXExpiresAfter { + Map getInstance(); + T getBuilderAfterUserloginGetCode200ResponseXExpiresAfter(Map instance); + + default T xHyphenMinusExpiresHyphenMinusAfter(String value) { + var instance = getInstance(); + instance.put("X-Expires-After", value); + return getBuilderAfterUserloginGetCode200ResponseXExpiresAfter(instance); + } + } + + public interface SetterForUserloginGetCode200ResponseNumberHeader { + Map getInstance(); + T getBuilderAfterUserloginGetCode200ResponseNumberHeader(Map instance); + + default T numberHeader(String value) { + var instance = getInstance(); + instance.put("numberHeader", value); + return getBuilderAfterUserloginGetCode200ResponseNumberHeader(instance); + } + } + + public static class UserloginGetCode200ResponseHeadersSchemaMap000Builder implements GenericBuilder>, SetterForUserloginGetCode200ResponseXExpiresAfter, SetterForUserloginGetCode200ResponseNumberHeader { + private final Map instance; + private static final Set knownKeys = Set.of( + "X-Rate-Limit", + "int32", + "ref-content-schema-header", + "X-Expires-After", + "numberHeader" + ); + public Set getKnownKeys() { + return knownKeys; + } + public UserloginGetCode200ResponseHeadersSchemaMap000Builder(Map instance) { + this.instance = instance; + } + public Map build() { + return instance; + } + public Map getInstance() { + return instance; + } + public UserloginGetCode200ResponseHeadersSchemaMap000Builder getBuilderAfterUserloginGetCode200ResponseXExpiresAfter(Map instance) { + return this; + } + public UserloginGetCode200ResponseHeadersSchemaMap000Builder getBuilderAfterUserloginGetCode200ResponseNumberHeader(Map instance) { + return this; + } + } + + public static class UserloginGetCode200ResponseHeadersSchemaMap001Builder implements SetterForUserloginGetCode200ResponseRefcontentschemaheader { + private final Map instance; + public UserloginGetCode200ResponseHeadersSchemaMap001Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public UserloginGetCode200ResponseHeadersSchemaMap000Builder getBuilderAfterUserloginGetCode200ResponseRefcontentschemaheader(Map instance) { + return new UserloginGetCode200ResponseHeadersSchemaMap000Builder(instance); + } + } + + public static class UserloginGetCode200ResponseHeadersSchemaMap010Builder implements SetterForUserloginGetCode200ResponseInt32 { + private final Map instance; + public UserloginGetCode200ResponseHeadersSchemaMap010Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public UserloginGetCode200ResponseHeadersSchemaMap000Builder getBuilderAfterUserloginGetCode200ResponseInt32(Map instance) { + return new UserloginGetCode200ResponseHeadersSchemaMap000Builder(instance); + } + } + + public static class UserloginGetCode200ResponseHeadersSchemaMap011Builder implements SetterForUserloginGetCode200ResponseInt32, SetterForUserloginGetCode200ResponseRefcontentschemaheader { + private final Map instance; + public UserloginGetCode200ResponseHeadersSchemaMap011Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public UserloginGetCode200ResponseHeadersSchemaMap001Builder getBuilderAfterUserloginGetCode200ResponseInt32(Map instance) { + return new UserloginGetCode200ResponseHeadersSchemaMap001Builder(instance); + } + public UserloginGetCode200ResponseHeadersSchemaMap010Builder getBuilderAfterUserloginGetCode200ResponseRefcontentschemaheader(Map instance) { + return new UserloginGetCode200ResponseHeadersSchemaMap010Builder(instance); + } + } + + public static class UserloginGetCode200ResponseHeadersSchemaMap100Builder implements SetterForUserloginGetCode200ResponseXRateLimit { + private final Map instance; + public UserloginGetCode200ResponseHeadersSchemaMap100Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public UserloginGetCode200ResponseHeadersSchemaMap000Builder getBuilderAfterUserloginGetCode200ResponseXRateLimit(Map instance) { + return new UserloginGetCode200ResponseHeadersSchemaMap000Builder(instance); + } + } + + public static class UserloginGetCode200ResponseHeadersSchemaMap101Builder implements SetterForUserloginGetCode200ResponseXRateLimit, SetterForUserloginGetCode200ResponseRefcontentschemaheader { + private final Map instance; + public UserloginGetCode200ResponseHeadersSchemaMap101Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public UserloginGetCode200ResponseHeadersSchemaMap001Builder getBuilderAfterUserloginGetCode200ResponseXRateLimit(Map instance) { + return new UserloginGetCode200ResponseHeadersSchemaMap001Builder(instance); + } + public UserloginGetCode200ResponseHeadersSchemaMap100Builder getBuilderAfterUserloginGetCode200ResponseRefcontentschemaheader(Map instance) { + return new UserloginGetCode200ResponseHeadersSchemaMap100Builder(instance); + } + } + + public static class UserloginGetCode200ResponseHeadersSchemaMap110Builder implements SetterForUserloginGetCode200ResponseXRateLimit, SetterForUserloginGetCode200ResponseInt32 { + private final Map instance; + public UserloginGetCode200ResponseHeadersSchemaMap110Builder(Map instance) { + this.instance = instance; + } + public Map getInstance() { + return instance; + } + public UserloginGetCode200ResponseHeadersSchemaMap010Builder getBuilderAfterUserloginGetCode200ResponseXRateLimit(Map instance) { + return new UserloginGetCode200ResponseHeadersSchemaMap010Builder(instance); + } + public UserloginGetCode200ResponseHeadersSchemaMap100Builder getBuilderAfterUserloginGetCode200ResponseInt32(Map instance) { + return new UserloginGetCode200ResponseHeadersSchemaMap100Builder(instance); + } + } + + public static class UserloginGetCode200ResponseHeadersSchemaMapBuilder implements SetterForUserloginGetCode200ResponseXRateLimit, SetterForUserloginGetCode200ResponseInt32, SetterForUserloginGetCode200ResponseRefcontentschemaheader { + private final Map instance; + public UserloginGetCode200ResponseHeadersSchemaMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map getInstance() { + return instance; + } + public UserloginGetCode200ResponseHeadersSchemaMap011Builder getBuilderAfterUserloginGetCode200ResponseXRateLimit(Map instance) { + return new UserloginGetCode200ResponseHeadersSchemaMap011Builder(instance); + } + public UserloginGetCode200ResponseHeadersSchemaMap101Builder getBuilderAfterUserloginGetCode200ResponseInt32(Map instance) { + return new UserloginGetCode200ResponseHeadersSchemaMap101Builder(instance); + } + public UserloginGetCode200ResponseHeadersSchemaMap110Builder getBuilderAfterUserloginGetCode200ResponseRefcontentschemaheader(Map instance) { + return new UserloginGetCode200ResponseHeadersSchemaMap110Builder(instance); + } + } + + + public sealed interface UserloginGetCode200ResponseHeadersSchema1Boxed permits UserloginGetCode200ResponseHeadersSchema1BoxedMap { + @Nullable Object getData(); + } + + public record UserloginGetCode200ResponseHeadersSchema1BoxedMap(UserloginGetCode200ResponseHeadersSchemaMap data) implements UserloginGetCode200ResponseHeadersSchema1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class UserloginGetCode200ResponseHeadersSchema1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable UserloginGetCode200ResponseHeadersSchema1 instance = null; + + protected UserloginGetCode200ResponseHeadersSchema1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("X-Rate-Limit", XRateLimitSchema.XRateLimitSchema1.class), + new PropertyEntry("int32", Int32JsonContentTypeHeaderSchema.Int32JsonContentTypeHeaderSchema1.class), + new PropertyEntry("X-Expires-After", XExpiresAfterSchema.XExpiresAfterSchema1.class), + new PropertyEntry("ref-content-schema-header", StringWithValidation.StringWithValidation1.class), + new PropertyEntry("numberHeader", NumberHeaderSchema.NumberHeaderSchema1.class) + )) + .required(Set.of( + "X-Rate-Limit", + "int32", + "ref-content-schema-header" + )) + .additionalProperties(UserloginGetCode200ResponseAdditionalProperties.class) + ); + } + + public static UserloginGetCode200ResponseHeadersSchema1 getInstance() { + if (instance == null) { + instance = new UserloginGetCode200ResponseHeadersSchema1(); + } + return instance; + } + + public UserloginGetCode200ResponseHeadersSchemaMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + properties.put(propertyName, propertyInstance); + } + FrozenMap<@Nullable Object> castProperties = new FrozenMap<>(properties); + return new UserloginGetCode200ResponseHeadersSchemaMap(castProperties); + } + + public UserloginGetCode200ResponseHeadersSchemaMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public UserloginGetCode200ResponseHeadersSchema1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new UserloginGetCode200ResponseHeadersSchema1BoxedMap(validate(arg, configuration)); + } + @Override + public UserloginGetCode200ResponseHeadersSchema1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogout/Get.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogout/Get.java deleted file mode 100644 index efc687945ab..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogout/Get.java +++ /dev/null @@ -1,115 +0,0 @@ -package org.openapijsonschematools.client.paths.userlogout; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.userlogout.get.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.paths.Userlogout; - -import java.io.IOException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Get { - private static class GetProvider { - private static final String method = "get"; - - public static Responses.EndpointResponse get( - GetRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + Userlogout.path; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface GetOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Get1 extends ApiClient implements GetOperation { - public Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class GetRequest { - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - GetRequest getInstance(); - T getBuilderAfterServerIndex(GetRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - GetRequest getInstance(); - T getBuilderAfterTimeout(GetRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public static class GetRequestBuilder implements SetterForServerIndex, SetterForTimeout { - private final GetRequest instance; - - public GetRequestBuilder() { - this.instance = new GetRequest(); - } - - public GetRequest build() { - return instance; - } - - public GetRequest getInstance() { - return instance; - } - - public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { - return this; - } - - public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { - return this; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogout/UserlogoutGet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogout/UserlogoutGet.java new file mode 100644 index 00000000000..b55850dcc33 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogout/UserlogoutGet.java @@ -0,0 +1,124 @@ +package org.openapijsonschematools.client.paths.userlogout; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.userlogout.get.UserlogoutGetResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.paths.Userlogout; + +import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class UserlogoutGet { + private static class GetProvider { + private static final String method = "get"; + + public static UserlogoutGetResponses.EndpointResponse get( + GetRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + Userlogout.path; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new UserlogoutGetResponses.UserlogoutGetResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface GetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default UserlogoutGetResponses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface LogoutUserOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default UserlogoutGetResponses.EndpointResponse logoutUser(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Get extends ApiClient implements GetOperation { + public Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class GetRequest { + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + GetRequest getInstance(); + T getBuilderAfterServerIndex(GetRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + GetRequest getInstance(); + T getBuilderAfterTimeout(GetRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public static class GetRequestBuilder implements SetterForServerIndex, SetterForTimeout { + private final GetRequest instance; + + public GetRequestBuilder() { + this.instance = new GetRequest(); + } + + public GetRequest build() { + return instance; + } + + public GetRequest getInstance() { + return instance; + } + + public GetRequestBuilder getBuilderAfterServerIndex(GetRequest instance) { + return this; + } + + public GetRequestBuilder getBuilderAfterTimeout(GetRequest instance) { + return this; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogout/get/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogout/get/Responses.java deleted file mode 100644 index 0093801140c..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogout/get/Responses.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.openapijsonschematools.client.paths.userlogout.get; - -import org.openapijsonschematools.client.paths.userlogout.get.responses.CodedefaultResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCodedefaultResponse {} - - public record EndpointCodedefaultResponse( - HttpResponse response, - Void body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public static final class Responses1 implements ResponsesDeserializer { - private final CodedefaultResponse.CodedefaultResponse1 defaultResponseDeserializer; - public Responses1() { - this.defaultResponseDeserializer = new CodedefaultResponse.CodedefaultResponse1(); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - var deserializedResponse = defaultResponseDeserializer.deserialize(response, configuration); - return new EndpointCodedefaultResponse(response, deserializedResponse.body(), deserializedResponse.headers()); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogout/get/UserlogoutGetResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogout/get/UserlogoutGetResponses.java new file mode 100644 index 00000000000..e122fdd65e0 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogout/get/UserlogoutGetResponses.java @@ -0,0 +1,37 @@ +package org.openapijsonschematools.client.paths.userlogout.get; + +import org.openapijsonschematools.client.paths.userlogout.get.responses.UserlogoutGetCodedefaultResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class UserlogoutGetResponses { + public sealed interface EndpointResponse permits EndpointUserlogoutGetCodedefaultResponse {} + + public record EndpointUserlogoutGetCodedefaultResponse( + HttpResponse response, + Void body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public static final class UserlogoutGetResponses1 implements ResponsesDeserializer { + private final UserlogoutGetCodedefaultResponse.UserlogoutGetCodedefaultResponse1 defaultResponseDeserializer; + public UserlogoutGetResponses1() { + this.defaultResponseDeserializer = new UserlogoutGetCodedefaultResponse.UserlogoutGetCodedefaultResponse1(); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + var deserializedResponse = defaultResponseDeserializer.deserialize(response, configuration); + return new EndpointUserlogoutGetCodedefaultResponse(response, deserializedResponse.body(), deserializedResponse.headers()); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogout/get/responses/CodedefaultResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogout/get/responses/CodedefaultResponse.java deleted file mode 100644 index 827132f3fd6..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogout/get/responses/CodedefaultResponse.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.openapijsonschematools.client.paths.userlogout.get.responses; - -import org.openapijsonschematools.client.components.responses.RefSuccessDescriptionOnly; - -public class CodedefaultResponse extends RefSuccessDescriptionOnly { - public static class CodedefaultResponse1 extends RefSuccessDescriptionOnly1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogout/get/responses/UserlogoutGetCodedefaultResponse.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogout/get/responses/UserlogoutGetCodedefaultResponse.java new file mode 100644 index 00000000000..18fa2331b9a --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userlogout/get/responses/UserlogoutGetCodedefaultResponse.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.userlogout.get.responses; + +import org.openapijsonschematools.client.components.responses.RefSuccessDescriptionOnly; + +public class UserlogoutGetCodedefaultResponse extends RefSuccessDescriptionOnly { + public static class UserlogoutGetCodedefaultResponse1 extends RefSuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/Delete.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/Delete.java deleted file mode 100644 index 223efea0cce..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/Delete.java +++ /dev/null @@ -1,170 +0,0 @@ -package org.openapijsonschematools.client.paths.userusername; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.userusername.delete.PathParameters; -import org.openapijsonschematools.client.paths.userusername.delete.Parameters; -import org.openapijsonschematools.client.paths.userusername.delete.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.paths.Userusername; - -import java.io.IOException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Delete { - private static class DeleteProvider { - private static final String method = "delete"; - - public static Responses.EndpointResponse delete( - DeleteRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - - var pathSerializer = new Parameters.PathParametersSerializer(); - String updatedPath = pathSerializer.serialize(request.pathParameters, Userusername.path); - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + updatedPath; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface DeleteOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse delete(DeleteRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return DeleteProvider.delete(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Delete1 extends ApiClient implements DeleteOperation { - public Delete1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class DeleteRequest { - public PathParameters.PathParametersMap pathParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - - public DeleteRequest( - PathParameters.PathParametersMap pathParameters, - RootServerInfo.@Nullable ServerIndex serverIndex, - @Nullable Duration timeout - ) { - this.pathParameters = pathParameters; - this.serverIndex = serverIndex; - this.timeout = timeout; - } - } - - public static class DeleteNullableRequest { - public PathParameters.@Nullable PathParametersMap pathParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - DeleteNullableRequest getInstance(); - T getBuilderAfterServerIndex(DeleteNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - DeleteNullableRequest getInstance(); - T getBuilderAfterTimeout(DeleteNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForPathParameters { - DeleteNullableRequest getInstance(); - T getBuilderAfterPathParameters(DeleteNullableRequest instance); - default T pathParameters(PathParameters.PathParametersMap pathParameters) { - var instance = getInstance(); - instance.pathParameters = pathParameters; - return getBuilderAfterPathParameters(instance); - } - } - - public static class Delete0RequestBuilder implements SetterForServerIndex, SetterForTimeout { - private final DeleteNullableRequest instance; - - public Delete0RequestBuilder(DeleteNullableRequest instance) { - this.instance = instance; - } - - public DeleteRequest build() { - var pathParameters = instance.pathParameters; - if (pathParameters == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new DeleteRequest( - pathParameters, - instance.serverIndex, - instance.timeout - ); - } - - public DeleteNullableRequest getInstance() { - return instance; - } - - public Delete0RequestBuilder getBuilderAfterServerIndex(DeleteNullableRequest instance) { - return this; - } - - public Delete0RequestBuilder getBuilderAfterTimeout(DeleteNullableRequest instance) { - return this; - } - } - public static class DeleteRequestBuilder implements SetterForPathParameters { - private final DeleteNullableRequest instance; - - public DeleteRequestBuilder() { - this.instance = new DeleteNullableRequest(); - } - - public DeleteNullableRequest getInstance() { - return instance; - } - - public Delete0RequestBuilder getBuilderAfterPathParameters(DeleteNullableRequest instance) { - return new Delete0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/Get.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/Get.java deleted file mode 100644 index 503ec431719..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/Get.java +++ /dev/null @@ -1,170 +0,0 @@ -package org.openapijsonschematools.client.paths.userusername; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.userusername.get.PathParameters; -import org.openapijsonschematools.client.paths.userusername.get.Parameters; -import org.openapijsonschematools.client.paths.userusername.get.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.paths.Userusername; - -import java.io.IOException; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Get { - private static class GetProvider { - private static final String method = "get"; - - public static Responses.EndpointResponse get( - GetRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); - - var pathSerializer = new Parameters.PathParametersSerializer(); - String updatedPath = pathSerializer.serialize(request.pathParameters, Userusername.path); - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + updatedPath; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface GetOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Responses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Get1 extends ApiClient implements GetOperation { - public Get1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class GetRequest { - public PathParameters.PathParametersMap pathParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - - public GetRequest( - PathParameters.PathParametersMap pathParameters, - RootServerInfo.@Nullable ServerIndex serverIndex, - @Nullable Duration timeout - ) { - this.pathParameters = pathParameters; - this.serverIndex = serverIndex; - this.timeout = timeout; - } - } - - public static class GetNullableRequest { - public PathParameters.@Nullable PathParametersMap pathParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - GetNullableRequest getInstance(); - T getBuilderAfterServerIndex(GetNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - GetNullableRequest getInstance(); - T getBuilderAfterTimeout(GetNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForPathParameters { - GetNullableRequest getInstance(); - T getBuilderAfterPathParameters(GetNullableRequest instance); - default T pathParameters(PathParameters.PathParametersMap pathParameters) { - var instance = getInstance(); - instance.pathParameters = pathParameters; - return getBuilderAfterPathParameters(instance); - } - } - - public static class Get0RequestBuilder implements SetterForServerIndex, SetterForTimeout { - private final GetNullableRequest instance; - - public Get0RequestBuilder(GetNullableRequest instance) { - this.instance = instance; - } - - public GetRequest build() { - var pathParameters = instance.pathParameters; - if (pathParameters == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new GetRequest( - pathParameters, - instance.serverIndex, - instance.timeout - ); - } - - public GetNullableRequest getInstance() { - return instance; - } - - public Get0RequestBuilder getBuilderAfterServerIndex(GetNullableRequest instance) { - return this; - } - - public Get0RequestBuilder getBuilderAfterTimeout(GetNullableRequest instance) { - return this; - } - } - public static class GetRequestBuilder implements SetterForPathParameters { - private final GetNullableRequest instance; - - public GetRequestBuilder() { - this.instance = new GetNullableRequest(); - } - - public GetNullableRequest getInstance() { - return instance; - } - - public Get0RequestBuilder getBuilderAfterPathParameters(GetNullableRequest instance) { - return new Get0RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/Put.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/Put.java deleted file mode 100644 index 748d806d396..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/Put.java +++ /dev/null @@ -1,232 +0,0 @@ -package org.openapijsonschematools.client.paths.userusername; - -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.RootServerInfo; -import org.openapijsonschematools.client.paths.userusername.put.RequestBody; -import org.openapijsonschematools.client.paths.userusername.put.PathParameters; -import org.openapijsonschematools.client.paths.userusername.put.Parameters; -import org.openapijsonschematools.client.paths.userusername.put.Responses; -import org.openapijsonschematools.client.apiclient.ApiClient; -import org.openapijsonschematools.client.configurations.ApiConfiguration; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.restclient.RestClient; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.paths.Userusername; - -import java.io.IOException; -import java.util.ArrayList; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.time.Duration; -import java.util.List; -import java.util.Map; - -public class Put { - private static class PutProvider { - private static final String method = "put"; - - public static Void put( - PutRequest request, - ApiConfiguration apiConfiguration, - SchemaConfiguration schemaConfiguration, - HttpClient client - ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - Map> headers = apiConfiguration.getDefaultHeaders(); - - SerializedRequestBody serializedRequestBody = new RequestBody.RequestBody1().serialize( - request.requestBody - ); - var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); - contentTypeHeaderValues.add(serializedRequestBody.contentType); - HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; - - var pathSerializer = new Parameters.PathParametersSerializer(); - String updatedPath = pathSerializer.serialize(request.pathParameters, Userusername.path); - // TODO set this to a map if there is a query security scheme - @Nullable Map queryMap = null; - String host = apiConfiguration.getServer(request.serverIndex).url(); - - String url = host + updatedPath; - var httpRequest = RestClient.getRequest( - url, - method, - bodyPublisher, - headers, - request.timeout - ); - var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); - return responsesDeserializer.deserialize(response, schemaConfiguration); - } - } - - public interface PutOperation { - ApiConfiguration getApiConfiguration(); - SchemaConfiguration getSchemaConfiguration(); - HttpClient getClient(); - default Void put(PutRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return PutProvider.put(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); - } - } - - public static class Put1 extends ApiClient implements PutOperation { - public Put1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { - super(apiConfiguration, schemaConfiguration); - } - } - - public static class PutRequest { - public RequestBody.SealedRequestBody requestBody; - public PathParameters.PathParametersMap pathParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - - public PutRequest( - RequestBody.SealedRequestBody requestBody, - PathParameters.PathParametersMap pathParameters, - RootServerInfo.@Nullable ServerIndex serverIndex, - @Nullable Duration timeout - ) { - this.requestBody = requestBody; - this.pathParameters = pathParameters; - this.serverIndex = serverIndex; - this.timeout = timeout; - } - } - - public static class PutNullableRequest { - public RequestBody.@Nullable SealedRequestBody requestBody; - public PathParameters.@Nullable PathParametersMap pathParameters; - public RootServerInfo.@Nullable ServerIndex serverIndex; - public @Nullable Duration timeout; - } - - public interface SetterForServerIndex { - PutNullableRequest getInstance(); - T getBuilderAfterServerIndex(PutNullableRequest instance); - default T serverIndex(RootServerInfo.ServerIndex serverIndex) { - var instance = getInstance(); - instance.serverIndex = serverIndex; - return getBuilderAfterServerIndex(instance); - } - } - - public interface SetterForTimeout { - PutNullableRequest getInstance(); - T getBuilderAfterTimeout(PutNullableRequest instance); - default T timeout(Duration timeout) { - var instance = getInstance(); - instance.timeout = timeout; - return getBuilderAfterTimeout(instance); - } - } - - public interface SetterForRequestBody { - PutNullableRequest getInstance(); - T getBuilderAfterRequestBody(PutNullableRequest instance); - default T requestBody(RequestBody.SealedRequestBody requestBody) { - var instance = getInstance(); - instance.requestBody = requestBody; - return getBuilderAfterRequestBody(instance); - } - } - - public interface SetterForPathParameters { - PutNullableRequest getInstance(); - T getBuilderAfterPathParameters(PutNullableRequest instance); - default T pathParameters(PathParameters.PathParametersMap pathParameters) { - var instance = getInstance(); - instance.pathParameters = pathParameters; - return getBuilderAfterPathParameters(instance); - } - } - - public static class Put00RequestBuilder implements SetterForServerIndex, SetterForTimeout { - private final PutNullableRequest instance; - - public Put00RequestBuilder(PutNullableRequest instance) { - this.instance = instance; - } - - public PutRequest build() { - var requestBody = instance.requestBody; - if (requestBody == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - var pathParameters = instance.pathParameters; - if (pathParameters == null) { - throw new RuntimeException("invalid null value for required parameter"); - } - return new PutRequest( - requestBody, - pathParameters, - instance.serverIndex, - instance.timeout - ); - } - - public PutNullableRequest getInstance() { - return instance; - } - - public Put00RequestBuilder getBuilderAfterServerIndex(PutNullableRequest instance) { - return this; - } - - public Put00RequestBuilder getBuilderAfterTimeout(PutNullableRequest instance) { - return this; - } - } - public static class Put01RequestBuilder implements SetterForPathParameters { - private final PutNullableRequest instance; - - public Put01RequestBuilder(PutNullableRequest instance) { - this.instance = instance; - } - - public PutNullableRequest getInstance() { - return instance; - } - - public Put00RequestBuilder getBuilderAfterPathParameters(PutNullableRequest instance) { - return new Put00RequestBuilder(instance); - } - } - public static class Put10RequestBuilder implements SetterForRequestBody { - private final PutNullableRequest instance; - - public Put10RequestBuilder(PutNullableRequest instance) { - this.instance = instance; - } - - public PutNullableRequest getInstance() { - return instance; - } - - public Put00RequestBuilder getBuilderAfterRequestBody(PutNullableRequest instance) { - return new Put00RequestBuilder(instance); - } - } - public static class PutRequestBuilder implements SetterForRequestBody, SetterForPathParameters { - private final PutNullableRequest instance; - - public PutRequestBuilder() { - this.instance = new PutNullableRequest(); - } - - public PutNullableRequest getInstance() { - return instance; - } - - public Put01RequestBuilder getBuilderAfterRequestBody(PutNullableRequest instance) { - return new Put01RequestBuilder(instance); - } - - public Put10RequestBuilder getBuilderAfterPathParameters(PutNullableRequest instance) { - return new Put10RequestBuilder(instance); - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/UserusernameDelete.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/UserusernameDelete.java new file mode 100644 index 00000000000..012abce1c6b --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/UserusernameDelete.java @@ -0,0 +1,179 @@ +package org.openapijsonschematools.client.paths.userusername; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.userusername.delete.UserusernameDeletePathParameters; +import org.openapijsonschematools.client.paths.userusername.delete.Parameters; +import org.openapijsonschematools.client.paths.userusername.delete.UserusernameDeleteResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.paths.Userusername; + +import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class UserusernameDelete { + private static class DeleteProvider { + private static final String method = "delete"; + + public static UserusernameDeleteResponses.EndpointResponse delete( + DeleteRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + + var pathSerializer = new Parameters.PathParametersSerializer(); + String updatedPath = pathSerializer.serialize(request.pathParameters, Userusername.path); + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + updatedPath; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new UserusernameDeleteResponses.UserusernameDeleteResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface DeleteOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default UserusernameDeleteResponses.EndpointResponse delete(DeleteRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return DeleteProvider.delete(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface DeleteUserOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default UserusernameDeleteResponses.EndpointResponse deleteUser(DeleteRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return DeleteProvider.delete(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Delete extends ApiClient implements DeleteOperation { + public Delete(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class DeleteRequest { + public UserusernameDeletePathParameters.UserusernameDeletePathParametersMap pathParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + + public DeleteRequest( + UserusernameDeletePathParameters.UserusernameDeletePathParametersMap pathParameters, + RootServerInfo.@Nullable ServerIndex serverIndex, + @Nullable Duration timeout + ) { + this.pathParameters = pathParameters; + this.serverIndex = serverIndex; + this.timeout = timeout; + } + } + + public static class DeleteNullableRequest { + public UserusernameDeletePathParameters.@Nullable UserusernameDeletePathParametersMap pathParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + DeleteNullableRequest getInstance(); + T getBuilderAfterServerIndex(DeleteNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + DeleteNullableRequest getInstance(); + T getBuilderAfterTimeout(DeleteNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForPathParameters { + DeleteNullableRequest getInstance(); + T getBuilderAfterPathParameters(DeleteNullableRequest instance); + default T pathParameters(UserusernameDeletePathParameters.UserusernameDeletePathParametersMap pathParameters) { + var instance = getInstance(); + instance.pathParameters = pathParameters; + return getBuilderAfterPathParameters(instance); + } + } + + public static class Delete0RequestBuilder implements SetterForServerIndex, SetterForTimeout { + private final DeleteNullableRequest instance; + + public Delete0RequestBuilder(DeleteNullableRequest instance) { + this.instance = instance; + } + + public DeleteRequest build() { + var pathParameters = instance.pathParameters; + if (pathParameters == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new DeleteRequest( + pathParameters, + instance.serverIndex, + instance.timeout + ); + } + + public DeleteNullableRequest getInstance() { + return instance; + } + + public Delete0RequestBuilder getBuilderAfterServerIndex(DeleteNullableRequest instance) { + return this; + } + + public Delete0RequestBuilder getBuilderAfterTimeout(DeleteNullableRequest instance) { + return this; + } + } + public static class DeleteRequestBuilder implements SetterForPathParameters { + private final DeleteNullableRequest instance; + + public DeleteRequestBuilder() { + this.instance = new DeleteNullableRequest(); + } + + public DeleteNullableRequest getInstance() { + return instance; + } + + public Delete0RequestBuilder getBuilderAfterPathParameters(DeleteNullableRequest instance) { + return new Delete0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/UserusernameGet.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/UserusernameGet.java new file mode 100644 index 00000000000..5446f82e397 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/UserusernameGet.java @@ -0,0 +1,179 @@ +package org.openapijsonschematools.client.paths.userusername; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.userusername.get.UserusernameGetPathParameters; +import org.openapijsonschematools.client.paths.userusername.get.Parameters; +import org.openapijsonschematools.client.paths.userusername.get.UserusernameGetResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.paths.Userusername; + +import java.io.IOException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class UserusernameGet { + private static class GetProvider { + private static final String method = "get"; + + public static UserusernameGetResponses.EndpointResponse get( + GetRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.noBody(); + + var pathSerializer = new Parameters.PathParametersSerializer(); + String updatedPath = pathSerializer.serialize(request.pathParameters, Userusername.path); + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + updatedPath; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + var responsesDeserializer = new UserusernameGetResponses.UserusernameGetResponses1(); + return responsesDeserializer.deserialize(response, schemaConfiguration); + } + } + + public interface GetOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default UserusernameGetResponses.EndpointResponse get(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface GetUserByNameOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default UserusernameGetResponses.EndpointResponse getUserByName(GetRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return GetProvider.get(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Get extends ApiClient implements GetOperation { + public Get(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class GetRequest { + public UserusernameGetPathParameters.UserusernameGetPathParametersMap pathParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + + public GetRequest( + UserusernameGetPathParameters.UserusernameGetPathParametersMap pathParameters, + RootServerInfo.@Nullable ServerIndex serverIndex, + @Nullable Duration timeout + ) { + this.pathParameters = pathParameters; + this.serverIndex = serverIndex; + this.timeout = timeout; + } + } + + public static class GetNullableRequest { + public UserusernameGetPathParameters.@Nullable UserusernameGetPathParametersMap pathParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + GetNullableRequest getInstance(); + T getBuilderAfterServerIndex(GetNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + GetNullableRequest getInstance(); + T getBuilderAfterTimeout(GetNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForPathParameters { + GetNullableRequest getInstance(); + T getBuilderAfterPathParameters(GetNullableRequest instance); + default T pathParameters(UserusernameGetPathParameters.UserusernameGetPathParametersMap pathParameters) { + var instance = getInstance(); + instance.pathParameters = pathParameters; + return getBuilderAfterPathParameters(instance); + } + } + + public static class Get0RequestBuilder implements SetterForServerIndex, SetterForTimeout { + private final GetNullableRequest instance; + + public Get0RequestBuilder(GetNullableRequest instance) { + this.instance = instance; + } + + public GetRequest build() { + var pathParameters = instance.pathParameters; + if (pathParameters == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new GetRequest( + pathParameters, + instance.serverIndex, + instance.timeout + ); + } + + public GetNullableRequest getInstance() { + return instance; + } + + public Get0RequestBuilder getBuilderAfterServerIndex(GetNullableRequest instance) { + return this; + } + + public Get0RequestBuilder getBuilderAfterTimeout(GetNullableRequest instance) { + return this; + } + } + public static class GetRequestBuilder implements SetterForPathParameters { + private final GetNullableRequest instance; + + public GetRequestBuilder() { + this.instance = new GetNullableRequest(); + } + + public GetNullableRequest getInstance() { + return instance; + } + + public Get0RequestBuilder getBuilderAfterPathParameters(GetNullableRequest instance) { + return new Get0RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/UserusernamePut.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/UserusernamePut.java new file mode 100644 index 00000000000..6014b6f6d87 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/UserusernamePut.java @@ -0,0 +1,240 @@ +package org.openapijsonschematools.client.paths.userusername; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.RootServerInfo; +import org.openapijsonschematools.client.paths.userusername.put.UserusernamePutRequestBody; +import org.openapijsonschematools.client.paths.userusername.put.UserusernamePutPathParameters; +import org.openapijsonschematools.client.paths.userusername.put.Parameters; +import org.openapijsonschematools.client.paths.userusername.put.UserusernamePutResponses; +import org.openapijsonschematools.client.apiclient.ApiClient; +import org.openapijsonschematools.client.configurations.ApiConfiguration; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.restclient.RestClient; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.paths.Userusername; + +import java.io.IOException; +import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.time.Duration; +import java.util.List; +import java.util.Map; + +public class UserusernamePut { + private static class PutProvider { + private static final String method = "put"; + + public static Void put( + PutRequest request, + ApiConfiguration apiConfiguration, + SchemaConfiguration schemaConfiguration, + HttpClient client + ) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + Map> headers = apiConfiguration.getDefaultHeaders(); + + SerializedRequestBody serializedRequestBody = new UserusernamePutRequestBody.UserusernamePutRequestBody1().serialize( + request.requestBody + ); + var contentTypeHeaderValues = headers.getOrDefault("Content-Type", new ArrayList<>()); + contentTypeHeaderValues.add(serializedRequestBody.contentType); + HttpRequest.BodyPublisher bodyPublisher = serializedRequestBody.bodyPublisher; + + var pathSerializer = new Parameters.PathParametersSerializer(); + String updatedPath = pathSerializer.serialize(request.pathParameters, Userusername.path); + // TODO set this to a map if there is a query security scheme + @Nullable Map queryMap = null; + String host = apiConfiguration.getServer(request.serverIndex).url(); + + String url = host + updatedPath; + var httpRequest = RestClient.getRequest( + url, + method, + bodyPublisher, + headers, + request.timeout + ); + var response = RestClient.getResponse(httpRequest, client); + return (Void) null; + } + } + + public interface PutOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default Void put(PutRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PutProvider.put(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public interface UpdateUserOperation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default Void updateUser(PutRequest request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return PutProvider.put(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + } + } + + public static class Put extends ApiClient implements PutOperation { + public Put(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } + } + + public static class PutRequest { + public UserusernamePutRequestBody.SealedRequestBody requestBody; + public UserusernamePutPathParameters.UserusernamePutPathParametersMap pathParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + + public PutRequest( + UserusernamePutRequestBody.SealedRequestBody requestBody, + UserusernamePutPathParameters.UserusernamePutPathParametersMap pathParameters, + RootServerInfo.@Nullable ServerIndex serverIndex, + @Nullable Duration timeout + ) { + this.requestBody = requestBody; + this.pathParameters = pathParameters; + this.serverIndex = serverIndex; + this.timeout = timeout; + } + } + + public static class PutNullableRequest { + public UserusernamePutRequestBody.@Nullable SealedRequestBody requestBody; + public UserusernamePutPathParameters.@Nullable UserusernamePutPathParametersMap pathParameters; + public RootServerInfo.@Nullable ServerIndex serverIndex; + public @Nullable Duration timeout; + } + + public interface SetterForServerIndex { + PutNullableRequest getInstance(); + T getBuilderAfterServerIndex(PutNullableRequest instance); + default T serverIndex(RootServerInfo.ServerIndex serverIndex) { + var instance = getInstance(); + instance.serverIndex = serverIndex; + return getBuilderAfterServerIndex(instance); + } + } + + public interface SetterForTimeout { + PutNullableRequest getInstance(); + T getBuilderAfterTimeout(PutNullableRequest instance); + default T timeout(Duration timeout) { + var instance = getInstance(); + instance.timeout = timeout; + return getBuilderAfterTimeout(instance); + } + } + + public interface SetterForRequestBody { + PutNullableRequest getInstance(); + T getBuilderAfterRequestBody(PutNullableRequest instance); + default T requestBody(UserusernamePutRequestBody.SealedRequestBody requestBody) { + var instance = getInstance(); + instance.requestBody = requestBody; + return getBuilderAfterRequestBody(instance); + } + } + + public interface SetterForPathParameters { + PutNullableRequest getInstance(); + T getBuilderAfterPathParameters(PutNullableRequest instance); + default T pathParameters(UserusernamePutPathParameters.UserusernamePutPathParametersMap pathParameters) { + var instance = getInstance(); + instance.pathParameters = pathParameters; + return getBuilderAfterPathParameters(instance); + } + } + + public static class Put00RequestBuilder implements SetterForServerIndex, SetterForTimeout { + private final PutNullableRequest instance; + + public Put00RequestBuilder(PutNullableRequest instance) { + this.instance = instance; + } + + public PutRequest build() { + var requestBody = instance.requestBody; + if (requestBody == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + var pathParameters = instance.pathParameters; + if (pathParameters == null) { + throw new RuntimeException("invalid null value for required parameter"); + } + return new PutRequest( + requestBody, + pathParameters, + instance.serverIndex, + instance.timeout + ); + } + + public PutNullableRequest getInstance() { + return instance; + } + + public Put00RequestBuilder getBuilderAfterServerIndex(PutNullableRequest instance) { + return this; + } + + public Put00RequestBuilder getBuilderAfterTimeout(PutNullableRequest instance) { + return this; + } + } + public static class Put01RequestBuilder implements SetterForPathParameters { + private final PutNullableRequest instance; + + public Put01RequestBuilder(PutNullableRequest instance) { + this.instance = instance; + } + + public PutNullableRequest getInstance() { + return instance; + } + + public Put00RequestBuilder getBuilderAfterPathParameters(PutNullableRequest instance) { + return new Put00RequestBuilder(instance); + } + } + public static class Put10RequestBuilder implements SetterForRequestBody { + private final PutNullableRequest instance; + + public Put10RequestBuilder(PutNullableRequest instance) { + this.instance = instance; + } + + public PutNullableRequest getInstance() { + return instance; + } + + public Put00RequestBuilder getBuilderAfterRequestBody(PutNullableRequest instance) { + return new Put00RequestBuilder(instance); + } + } + public static class PutRequestBuilder implements SetterForRequestBody, SetterForPathParameters { + private final PutNullableRequest instance; + + public PutRequestBuilder() { + this.instance = new PutNullableRequest(); + } + + public PutNullableRequest getInstance() { + return instance; + } + + public Put01RequestBuilder getBuilderAfterRequestBody(PutNullableRequest instance) { + return new Put01RequestBuilder(instance); + } + + public Put10RequestBuilder getBuilderAfterPathParameters(PutNullableRequest instance) { + return new Put10RequestBuilder(instance); + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/PathParameters.java deleted file mode 100644 index 654eb1b1513..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/PathParameters.java +++ /dev/null @@ -1,205 +0,0 @@ -package org.openapijsonschematools.client.paths.userusername.delete; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.components.parameters.pathusername.Schema; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class PathParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class PathParametersMap extends FrozenMap { - protected PathParametersMap(FrozenMap m) { - super(m); - } - public static final Set requiredKeys = Set.of( - "username" - ); - public static final Set optionalKeys = Set.of(); - public static PathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return PathParameters1.getInstance().validate(arg, configuration); - } - - public String username() { - try { - return getOrThrow("version"); - } catch (UnsetPropertyException e) { - throw new RuntimeException(e); - } - } - } - - public interface SetterForUsername { - Map getInstance(); - T getBuilderAfterUsername(Map instance); - - default T username(String value) { - var instance = getInstance(); - instance.put("username", value); - return getBuilderAfterUsername(instance); - } - } - - public static class PathParametersMap0Builder implements GenericBuilder> { - private final Map instance; - private static final Set knownKeys = Set.of( - "username" - ); - public Set getKnownKeys() { - return knownKeys; - } - public PathParametersMap0Builder(Map instance) { - this.instance = instance; - } - public Map build() { - return instance; - } - } - - public static class PathParametersMapBuilder implements SetterForUsername { - private final Map instance; - public PathParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map getInstance() { - return instance; - } - public PathParametersMap0Builder getBuilderAfterUsername(Map instance) { - return new PathParametersMap0Builder(instance); - } - } - - - public sealed interface PathParameters1Boxed permits PathParameters1BoxedMap { - @Nullable Object getData(); - } - - public record PathParameters1BoxedMap(PathParametersMap data) implements PathParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable PathParameters1 instance = null; - - protected PathParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("username", Schema.Schema1.class) - )) - .required(Set.of( - "username" - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static PathParameters1 getInstance() { - if (instance == null) { - instance = new PathParameters1(); - } - return instance; - } - - public PathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - if (!(propertyInstance instanceof String)) { - throw new RuntimeException("Invalid instantiated value"); - } - properties.put(propertyName, (String) propertyInstance); - } - FrozenMap castProperties = new FrozenMap<>(properties); - return new PathParametersMap(castProperties); - } - - public PathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new PathParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/Responses.java deleted file mode 100644 index e5020958495..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/Responses.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.openapijsonschematools.client.paths.userusername.delete; - -import org.openapijsonschematools.client.paths.userusername.delete.responses.Code200Response; -import org.openapijsonschematools.client.paths.userusername.delete.responses.Code404Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Void body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer, StatusCode404ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - public static final class StatusCode404ResponseDeserializer extends Code404Response.Code404Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()), - new AbstractMap.SimpleEntry<>("404", new StatusCode404ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - if (statusCodeDeserializer instanceof StatusCode200ResponseDeserializer castDeserializer) { - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } else { - StatusCode404ResponseDeserializer castDeserializer = (StatusCode404ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - throw new Code404Response.ResponseApiException( - "Received error statusCode response from server", - response, - deserializedResponse - ); - } - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/UserusernameDeletePathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/UserusernameDeletePathParameters.java new file mode 100644 index 00000000000..be9018de12b --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/UserusernameDeletePathParameters.java @@ -0,0 +1,205 @@ +package org.openapijsonschematools.client.paths.userusername.delete; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.components.parameters.pathusername.Schema; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class UserusernameDeletePathParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class UserusernameDeleteadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable UserusernameDeleteadditionalProperties instance = null; + public static UserusernameDeleteadditionalProperties getInstance() { + if (instance == null) { + instance = new UserusernameDeleteadditionalProperties(); + } + return instance; + } + } + + + public static class UserusernameDeletePathParametersMap extends FrozenMap { + protected UserusernameDeletePathParametersMap(FrozenMap m) { + super(m); + } + public static final Set requiredKeys = Set.of( + "username" + ); + public static final Set optionalKeys = Set.of(); + public static UserusernameDeletePathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return UserusernameDeletePathParameters1.getInstance().validate(arg, configuration); + } + + public String username() { + try { + return getOrThrow("version"); + } catch (UnsetPropertyException e) { + throw new RuntimeException(e); + } + } + } + + public interface SetterForUserusernameDeleteusername { + Map getInstance(); + T getBuilderAfterUserusernameDeleteusername(Map instance); + + default T username(String value) { + var instance = getInstance(); + instance.put("username", value); + return getBuilderAfterUserusernameDeleteusername(instance); + } + } + + public static class UserusernameDeletePathParametersMap0Builder implements GenericBuilder> { + private final Map instance; + private static final Set knownKeys = Set.of( + "username" + ); + public Set getKnownKeys() { + return knownKeys; + } + public UserusernameDeletePathParametersMap0Builder(Map instance) { + this.instance = instance; + } + public Map build() { + return instance; + } + } + + public static class UserusernameDeletePathParametersMapBuilder implements SetterForUserusernameDeleteusername { + private final Map instance; + public UserusernameDeletePathParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map getInstance() { + return instance; + } + public UserusernameDeletePathParametersMap0Builder getBuilderAfterUserusernameDeleteusername(Map instance) { + return new UserusernameDeletePathParametersMap0Builder(instance); + } + } + + + public sealed interface UserusernameDeletePathParameters1Boxed permits UserusernameDeletePathParameters1BoxedMap { + @Nullable Object getData(); + } + + public record UserusernameDeletePathParameters1BoxedMap(UserusernameDeletePathParametersMap data) implements UserusernameDeletePathParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class UserusernameDeletePathParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable UserusernameDeletePathParameters1 instance = null; + + protected UserusernameDeletePathParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("username", Schema.Schema1.class) + )) + .required(Set.of( + "username" + )) + .additionalProperties(UserusernameDeleteadditionalProperties.class) + ); + } + + public static UserusernameDeletePathParameters1 getInstance() { + if (instance == null) { + instance = new UserusernameDeletePathParameters1(); + } + return instance; + } + + public UserusernameDeletePathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof String)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (String) propertyInstance); + } + FrozenMap castProperties = new FrozenMap<>(properties); + return new UserusernameDeletePathParametersMap(castProperties); + } + + public UserusernameDeletePathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public UserusernameDeletePathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new UserusernameDeletePathParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public UserusernameDeletePathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/UserusernameDeleteResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/UserusernameDeleteResponses.java new file mode 100644 index 00000000000..8ab4e2b7b08 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/UserusernameDeleteResponses.java @@ -0,0 +1,66 @@ +package org.openapijsonschematools.client.paths.userusername.delete; + +import org.openapijsonschematools.client.paths.userusername.delete.responses.UserusernameDeleteCode200Response; +import org.openapijsonschematools.client.paths.userusername.delete.responses.UserusernameDeleteCode404Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class UserusernameDeleteResponses { + public sealed interface EndpointResponse permits EndpointUserusernameDeleteCode200Response {} + + public record EndpointUserusernameDeleteCode200Response( + HttpResponse response, + Void body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusUserusernameDeleteCode200ResponseDeserializer, StatusUserusernameDeleteCode404ResponseDeserializer {} + + public static final class StatusUserusernameDeleteCode200ResponseDeserializer extends UserusernameDeleteCode200Response.UserusernameDeleteCode200Response1 implements StatusCodeResponseDeserializer { + } + public static final class StatusUserusernameDeleteCode404ResponseDeserializer extends UserusernameDeleteCode404Response.UserusernameDeleteCode404Response1 implements StatusCodeResponseDeserializer { + } + + public static final class UserusernameDeleteResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public UserusernameDeleteResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusUserusernameDeleteCode200ResponseDeserializer()), + new AbstractMap.SimpleEntry<>("404", new StatusUserusernameDeleteCode404ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + if (statusCodeDeserializer instanceof StatusUserusernameDeleteCode200ResponseDeserializer castDeserializer) { + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointUserusernameDeleteCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } else { + StatusUserusernameDeleteCode404ResponseDeserializer castDeserializer = (StatusUserusernameDeleteCode404ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + throw new UserusernameDeleteCode404Response.ResponseApiException( + "Received error statusCode response from server", + response, + deserializedResponse + ); + } + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/responses/Code200Response.java deleted file mode 100644 index 3dc59f474c4..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/responses/Code200Response.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.openapijsonschematools.client.paths.userusername.delete.responses; - -import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; - -public class Code200Response extends SuccessDescriptionOnly { - public static class Code200Response1 extends SuccessDescriptionOnly1 {} -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/responses/Code404Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/responses/Code404Response.java deleted file mode 100644 index ab220b57b21..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/responses/Code404Response.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapijsonschematools.client.paths.userusername.delete.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; - -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code404Response { - - public static class Code404Response1 extends ResponseDeserializer { - public Code404Response1() { - super( - MapUtils.makeMap( - ) - ); - } - - @Override - protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { - return null; - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/responses/UserusernameDeleteCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/responses/UserusernameDeleteCode200Response.java new file mode 100644 index 00000000000..680a51cb08b --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/responses/UserusernameDeleteCode200Response.java @@ -0,0 +1,7 @@ +package org.openapijsonschematools.client.paths.userusername.delete.responses; + +import org.openapijsonschematools.client.components.responses.SuccessDescriptionOnly; + +public class UserusernameDeleteCode200Response extends SuccessDescriptionOnly { + public static class UserusernameDeleteCode200Response1 extends SuccessDescriptionOnly1 {} +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/responses/UserusernameDeleteCode404Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/responses/UserusernameDeleteCode404Response.java new file mode 100644 index 00000000000..8bd53126538 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/delete/responses/UserusernameDeleteCode404Response.java @@ -0,0 +1,45 @@ +package org.openapijsonschematools.client.paths.userusername.delete.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class UserusernameDeleteCode404Response { + + public static class UserusernameDeleteCode404Response1 extends ResponseDeserializer { + public UserusernameDeleteCode404Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/PathParameters.java deleted file mode 100644 index a106cf2af60..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/PathParameters.java +++ /dev/null @@ -1,205 +0,0 @@ -package org.openapijsonschematools.client.paths.userusername.get; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.components.parameters.pathusername.Schema; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class PathParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class PathParametersMap extends FrozenMap { - protected PathParametersMap(FrozenMap m) { - super(m); - } - public static final Set requiredKeys = Set.of( - "username" - ); - public static final Set optionalKeys = Set.of(); - public static PathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return PathParameters1.getInstance().validate(arg, configuration); - } - - public String username() { - try { - return getOrThrow("version"); - } catch (UnsetPropertyException e) { - throw new RuntimeException(e); - } - } - } - - public interface SetterForUsername { - Map getInstance(); - T getBuilderAfterUsername(Map instance); - - default T username(String value) { - var instance = getInstance(); - instance.put("username", value); - return getBuilderAfterUsername(instance); - } - } - - public static class PathParametersMap0Builder implements GenericBuilder> { - private final Map instance; - private static final Set knownKeys = Set.of( - "username" - ); - public Set getKnownKeys() { - return knownKeys; - } - public PathParametersMap0Builder(Map instance) { - this.instance = instance; - } - public Map build() { - return instance; - } - } - - public static class PathParametersMapBuilder implements SetterForUsername { - private final Map instance; - public PathParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map getInstance() { - return instance; - } - public PathParametersMap0Builder getBuilderAfterUsername(Map instance) { - return new PathParametersMap0Builder(instance); - } - } - - - public sealed interface PathParameters1Boxed permits PathParameters1BoxedMap { - @Nullable Object getData(); - } - - public record PathParameters1BoxedMap(PathParametersMap data) implements PathParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable PathParameters1 instance = null; - - protected PathParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("username", Schema.Schema1.class) - )) - .required(Set.of( - "username" - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static PathParameters1 getInstance() { - if (instance == null) { - instance = new PathParameters1(); - } - return instance; - } - - public PathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - if (!(propertyInstance instanceof String)) { - throw new RuntimeException("Invalid instantiated value"); - } - properties.put(propertyName, (String) propertyInstance); - } - FrozenMap castProperties = new FrozenMap<>(properties); - return new PathParametersMap(castProperties); - } - - public PathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new PathParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/Responses.java deleted file mode 100644 index 320fedb631d..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/Responses.java +++ /dev/null @@ -1,77 +0,0 @@ -package org.openapijsonschematools.client.paths.userusername.get; - -import org.openapijsonschematools.client.paths.userusername.get.responses.Code200Response; -import org.openapijsonschematools.client.paths.userusername.get.responses.Code400Response; -import org.openapijsonschematools.client.paths.userusername.get.responses.Code404Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ApiResponse; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - public sealed interface EndpointResponse permits EndpointCode200Response {} - - public record EndpointCode200Response( - HttpResponse response, - Code200Response.SealedResponseBody body, - Void headers - ) implements EndpointResponse, ApiResponse{ - } - - public sealed interface StatusCodeResponseDeserializer permits StatusCode200ResponseDeserializer, StatusCode400ResponseDeserializer, StatusCode404ResponseDeserializer {} - - public static final class StatusCode200ResponseDeserializer extends Code200Response.Code200Response1 implements StatusCodeResponseDeserializer { - } - public static final class StatusCode400ResponseDeserializer extends Code400Response.Code400Response1 implements StatusCodeResponseDeserializer { - } - public static final class StatusCode404ResponseDeserializer extends Code404Response.Code404Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("200", new StatusCode200ResponseDeserializer()), - new AbstractMap.SimpleEntry<>("400", new StatusCode400ResponseDeserializer()), - new AbstractMap.SimpleEntry<>("404", new StatusCode404ResponseDeserializer()) - ); - } - - public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - if (statusCodeDeserializer instanceof StatusCode200ResponseDeserializer castDeserializer) { - var deserializedResponse = castDeserializer.deserialize(response, configuration); - return new EndpointCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); - } else if (statusCodeDeserializer instanceof StatusCode400ResponseDeserializer castDeserializer) { - var deserializedResponse = castDeserializer.deserialize(response, configuration); - throw new Code400Response.ResponseApiException( - "Received error statusCode response from server", - response, - deserializedResponse - ); - } else { - StatusCode404ResponseDeserializer castDeserializer = (StatusCode404ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - throw new Code404Response.ResponseApiException( - "Received error statusCode response from server", - response, - deserializedResponse - ); - } - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/UserusernameGetPathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/UserusernameGetPathParameters.java new file mode 100644 index 00000000000..97e95a2e0ce --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/UserusernameGetPathParameters.java @@ -0,0 +1,205 @@ +package org.openapijsonschematools.client.paths.userusername.get; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.components.parameters.pathusername.Schema; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class UserusernameGetPathParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class UserusernameGetadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable UserusernameGetadditionalProperties instance = null; + public static UserusernameGetadditionalProperties getInstance() { + if (instance == null) { + instance = new UserusernameGetadditionalProperties(); + } + return instance; + } + } + + + public static class UserusernameGetPathParametersMap extends FrozenMap { + protected UserusernameGetPathParametersMap(FrozenMap m) { + super(m); + } + public static final Set requiredKeys = Set.of( + "username" + ); + public static final Set optionalKeys = Set.of(); + public static UserusernameGetPathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return UserusernameGetPathParameters1.getInstance().validate(arg, configuration); + } + + public String username() { + try { + return getOrThrow("version"); + } catch (UnsetPropertyException e) { + throw new RuntimeException(e); + } + } + } + + public interface SetterForUserusernameGetusername { + Map getInstance(); + T getBuilderAfterUserusernameGetusername(Map instance); + + default T username(String value) { + var instance = getInstance(); + instance.put("username", value); + return getBuilderAfterUserusernameGetusername(instance); + } + } + + public static class UserusernameGetPathParametersMap0Builder implements GenericBuilder> { + private final Map instance; + private static final Set knownKeys = Set.of( + "username" + ); + public Set getKnownKeys() { + return knownKeys; + } + public UserusernameGetPathParametersMap0Builder(Map instance) { + this.instance = instance; + } + public Map build() { + return instance; + } + } + + public static class UserusernameGetPathParametersMapBuilder implements SetterForUserusernameGetusername { + private final Map instance; + public UserusernameGetPathParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map getInstance() { + return instance; + } + public UserusernameGetPathParametersMap0Builder getBuilderAfterUserusernameGetusername(Map instance) { + return new UserusernameGetPathParametersMap0Builder(instance); + } + } + + + public sealed interface UserusernameGetPathParameters1Boxed permits UserusernameGetPathParameters1BoxedMap { + @Nullable Object getData(); + } + + public record UserusernameGetPathParameters1BoxedMap(UserusernameGetPathParametersMap data) implements UserusernameGetPathParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class UserusernameGetPathParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable UserusernameGetPathParameters1 instance = null; + + protected UserusernameGetPathParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("username", Schema.Schema1.class) + )) + .required(Set.of( + "username" + )) + .additionalProperties(UserusernameGetadditionalProperties.class) + ); + } + + public static UserusernameGetPathParameters1 getInstance() { + if (instance == null) { + instance = new UserusernameGetPathParameters1(); + } + return instance; + } + + public UserusernameGetPathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof String)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (String) propertyInstance); + } + FrozenMap castProperties = new FrozenMap<>(properties); + return new UserusernameGetPathParametersMap(castProperties); + } + + public UserusernameGetPathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public UserusernameGetPathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new UserusernameGetPathParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public UserusernameGetPathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/UserusernameGetResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/UserusernameGetResponses.java new file mode 100644 index 00000000000..042305694da --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/UserusernameGetResponses.java @@ -0,0 +1,77 @@ +package org.openapijsonschematools.client.paths.userusername.get; + +import org.openapijsonschematools.client.paths.userusername.get.responses.UserusernameGetCode200Response; +import org.openapijsonschematools.client.paths.userusername.get.responses.UserusernameGetCode400Response; +import org.openapijsonschematools.client.paths.userusername.get.responses.UserusernameGetCode404Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ApiResponse; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class UserusernameGetResponses { + public sealed interface EndpointResponse permits EndpointUserusernameGetCode200Response {} + + public record EndpointUserusernameGetCode200Response( + HttpResponse response, + UserusernameGetCode200Response.SealedResponseBody body, + Void headers + ) implements EndpointResponse, ApiResponse{ + } + + public sealed interface StatusCodeResponseDeserializer permits StatusUserusernameGetCode200ResponseDeserializer, StatusUserusernameGetCode400ResponseDeserializer, StatusUserusernameGetCode404ResponseDeserializer {} + + public static final class StatusUserusernameGetCode200ResponseDeserializer extends UserusernameGetCode200Response.UserusernameGetCode200Response1 implements StatusCodeResponseDeserializer { + } + public static final class StatusUserusernameGetCode400ResponseDeserializer extends UserusernameGetCode400Response.UserusernameGetCode400Response1 implements StatusCodeResponseDeserializer { + } + public static final class StatusUserusernameGetCode404ResponseDeserializer extends UserusernameGetCode404Response.UserusernameGetCode404Response1 implements StatusCodeResponseDeserializer { + } + + public static final class UserusernameGetResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public UserusernameGetResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("200", new StatusUserusernameGetCode200ResponseDeserializer()), + new AbstractMap.SimpleEntry<>("400", new StatusUserusernameGetCode400ResponseDeserializer()), + new AbstractMap.SimpleEntry<>("404", new StatusUserusernameGetCode404ResponseDeserializer()) + ); + } + + public EndpointResponse deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + if (statusCodeDeserializer instanceof StatusUserusernameGetCode200ResponseDeserializer castDeserializer) { + var deserializedResponse = castDeserializer.deserialize(response, configuration); + return new EndpointUserusernameGetCode200Response(response, deserializedResponse.body(), deserializedResponse.headers()); + } else if (statusCodeDeserializer instanceof StatusUserusernameGetCode400ResponseDeserializer castDeserializer) { + var deserializedResponse = castDeserializer.deserialize(response, configuration); + throw new UserusernameGetCode400Response.ResponseApiException( + "Received error statusCode response from server", + response, + deserializedResponse + ); + } else { + StatusUserusernameGetCode404ResponseDeserializer castDeserializer = (StatusUserusernameGetCode404ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + throw new UserusernameGetCode404Response.ResponseApiException( + "Received error statusCode response from server", + response, + deserializedResponse + ); + } + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/Code200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/Code200Response.java deleted file mode 100644 index e83a0bb7634..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/Code200Response.java +++ /dev/null @@ -1,81 +0,0 @@ -package org.openapijsonschematools.client.paths.userusername.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.userusername.get.responses.code200response.content.applicationxml.ApplicationxmlSchema; -import org.openapijsonschematools.client.paths.userusername.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code200Response { - public sealed interface SealedMediaType permits ApplicationxmlMediaType, ApplicationjsonMediaType {} - - public record ApplicationxmlMediaType(ApplicationxmlSchema.ApplicationxmlSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationxmlMediaType() { - this(ApplicationxmlSchema.ApplicationxmlSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - public sealed interface SealedResponseBody permits ApplicationxmlResponseBody, ApplicationjsonResponseBody {} - public record ApplicationxmlResponseBody(ApplicationxmlSchema.User1Boxed body) implements SealedResponseBody { } - public record ApplicationjsonResponseBody(ApplicationjsonSchema.User1Boxed body) implements SealedResponseBody { } - - public static class Code200Response1 extends ResponseDeserializer { - public Code200Response1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/xml", new ApplicationxmlMediaType()), - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ) - ); - } - - @Override - protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { - if (mediaType instanceof ApplicationxmlMediaType thisMediaType) { - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationxmlResponseBody(deserializedBody); - } else { - ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; - var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); - return new ApplicationjsonResponseBody(deserializedBody); - } - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/Code400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/Code400Response.java deleted file mode 100644 index 4fcdb4ca075..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/Code400Response.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapijsonschematools.client.paths.userusername.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; - -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code400Response { - - public static class Code400Response1 extends ResponseDeserializer { - public Code400Response1() { - super( - MapUtils.makeMap( - ) - ); - } - - @Override - protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { - return null; - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/Code404Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/Code404Response.java deleted file mode 100644 index cfa381bd2a1..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/Code404Response.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapijsonschematools.client.paths.userusername.get.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; - -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code404Response { - - public static class Code404Response1 extends ResponseDeserializer { - public Code404Response1() { - super( - MapUtils.makeMap( - ) - ); - } - - @Override - protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { - return null; - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/UserusernameGetCode200Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/UserusernameGetCode200Response.java new file mode 100644 index 00000000000..a71bf43bca4 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/UserusernameGetCode200Response.java @@ -0,0 +1,81 @@ +package org.openapijsonschematools.client.paths.userusername.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.userusername.get.responses.code200response.content.applicationxml.ApplicationxmlSchema; +import org.openapijsonschematools.client.paths.userusername.get.responses.code200response.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class UserusernameGetCode200Response { + public sealed interface SealedMediaType permits ApplicationxmlMediaType, ApplicationjsonMediaType {} + + public record ApplicationxmlMediaType(ApplicationxmlSchema.ApplicationxmlSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationxmlMediaType() { + this(ApplicationxmlSchema.ApplicationxmlSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + public sealed interface SealedResponseBody permits ApplicationxmlResponseBody, ApplicationjsonResponseBody {} + public record ApplicationxmlResponseBody(ApplicationxmlSchema.User1Boxed body) implements SealedResponseBody { } + public record ApplicationjsonResponseBody(ApplicationjsonSchema.User1Boxed body) implements SealedResponseBody { } + + public static class UserusernameGetCode200Response1 extends ResponseDeserializer { + public UserusernameGetCode200Response1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/xml", new ApplicationxmlMediaType()), + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ) + ); + } + + @Override + protected SealedResponseBody getBody(String contentType, SealedMediaType mediaType, byte[] body, SchemaConfiguration configuration) throws ValidationException, NotImplementedException { + if (mediaType instanceof ApplicationxmlMediaType thisMediaType) { + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationxmlResponseBody(deserializedBody); + } else { + ApplicationjsonMediaType thisMediaType = (ApplicationjsonMediaType) mediaType; + var deserializedBody = deserializeBody(contentType, body, thisMediaType.schema(), configuration); + return new ApplicationjsonResponseBody(deserializedBody); + } + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/UserusernameGetCode400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/UserusernameGetCode400Response.java new file mode 100644 index 00000000000..71459da89cd --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/UserusernameGetCode400Response.java @@ -0,0 +1,45 @@ +package org.openapijsonschematools.client.paths.userusername.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class UserusernameGetCode400Response { + + public static class UserusernameGetCode400Response1 extends ResponseDeserializer { + public UserusernameGetCode400Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/UserusernameGetCode404Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/UserusernameGetCode404Response.java new file mode 100644 index 00000000000..6c106f8d43b --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/get/responses/UserusernameGetCode404Response.java @@ -0,0 +1,45 @@ +package org.openapijsonschematools.client.paths.userusername.get.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class UserusernameGetCode404Response { + + public static class UserusernameGetCode404Response1 extends ResponseDeserializer { + public UserusernameGetCode404Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/PathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/PathParameters.java deleted file mode 100644 index 432e101e9af..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/PathParameters.java +++ /dev/null @@ -1,205 +0,0 @@ -package org.openapijsonschematools.client.paths.userusername.put; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.openapijsonschematools.client.components.parameters.pathusername.Schema; -import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.exceptions.UnsetPropertyException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.GenericBuilder; -import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; -import org.openapijsonschematools.client.schemas.validation.FrozenMap; -import org.openapijsonschematools.client.schemas.validation.JsonSchema; -import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; -import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; -import org.openapijsonschematools.client.schemas.validation.MapUtils; -import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; -import org.openapijsonschematools.client.schemas.validation.PropertyEntry; -import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; - -public class PathParameters { - // nest classes so all schemas and input/output classes can be public - - - public static class AdditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { - // NotAnyTypeSchema - private static @Nullable AdditionalProperties instance = null; - public static AdditionalProperties getInstance() { - if (instance == null) { - instance = new AdditionalProperties(); - } - return instance; - } - } - - - public static class PathParametersMap extends FrozenMap { - protected PathParametersMap(FrozenMap m) { - super(m); - } - public static final Set requiredKeys = Set.of( - "username" - ); - public static final Set optionalKeys = Set.of(); - public static PathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { - return PathParameters1.getInstance().validate(arg, configuration); - } - - public String username() { - try { - return getOrThrow("version"); - } catch (UnsetPropertyException e) { - throw new RuntimeException(e); - } - } - } - - public interface SetterForUsername { - Map getInstance(); - T getBuilderAfterUsername(Map instance); - - default T username(String value) { - var instance = getInstance(); - instance.put("username", value); - return getBuilderAfterUsername(instance); - } - } - - public static class PathParametersMap0Builder implements GenericBuilder> { - private final Map instance; - private static final Set knownKeys = Set.of( - "username" - ); - public Set getKnownKeys() { - return knownKeys; - } - public PathParametersMap0Builder(Map instance) { - this.instance = instance; - } - public Map build() { - return instance; - } - } - - public static class PathParametersMapBuilder implements SetterForUsername { - private final Map instance; - public PathParametersMapBuilder() { - this.instance = new LinkedHashMap<>(); - } - public Map getInstance() { - return instance; - } - public PathParametersMap0Builder getBuilderAfterUsername(Map instance) { - return new PathParametersMap0Builder(instance); - } - } - - - public sealed interface PathParameters1Boxed permits PathParameters1BoxedMap { - @Nullable Object getData(); - } - - public record PathParameters1BoxedMap(PathParametersMap data) implements PathParameters1Boxed { - @Override - public @Nullable Object getData() { - return data; - } - } - - - public static class PathParameters1 extends JsonSchema implements MapSchemaValidator { - private static @Nullable PathParameters1 instance = null; - - protected PathParameters1() { - super(new JsonSchemaInfo() - .type(Set.of(Map.class)) - .properties(Map.ofEntries( - new PropertyEntry("username", Schema.Schema1.class) - )) - .required(Set.of( - "username" - )) - .additionalProperties(AdditionalProperties.class) - ); - } - - public static PathParameters1 getInstance() { - if (instance == null) { - instance = new PathParameters1(); - } - return instance; - } - - public PathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { - LinkedHashMap properties = new LinkedHashMap<>(); - for(Map.Entry entry: arg.entrySet()) { - @Nullable Object entryKey = entry.getKey(); - if (!(entryKey instanceof String)) { - throw new RuntimeException("Invalid non-string key value"); - } - String propertyName = (String) entryKey; - List propertyPathToItem = new ArrayList<>(pathToItem); - propertyPathToItem.add(propertyName); - Object value = entry.getValue(); - LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); - if (schemas == null) { - throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); - } - JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); - @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); - if (!(propertyInstance instanceof String)) { - throw new RuntimeException("Invalid instantiated value"); - } - properties.put(propertyName, (String) propertyInstance); - } - FrozenMap castProperties = new FrozenMap<>(properties); - return new PathParametersMap(castProperties); - } - - public PathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { - Set> pathSet = new HashSet<>(); - List pathToItem = List.of("args[0"); - Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); - SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); - ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); - PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); - return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); - } - - - @Override - public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map) { - return validate((Map) arg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - @Override - public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { - if (arg instanceof Map) { - return getNewInstance((Map) arg, pathToItem, pathToSchemas); - } - throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); - } - @Override - public PathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { - return new PathParameters1BoxedMap(validate(arg, configuration)); - } - @Override - public PathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { - if (arg instanceof Map castArg) { - return validateAndBox(castArg, configuration); - } - throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); - } - } - -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/RequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/RequestBody.java deleted file mode 100644 index 5efb70e1d9b..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/RequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -*/ - -package org.openapijsonschematools.client.paths.userusername.put; - -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.requestbody.RequestBodySerializer; -import org.openapijsonschematools.client.requestbody.GenericRequestBody; -import org.openapijsonschematools.client.requestbody.SerializedRequestBody; -import org.openapijsonschematools.client.mediatype.MediaType; -import org.openapijsonschematools.client.paths.userusername.put.requestbody.content.applicationjson.ApplicationjsonSchema; - -import java.util.AbstractMap; -import java.util.Map; - -public class RequestBody { - public sealed interface SealedMediaType permits ApplicationjsonMediaType {} - - public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { - public ApplicationjsonMediaType() { - this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); - } - @Override - public Void encoding() { - return null; - } - } - - public static class RequestBody1 extends RequestBodySerializer { - public RequestBody1() { - super( - Map.ofEntries( - new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) - ), - true - ); - } - - public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { - ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; - return serialize(requestBody0.contentType(), requestBody0.body().getData()); - } - } - - public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} - public record ApplicationjsonRequestBody(ApplicationjsonSchema.User1Boxed body) implements SealedRequestBody, GenericRequestBody { - @Override - public String contentType() { - return "application/json"; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/Responses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/Responses.java deleted file mode 100644 index 732033d8a06..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/Responses.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.openapijsonschematools.client.paths.userusername.put; - -import org.openapijsonschematools.client.paths.userusername.put.responses.Code400Response; -import org.openapijsonschematools.client.paths.userusername.put.responses.Code404Response; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.response.ResponsesDeserializer; -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.checkerframework.checker.nullness.qual.Nullable; - -import java.net.http.HttpResponse; -import java.util.Map; -import java.util.AbstractMap; - -public class Responses { - - public sealed interface StatusCodeResponseDeserializer permits StatusCode400ResponseDeserializer, StatusCode404ResponseDeserializer {} - - public static final class StatusCode400ResponseDeserializer extends Code400Response.Code400Response1 implements StatusCodeResponseDeserializer { - } - public static final class StatusCode404ResponseDeserializer extends Code404Response.Code404Response1 implements StatusCodeResponseDeserializer { - } - - public static final class Responses1 implements ResponsesDeserializer { - private final Map statusCodeToResponseDeserializer; - public Responses1() { - this.statusCodeToResponseDeserializer = Map.ofEntries( - new AbstractMap.SimpleEntry<>("400", new StatusCode400ResponseDeserializer()), - new AbstractMap.SimpleEntry<>("404", new StatusCode404ResponseDeserializer()) - ); - } - - public Void deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { - String statusCode = String.valueOf(response.statusCode()); - @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); - if (statusCodeDeserializer == null) { - throw new ApiException( - "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", - response - ); - } - if (statusCodeDeserializer instanceof StatusCode400ResponseDeserializer castDeserializer) { - var deserializedResponse = castDeserializer.deserialize(response, configuration); - throw new Code400Response.ResponseApiException( - "Received error statusCode response from server", - response, - deserializedResponse - ); - } else { - StatusCode404ResponseDeserializer castDeserializer = (StatusCode404ResponseDeserializer) statusCodeDeserializer; - var deserializedResponse = castDeserializer.deserialize(response, configuration); - throw new Code404Response.ResponseApiException( - "Received error statusCode response from server", - response, - deserializedResponse - ); - } - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/UserusernamePutPathParameters.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/UserusernamePutPathParameters.java new file mode 100644 index 00000000000..6cf9587b974 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/UserusernamePutPathParameters.java @@ -0,0 +1,205 @@ +package org.openapijsonschematools.client.paths.userusername.put; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.openapijsonschematools.client.components.parameters.pathusername.Schema; +import org.openapijsonschematools.client.configurations.JsonSchemaKeywordFlags; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.exceptions.UnsetPropertyException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.GenericBuilder; +import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema; +import org.openapijsonschematools.client.schemas.validation.FrozenMap; +import org.openapijsonschematools.client.schemas.validation.JsonSchema; +import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo; +import org.openapijsonschematools.client.schemas.validation.MapSchemaValidator; +import org.openapijsonschematools.client.schemas.validation.MapUtils; +import org.openapijsonschematools.client.schemas.validation.PathToSchemasMap; +import org.openapijsonschematools.client.schemas.validation.PropertyEntry; +import org.openapijsonschematools.client.schemas.validation.ValidationMetadata; + +public class UserusernamePutPathParameters { + // nest classes so all schemas and input/output classes can be public + + + public static class UserusernamePutadditionalProperties extends NotAnyTypeJsonSchema.NotAnyTypeJsonSchema1 { + // NotAnyTypeSchema + private static @Nullable UserusernamePutadditionalProperties instance = null; + public static UserusernamePutadditionalProperties getInstance() { + if (instance == null) { + instance = new UserusernamePutadditionalProperties(); + } + return instance; + } + } + + + public static class UserusernamePutPathParametersMap extends FrozenMap { + protected UserusernamePutPathParametersMap(FrozenMap m) { + super(m); + } + public static final Set requiredKeys = Set.of( + "username" + ); + public static final Set optionalKeys = Set.of(); + public static UserusernamePutPathParametersMap of(Map arg, SchemaConfiguration configuration) throws ValidationException { + return UserusernamePutPathParameters1.getInstance().validate(arg, configuration); + } + + public String username() { + try { + return getOrThrow("version"); + } catch (UnsetPropertyException e) { + throw new RuntimeException(e); + } + } + } + + public interface SetterForUserusernamePutusername { + Map getInstance(); + T getBuilderAfterUserusernamePutusername(Map instance); + + default T username(String value) { + var instance = getInstance(); + instance.put("username", value); + return getBuilderAfterUserusernamePutusername(instance); + } + } + + public static class UserusernamePutPathParametersMap0Builder implements GenericBuilder> { + private final Map instance; + private static final Set knownKeys = Set.of( + "username" + ); + public Set getKnownKeys() { + return knownKeys; + } + public UserusernamePutPathParametersMap0Builder(Map instance) { + this.instance = instance; + } + public Map build() { + return instance; + } + } + + public static class UserusernamePutPathParametersMapBuilder implements SetterForUserusernamePutusername { + private final Map instance; + public UserusernamePutPathParametersMapBuilder() { + this.instance = new LinkedHashMap<>(); + } + public Map getInstance() { + return instance; + } + public UserusernamePutPathParametersMap0Builder getBuilderAfterUserusernamePutusername(Map instance) { + return new UserusernamePutPathParametersMap0Builder(instance); + } + } + + + public sealed interface UserusernamePutPathParameters1Boxed permits UserusernamePutPathParameters1BoxedMap { + @Nullable Object getData(); + } + + public record UserusernamePutPathParameters1BoxedMap(UserusernamePutPathParametersMap data) implements UserusernamePutPathParameters1Boxed { + @Override + public @Nullable Object getData() { + return data; + } + } + + + public static class UserusernamePutPathParameters1 extends JsonSchema implements MapSchemaValidator { + private static @Nullable UserusernamePutPathParameters1 instance = null; + + protected UserusernamePutPathParameters1() { + super(new JsonSchemaInfo() + .type(Set.of(Map.class)) + .properties(Map.ofEntries( + new PropertyEntry("username", Schema.Schema1.class) + )) + .required(Set.of( + "username" + )) + .additionalProperties(UserusernamePutadditionalProperties.class) + ); + } + + public static UserusernamePutPathParameters1 getInstance() { + if (instance == null) { + instance = new UserusernamePutPathParameters1(); + } + return instance; + } + + public UserusernamePutPathParametersMap getNewInstance(Map arg, List pathToItem, PathToSchemasMap pathToSchemas) { + LinkedHashMap properties = new LinkedHashMap<>(); + for(Map.Entry entry: arg.entrySet()) { + @Nullable Object entryKey = entry.getKey(); + if (!(entryKey instanceof String)) { + throw new RuntimeException("Invalid non-string key value"); + } + String propertyName = (String) entryKey; + List propertyPathToItem = new ArrayList<>(pathToItem); + propertyPathToItem.add(propertyName); + Object value = entry.getValue(); + LinkedHashMap, Void> schemas = pathToSchemas.get(propertyPathToItem); + if (schemas == null) { + throw new RuntimeException("Validation result is invalid, schemas must exist for a pathToItem"); + } + JsonSchema propertySchema = schemas.entrySet().iterator().next().getKey(); + @Nullable Object propertyInstance = propertySchema.getNewInstance(value, propertyPathToItem, pathToSchemas); + if (!(propertyInstance instanceof String)) { + throw new RuntimeException("Invalid instantiated value"); + } + properties.put(propertyName, (String) propertyInstance); + } + FrozenMap castProperties = new FrozenMap<>(properties); + return new UserusernamePutPathParametersMap(castProperties); + } + + public UserusernamePutPathParametersMap validate(Map arg, SchemaConfiguration configuration) throws ValidationException { + Set> pathSet = new HashSet<>(); + List pathToItem = List.of("args[0"); + Map castArg = castToAllowedTypes(arg, pathToItem, pathSet); + SchemaConfiguration usedConfiguration = Objects.requireNonNullElseGet(configuration, () -> new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build())); + ValidationMetadata validationMetadata = new ValidationMetadata(pathToItem, usedConfiguration, new PathToSchemasMap(), new LinkedHashSet<>()); + PathToSchemasMap pathToSchemasMap = getPathToSchemas(this, castArg, validationMetadata, pathSet); + return getNewInstance(castArg, validationMetadata.pathToItem(), pathToSchemasMap); + } + + + @Override + public @Nullable Object validate(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map) { + return validate((Map) arg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + @Override + public @Nullable Object getNewInstance(@Nullable Object arg, List pathToItem, PathToSchemasMap pathToSchemas) { + if (arg instanceof Map) { + return getNewInstance((Map) arg, pathToItem, pathToSchemas); + } + throw new RuntimeException("Invalid input type="+getClass(arg)+". It can't be instantiated by this schema"); + } + @Override + public UserusernamePutPathParameters1BoxedMap validateAndBox(Map arg, SchemaConfiguration configuration) throws ValidationException { + return new UserusernamePutPathParameters1BoxedMap(validate(arg, configuration)); + } + @Override + public UserusernamePutPathParameters1Boxed validateAndBox(@Nullable Object arg, SchemaConfiguration configuration) throws ValidationException { + if (arg instanceof Map castArg) { + return validateAndBox(castArg, configuration); + } + throw new ValidationException("Invalid input type="+getClass(arg)+". It can't be validated by this schema"); + } + } + +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/UserusernamePutRequestBody.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/UserusernamePutRequestBody.java new file mode 100644 index 00000000000..f342c7ef9aa --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/UserusernamePutRequestBody.java @@ -0,0 +1,53 @@ +/* + Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator +*/ + +package org.openapijsonschematools.client.paths.userusername.put; + +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.requestbody.RequestBodySerializer; +import org.openapijsonschematools.client.requestbody.GenericRequestBody; +import org.openapijsonschematools.client.requestbody.SerializedRequestBody; +import org.openapijsonschematools.client.mediatype.MediaType; +import org.openapijsonschematools.client.paths.userusername.put.requestbody.content.applicationjson.ApplicationjsonSchema; + +import java.util.AbstractMap; +import java.util.Map; + +public class UserusernamePutRequestBody { + public sealed interface SealedMediaType permits ApplicationjsonMediaType {} + + public record ApplicationjsonMediaType(ApplicationjsonSchema.ApplicationjsonSchema1 schema) implements SealedMediaType, MediaType { + public ApplicationjsonMediaType() { + this(ApplicationjsonSchema.ApplicationjsonSchema1.getInstance()); + } + @Override + public Void encoding() { + return null; + } + } + + public static class UserusernamePutRequestBody1 extends RequestBodySerializer { + public UserusernamePutRequestBody1() { + super( + Map.ofEntries( + new AbstractMap.SimpleEntry<>("application/json", new ApplicationjsonMediaType()) + ), + true + ); + } + + public SerializedRequestBody serialize(SealedRequestBody requestBody) throws NotImplementedException { + ApplicationjsonRequestBody requestBody0 = (ApplicationjsonRequestBody) requestBody; + return serialize(requestBody0.contentType(), requestBody0.body().getData()); + } + } + + public sealed interface SealedRequestBody permits ApplicationjsonRequestBody {} + public record ApplicationjsonRequestBody(ApplicationjsonSchema.User1Boxed body) implements SealedRequestBody, GenericRequestBody { + @Override + public String contentType() { + return "application/json"; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/UserusernamePutResponses.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/UserusernamePutResponses.java new file mode 100644 index 00000000000..533a25eabe5 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/UserusernamePutResponses.java @@ -0,0 +1,61 @@ +package org.openapijsonschematools.client.paths.userusername.put; + +import org.openapijsonschematools.client.paths.userusername.put.responses.UserusernamePutCode400Response; +import org.openapijsonschematools.client.paths.userusername.put.responses.UserusernamePutCode404Response; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.response.ResponsesDeserializer; +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.AbstractMap; + +public class UserusernamePutResponses { + + public sealed interface StatusCodeResponseDeserializer permits StatusUserusernamePutCode400ResponseDeserializer, StatusUserusernamePutCode404ResponseDeserializer {} + + public static final class StatusUserusernamePutCode400ResponseDeserializer extends UserusernamePutCode400Response.UserusernamePutCode400Response1 implements StatusCodeResponseDeserializer { + } + public static final class StatusUserusernamePutCode404ResponseDeserializer extends UserusernamePutCode404Response.UserusernamePutCode404Response1 implements StatusCodeResponseDeserializer { + } + + public static final class UserusernamePutResponses1 implements ResponsesDeserializer { + private final Map statusCodeToResponseDeserializer; + public UserusernamePutResponses1() { + this.statusCodeToResponseDeserializer = Map.ofEntries( + new AbstractMap.SimpleEntry<>("400", new StatusUserusernamePutCode400ResponseDeserializer()), + new AbstractMap.SimpleEntry<>("404", new StatusUserusernamePutCode404ResponseDeserializer()) + ); + } + + public Void deserialize(HttpResponse response, SchemaConfiguration configuration) throws ValidationException, NotImplementedException, ApiException { + String statusCode = String.valueOf(response.statusCode()); + @Nullable StatusCodeResponseDeserializer statusCodeDeserializer = statusCodeToResponseDeserializer.get(statusCode); + if (statusCodeDeserializer == null) { + throw new ApiException( + "Invalid response statusCode="+statusCode+" has no response defined in the openapi document", + response + ); + } + if (statusCodeDeserializer instanceof StatusUserusernamePutCode400ResponseDeserializer castDeserializer) { + var deserializedResponse = castDeserializer.deserialize(response, configuration); + throw new UserusernamePutCode400Response.ResponseApiException( + "Received error statusCode response from server", + response, + deserializedResponse + ); + } else { + StatusUserusernamePutCode404ResponseDeserializer castDeserializer = (StatusUserusernamePutCode404ResponseDeserializer) statusCodeDeserializer; + var deserializedResponse = castDeserializer.deserialize(response, configuration); + throw new UserusernamePutCode404Response.ResponseApiException( + "Received error statusCode response from server", + response, + deserializedResponse + ); + } + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/responses/Code400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/responses/Code400Response.java deleted file mode 100644 index 600fd3fe1df..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/responses/Code400Response.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapijsonschematools.client.paths.userusername.put.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; - -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code400Response { - - public static class Code400Response1 extends ResponseDeserializer { - public Code400Response1() { - super( - MapUtils.makeMap( - ) - ); - } - - @Override - protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { - return null; - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/responses/Code404Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/responses/Code404Response.java deleted file mode 100644 index c7aea37db95..00000000000 --- a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/responses/Code404Response.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapijsonschematools.client.paths.userusername.put.responses; - -import org.openapijsonschematools.client.configurations.SchemaConfiguration; -import org.openapijsonschematools.client.response.ResponseDeserializer; -import org.openapijsonschematools.client.response.DeserializedHttpResponse; -import org.openapijsonschematools.client.exceptions.ApiException; -import org.openapijsonschematools.client.exceptions.ValidationException; -import org.openapijsonschematools.client.exceptions.NotImplementedException; -import org.openapijsonschematools.client.schemas.validation.MapUtils; - -import java.util.Map; -import java.net.http.HttpResponse; -import java.net.http.HttpHeaders; - -public class Code404Response { - - public static class Code404Response1 extends ResponseDeserializer { - public Code404Response1() { - super( - MapUtils.makeMap( - ) - ); - } - - @Override - protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { - return null; - } - - @Override - protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { - return null; - } - } - - @SuppressWarnings("serial") - public static class ResponseApiException extends ApiException { - public DeserializedHttpResponse deserializedResponse; - - public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { - super(s, response); - this.deserializedResponse = deserializedResponse; - } - } -} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/responses/UserusernamePutCode400Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/responses/UserusernamePutCode400Response.java new file mode 100644 index 00000000000..b29bac8a12a --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/responses/UserusernamePutCode400Response.java @@ -0,0 +1,45 @@ +package org.openapijsonschematools.client.paths.userusername.put.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class UserusernamePutCode400Response { + + public static class UserusernamePutCode400Response1 extends ResponseDeserializer { + public UserusernamePutCode400Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/responses/UserusernamePutCode404Response.java b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/responses/UserusernamePutCode404Response.java new file mode 100644 index 00000000000..c050f90e377 --- /dev/null +++ b/samples/client/petstore/java/src/main/java/org/openapijsonschematools/client/paths/userusername/put/responses/UserusernamePutCode404Response.java @@ -0,0 +1,45 @@ +package org.openapijsonschematools.client.paths.userusername.put.responses; + +import org.openapijsonschematools.client.configurations.SchemaConfiguration; +import org.openapijsonschematools.client.response.ResponseDeserializer; +import org.openapijsonschematools.client.response.DeserializedHttpResponse; +import org.openapijsonschematools.client.exceptions.ApiException; +import org.openapijsonschematools.client.exceptions.ValidationException; +import org.openapijsonschematools.client.exceptions.NotImplementedException; +import org.openapijsonschematools.client.schemas.validation.MapUtils; + +import java.util.Map; +import java.net.http.HttpResponse; +import java.net.http.HttpHeaders; + +public class UserusernamePutCode404Response { + + public static class UserusernamePutCode404Response1 extends ResponseDeserializer { + public UserusernamePutCode404Response1() { + super( + MapUtils.makeMap( + ) + ); + } + + @Override + protected Void getBody(String contentType, Void mediaType, byte[] body, SchemaConfiguration configuration) { + return null; + } + + @Override + protected Void getHeaders(HttpHeaders headers, SchemaConfiguration configuration) { + return null; + } + } + + @SuppressWarnings("serial") + public static class ResponseApiException extends ApiException { + public DeserializedHttpResponse deserializedResponse; + + public ResponseApiException(String s, HttpResponse response, DeserializedHttpResponse deserializedResponse) { + super(s, response); + this.deserializedResponse = deserializedResponse; + } + } +} diff --git a/src/main/java/org/openapijsonschematools/codegen/generatorrunner/DefaultGeneratorRunner.java b/src/main/java/org/openapijsonschematools/codegen/generatorrunner/DefaultGeneratorRunner.java index 852cc36ba23..c247194e6ae 100644 --- a/src/main/java/org/openapijsonschematools/codegen/generatorrunner/DefaultGeneratorRunner.java +++ b/src/main/java/org/openapijsonschematools/codegen/generatorrunner/DefaultGeneratorRunner.java @@ -1124,6 +1124,7 @@ void generateApis(List files, TreeMap paths) } String jsonPath = "#/apis"; Map apiPathsTemplates = generator.jsonPathTemplateFiles().get(CodegenConstants.JSON_PATH_LOCATION_TYPE.API_PATHS); + // paths api file(s) if (apiPathsTemplates != null) { for (Map.Entry apiPathEntry: apiPathsTemplates.entrySet()) { String templateFile = apiPathEntry.getKey(); @@ -1140,6 +1141,8 @@ void generateApis(List files, TreeMap paths) LinkedHashMap>> tagToPathToOperations = new LinkedHashMap<>(); HashMap>> tagToOperationIdToPathToOperation = new HashMap<>(); Map apiPathTemplates = generator.jsonPathTemplateFiles().get(CodegenConstants.JSON_PATH_LOCATION_TYPE.API_PATH); + Map apiDocPathTemplates = generator.jsonPathDocTemplateFiles().get(CodegenConstants.JSON_PATH_LOCATION_TYPE.API_PATH); + // path apis for(Map.Entry entry: paths.entrySet()) { CodegenKey path = entry.getKey(); CodegenPathItem pathItem = entry.getValue(); @@ -1159,6 +1162,26 @@ void generateApis(List files, TreeMap paths) } } + // path api docs + if (generateApiDocumentation && apiDocPathTemplates != null) { + for (Map.Entry apiPathEntry: apiDocPathTemplates.entrySet()) { + String templateFile = apiPathEntry.getKey(); + String fileName = apiPathEntry.getValue(); + String thisJsonPath = jsonPath + "/paths/" + ModelUtils.encodeSlashes(path.original); + String outputFile = generator.getDocsFilepath(thisJsonPath) + fileName; + Map apiData = new HashMap<>(); + String packageName = generator.packageName(); + apiData.put("packageName", packageName); + apiData.put("path", path); + apiData.put("pathItem", pathItem); + apiData.put("docRoot", "../../"); + apiData.put("headerSize", "#"); + generateFile(apiData, templateFile, outputFile, files, true, CodegenConstants.APIS); + } + } + + + // store operations by tag + path for(CodegenOperation op: pathItem.operations.values()) { for(CodegenTag tag: op.tags.values()) { @@ -1197,11 +1220,11 @@ void generateApis(List files, TreeMap paths) apiData.put("tagToPathToOperations", tagToPathToOperations); apiData.put("paths", paths); String outputFile = generator.getFilepath(jsonPath) + fileName; - generateFile(apiData, templateFile, outputFile, files, true, CodegenConstants.APIS); } } + // tags file(s) Map apiTagsTemplates = generator.jsonPathTemplateFiles().get(CodegenConstants.JSON_PATH_LOCATION_TYPE.API_TAGS); if (apiTagsTemplates != null) { for (Map.Entry apiPathEntry: apiTagsTemplates.entrySet()) { @@ -1221,13 +1244,20 @@ void generateApis(List files, TreeMap paths) for(Map.Entry>> entry: tagToPathToOperations.entrySet()) { CodegenTag tag = entry.getKey(); HashMap> pathToOperations = entry.getValue(); + ArrayList operations = new ArrayList<>(); + for (Map.Entry> pathtoOps: pathToOperations.entrySet()) { + operations.addAll(pathtoOps.getValue()); + } Map apiData = new HashMap<>(); String packageName = generator.packageName(); apiData.put("packageName", packageName); apiData.put("tag", tag); apiData.put("pathToOperations", pathToOperations); + apiData.put("operations", operations); apiData.put("apiPackage", generator.apiPackage()); + apiData.put("docRoot", "../../"); + apiData.put("headerSize", "#"); class OperationIdComparator implements Comparator{ @Override @@ -1240,6 +1270,7 @@ public int compare(CodegenKey e1, CodegenKey e2) { operationIdToPathToOperation.putAll(tagToOperationIdToPathToOperation.get(tag)); apiData.put("operationIdToPathToOperation", operationIdToPathToOperation); + // tag apis if (apiTagTemplates != null) { for (Map.Entry apiPathEntry: apiTagTemplates.entrySet()) { String templateFile = apiPathEntry.getKey(); @@ -1249,7 +1280,7 @@ public int compare(CodegenKey e1, CodegenKey e2) { generateFile(apiData, templateFile, outputFile, files, true, CodegenConstants.APIS); } } - // api docs + // tag api docs if (generateApiDocumentation && apiDocTagTemplates != null) { for (Map.Entry apiPathEntry: apiDocTagTemplates.entrySet()) { String templateFile = apiPathEntry.getKey(); diff --git a/src/main/java/org/openapijsonschematools/codegen/generators/DefaultGenerator.java b/src/main/java/org/openapijsonschematools/codegen/generators/DefaultGenerator.java index abeb8df0cc2..7675fd071f8 100644 --- a/src/main/java/org/openapijsonschematools/codegen/generators/DefaultGenerator.java +++ b/src/main/java/org/openapijsonschematools/codegen/generators/DefaultGenerator.java @@ -54,6 +54,7 @@ import org.openapijsonschematools.codegen.generators.openapimodels.CodegenEncoding; import org.openapijsonschematools.codegen.generators.openapimodels.CodegenHeader; import org.openapijsonschematools.codegen.generators.openapimodels.CodegenKey; +import org.openapijsonschematools.codegen.generators.openapimodels.CodegenKeyType; import org.openapijsonschematools.codegen.generators.openapimodels.CodegenMap; import org.openapijsonschematools.codegen.generators.openapimodels.CodegenMediaType; import org.openapijsonschematools.codegen.generators.openapimodels.CodegenOauthFlow; @@ -156,6 +157,7 @@ public class DefaultGenerator implements Generator { protected String templateEngineName; protected String headersSchemaFragment = "Headers"; protected static final Set operationVerbs = Set.of("get", "put", "post", "delete", "options", "head", "patch", "trace"); + protected Set xParameters = Set.of("PathParameters", "QueryParameters", "HeaderParameters", "CookieParameters"); static { DefaultFeatureSet = FeatureSet.newBuilder() @@ -738,7 +740,8 @@ public HashMap public String toResponseModuleName(String componentName, String jsonPath) { return toModuleFilename(componentName, jsonPath); } - public String getPascalCaseResponse(String componentName, String jsonPath) { return toModelName(componentName, null); } + @Deprecated + public String getPascalCaseResponse(String componentName, String jsonPath) { return getPascalCase(CodegenKeyType.RESPONSE, componentName, jsonPath); } public String toHeaderFilename(String componentName, String jsonPath) { return toModuleFilename(componentName, jsonPath); } @@ -953,13 +956,15 @@ public String toSecurityFilename(String basename, String jsonPath) { return toModuleFilename(basename, jsonPath); } + @Deprecated @Override public String getPascalCaseServer(String basename, String jsonPath) { - return "Server" + basename; + return getPascalCase(CodegenKeyType.SERVER, basename, jsonPath); } + @Deprecated public String getPascalCaseParameter(String basename, String jsonPath) { - return toModelName(basename, null); + return getPascalCase(CodegenKeyType.PARAMETER, basename, null); } /** @@ -2619,13 +2624,14 @@ protected CodegenKey getOperationId(Operation operation, String path, String htt } String pascalCaseName = toModelName(operationId, null); String kebabCase = pascalCaseName.toLowerCase(Locale.ROOT); + String camelCase = camelize(pascalCaseName, true); return new CodegenKey( operationId, isValid(operationId), getOperationIdSnakeCase(operationId), pascalCaseName, kebabCase, - null + camelCase ); } @@ -2893,7 +2899,7 @@ public CodegenOperation fromOperation(Operation operation, String jsonPath, Link if (wildcardCodeResponses != null) { wildcardCodeResponses = new TreeMap<>(wildcardCodeResponses); } - CodegenKey responsesJsonPathPiece = getKey("responses", "misc", responsesJsonPath); + CodegenKey responsesJsonPathPiece = getKey("responses", "responses", responsesJsonPath); responses = new CodegenMap<>(responsesMap, responsesJsonPathPiece, getSubpackage(responsesJsonPath), getPathFromDocRoot(responsesJsonPath)); } @@ -2950,42 +2956,46 @@ public CodegenOperation fromOperation(Operation operation, String jsonPath, Link } CodegenList security = fromSecurity(operation.getSecurity(), jsonPath + "/security"); ExternalDocumentation externalDocs = operation.getExternalDocs(); - CodegenKey jsonPathPiece = getKey(pathPieces[pathPieces.length-1], "verb"); + CodegenKey jsonPathPiece = getKey(pathPieces[pathPieces.length-1], "verb", jsonPath); CodegenList usedServers = (servers != null) ? servers : rootOrPathServers; CodegenList usedSecurity = (security != null) ? security : rootSecurity; List> builders = getOperationBuilders(jsonPath, requestBody, parametersInfo, usedServers, usedSecurity); + CodegenKey method = getKey(pathPieces[pathPieces.length-1], "misc", jsonPath); String subpackage = getSubpackage(jsonPath); + String pathFromDocRoot = getPathFromDocRoot(jsonPath); return new CodegenOperation( - deprecated, - nonErrorStatusCodes, - nonErrorWildcardStatusCodes, - errorStatusCodes, - errorWildcardStatusCodes, - summary, - description, - produces, - usedServers, - requestBody, - parametersInfo, - hasRequiredParamOrBody, - hasOptionalParamOrBody, - usedSecurity, - tags, - responses, - statusCodeResponses, - wildcardCodeResponses, - nonDefaultResponses, - defaultResponse, - callbacks, - externalDocs, - vendorExtensions, - operationId, - jsonPathPiece, - requestBodySchema, - builders, - subpackage - ); + deprecated, + nonErrorStatusCodes, + nonErrorWildcardStatusCodes, + errorStatusCodes, + errorWildcardStatusCodes, + summary, + description, + produces, + usedServers, + requestBody, + parametersInfo, + hasRequiredParamOrBody, + hasOptionalParamOrBody, + usedSecurity, + tags, + responses, + statusCodeResponses, + wildcardCodeResponses, + nonDefaultResponses, + defaultResponse, + callbacks, + externalDocs, + vendorExtensions, + operationId, + jsonPathPiece, + method, + requestBodySchema, + builders, + subpackage, + pathFromDocRoot + ); } protected List> getOperationBuilders(String jsonPath, CodegenRequestBody requestBody, CodegenParametersInfo parametersInfo, CodegenList servers, CodegenList security) { @@ -3042,7 +3052,6 @@ public CodegenList fromSecurity(List keyToQty = sourceJsonPathToKeyToQty.getOrDefault(jsonPath, new HashMap<>()); + if (!sourceJsonPathToKeyToQty.containsKey(jsonPath)) { + sourceJsonPathToKeyToQty.put(jsonPath, keyToQty); + } + // starts with number + if (usedKey.matches("^\\d.*")) { + LOGGER.warn("{} (component name starts with number) cannot be used as name. Renamed to Schema{}", usedKey, usedKey); + usedKey = "Schema" + usedKey; // 200 -> Schema200 + } + + usedKey = camelize(usedKey); + + // handle case where usedKey is empty + if (usedKey.isEmpty()) { + // happens with a name like "/" + usedKey = camelize(toEnumVarName(lastJsonPathFragment, null).toLowerCase(Locale.ROOT)); + } + + if (isReservedWord(usedKey)) { + usedKey = usedKey + "Schema"; // e.g. return => ReturnSchema + LOGGER.warn("{} (reserved word) cannot be used as name. Renamed to {}", lastJsonPathFragment, usedKey); + } + + Integer qty = keyToQty.getOrDefault(usedKey, 0); + qty += 1; + keyToQty.put(usedKey, qty); + String suffix = ""; + if (qty > 1) { + suffix = qty.toString(); + } + usedKey = usedKey + suffix; + return usedKey; + case PATH: + return camelize(toPathFilename(lastJsonPathFragment, jsonPath)); + case PARAMETER: + case RESPONSE: + return toModelName(lastJsonPathFragment, null); + case MISC: + case OPERATION: + case REQUEST_BODY: + case HEADER: + case SECURITY_SCHEME: + return toModelName(lastJsonPathFragment, jsonPath); + case SERVER: + return "Server" + lastJsonPathFragment; + case SECURITY: + return toSecurityFilename(lastJsonPathFragment, jsonPath); + default: + return null; + } + } @Override @SuppressWarnings("static-method") @@ -3893,11 +3958,6 @@ private void updatePathsFilepath(String[] pathPieces) { if (pathPieces.length < 4) { return; } - Set xParameters = new HashSet<>(); - xParameters.add("PathParameters"); - xParameters.add("QueryParameters"); - xParameters.add("HeaderParameters"); - xParameters.add("CookieParameters"); if (pathPieces[3].equals("servers")) { if (pathPieces.length == 4) { // #/paths/somePath/servers @@ -4884,41 +4944,10 @@ public CodegenKey getKey(String key, String keyType) { return getKey(key, keyType, null); } + @Deprecated @Override public String getSchemaPascalCaseName(String name, @NotNull String sourceJsonPath) { - String usedKey = escapeUnsafeCharacters(name); - HashMap keyToQty = sourceJsonPathToKeyToQty.getOrDefault(sourceJsonPath, new HashMap<>()); - if (!sourceJsonPathToKeyToQty.containsKey(sourceJsonPath)) { - sourceJsonPathToKeyToQty.put(sourceJsonPath, keyToQty); - } - // starts with number - if (usedKey.matches("^\\d.*")) { - LOGGER.warn("{} (component name starts with number) cannot be used as name. Renamed to Schema{}", usedKey, usedKey); - usedKey = "Schema" + usedKey; // 200 -> Schema200 - } - - usedKey = camelize(usedKey); - - // handle case where usedKey is empty - if (usedKey.isEmpty()) { - // happens with a name like "/" - usedKey = camelize(toEnumVarName(name, null).toLowerCase(Locale.ROOT)); - } - - if (isReservedWord(usedKey)) { - usedKey = usedKey + "Schema"; // e.g. return => ReturnSchema - LOGGER.warn("{} (reserved word) cannot be used as name. Renamed to {}", name, usedKey); - } - - Integer qty = keyToQty.getOrDefault(usedKey, 0); - qty += 1; - keyToQty.put(usedKey, qty); - String suffix = ""; - if (qty > 1) { - suffix = qty.toString(); - } - usedKey = usedKey + suffix; - return usedKey; + return getPascalCase(CodegenKeyType.SCHEMA, name, sourceJsonPath); } protected String getCamelCaseName(String key) { @@ -4940,59 +4969,64 @@ public CodegenKey getKey(String key, String keyType, String sourceJsonPath) { usedKey = escapeUnsafeCharacters(key); isValid = isValid(usedKey); snakeCaseName = toModelFilename(usedKey, sourceJsonPath); - pascalCaseName = getSchemaPascalCaseName(key, sourceJsonPath); + pascalCaseName = getPascalCase(CodegenKeyType.SCHEMA, key, sourceJsonPath); camelCaseName = getCamelCaseName(usedKey); break; case "paths": usedKey = escapeUnsafeCharacters(key); isValid = isValid(usedKey); snakeCaseName = toPathFilename(usedKey, sourceJsonPath); - pascalCaseName = camelize(toPathFilename(usedKey, sourceJsonPath)); + pascalCaseName = getPascalCase(CodegenKeyType.PATH, usedKey, sourceJsonPath); break; case "misc": + usedKey = escapeUnsafeCharacters(key); + isValid = isValid(usedKey); + snakeCaseName = toModelFilename(usedKey, sourceJsonPath); + camelCaseName = camelize(usedKey, true); + pascalCaseName = getPascalCase(CodegenKeyType.MISC, usedKey, sourceJsonPath); + break; case "verb": usedKey = escapeUnsafeCharacters(key); isValid = isValid(usedKey); snakeCaseName = toModelFilename(usedKey, sourceJsonPath); camelCaseName = camelize(usedKey, true); - pascalCaseName = toModelName(usedKey, sourceJsonPath); + pascalCaseName = getPascalCase(CodegenKeyType.OPERATION, usedKey, sourceJsonPath); break; case "parameters": usedKey = escapeUnsafeCharacters(key); isValid = isValid(usedKey); snakeCaseName = toParameterFilename(usedKey, sourceJsonPath); - pascalCaseName = getPascalCaseParameter(usedKey, sourceJsonPath); + pascalCaseName = getPascalCase(CodegenKeyType.PARAMETER, usedKey, sourceJsonPath); break; case "requestBodies": usedKey = escapeUnsafeCharacters(key); isValid = isValid(usedKey); snakeCaseName = toRequestBodyFilename(usedKey, sourceJsonPath); - // todo add getPascalCaseRequestBody() - pascalCaseName = toModelName(usedKey, sourceJsonPath); + pascalCaseName = getPascalCase(CodegenKeyType.REQUEST_BODY, usedKey, sourceJsonPath); break; case "headers": usedKey = escapeUnsafeCharacters(key); isValid = isValid(usedKey); snakeCaseName = toHeaderFilename(usedKey, sourceJsonPath); - pascalCaseName = toModelName(usedKey, sourceJsonPath); + pascalCaseName = getPascalCase(CodegenKeyType.HEADER, usedKey, sourceJsonPath); break; case "responses": usedKey = escapeUnsafeCharacters(key); isValid = isValid(usedKey); snakeCaseName = toResponseModuleName(usedKey, sourceJsonPath); - pascalCaseName = getPascalCaseResponse(usedKey, sourceJsonPath); + pascalCaseName = getPascalCase(CodegenKeyType.RESPONSE, usedKey, sourceJsonPath); break; case "securitySchemes": usedKey = escapeUnsafeCharacters(key); isValid = isValid(usedKey); snakeCaseName = toSecuritySchemeFilename(usedKey, sourceJsonPath); - pascalCaseName = toModelName(usedKey, sourceJsonPath); + pascalCaseName = getPascalCase(CodegenKeyType.SECURITY_SCHEME, usedKey, sourceJsonPath); break; case "servers": usedKey = escapeUnsafeCharacters(key); isValid = isValid(usedKey); snakeCaseName = toServerFilename(usedKey, sourceJsonPath); - pascalCaseName = getPascalCaseServer(usedKey, sourceJsonPath); + pascalCaseName = getPascalCase(CodegenKeyType.SERVER, usedKey, sourceJsonPath); camelCaseName = camelize(pascalCaseName, true); break; case "security": @@ -5001,7 +5035,7 @@ public CodegenKey getKey(String key, String keyType, String sourceJsonPath) { usedKey = escapeUnsafeCharacters(key); isValid = isValid(usedKey); snakeCaseName = toSecuritySnakeCase(key, sourceJsonPath); - pascalCaseName = toSecurityPascalCase(key, sourceJsonPath); + pascalCaseName = getPascalCase(CodegenKeyType.SECURITY, usedKey, sourceJsonPath); camelCaseName = camelize(pascalCaseName, true); break; } @@ -5018,8 +5052,9 @@ public CodegenKey getKey(String key, String keyType, String sourceJsonPath) { ); } + @Deprecated protected String toSecurityPascalCase(String basename, String jsonPath) { - return toSecurityFilename(basename, jsonPath); + return getPascalCase(CodegenKeyType.SECURITY, basename, jsonPath); } protected String toSecuritySnakeCase(String basename, String jsonPath) { @@ -5210,10 +5245,11 @@ public CodegenPathItem fromPathItem(PathItem pathItem, String jsonPath, CodegenL for (Pair pair: httpMethodOperationPairs) { Operation specOperation = pair.getRight(); String httpMethod = pair.getLeft(); + String operationJsonPath = jsonPath + "/" + httpMethod; if (specOperation != null) { - operations.put(getKey( - httpMethod, "verb"), - fromOperation(specOperation, jsonPath + "/" + httpMethod, pairToParameter, usedServers, rootSecurity) + operations.put( + getKey(httpMethod, "verb", operationJsonPath), + fromOperation(specOperation, operationJsonPath, pairToParameter, usedServers, rootSecurity) ); } } @@ -5271,7 +5307,6 @@ public CodegenList fromServers(List servers, String jsonP codegenServers, jsonPathPiece, serversSubpackage, - null, operationInputClass, operationInputVariableName, pathFromDocRoot diff --git a/src/main/java/org/openapijsonschematools/codegen/generators/Generator.java b/src/main/java/org/openapijsonschematools/codegen/generators/Generator.java index 80940aae674..1199f68c26b 100644 --- a/src/main/java/org/openapijsonschematools/codegen/generators/Generator.java +++ b/src/main/java/org/openapijsonschematools/codegen/generators/Generator.java @@ -36,6 +36,7 @@ import org.openapijsonschematools.codegen.generators.generatormetadata.GeneratorLanguage; import org.openapijsonschematools.codegen.generators.generatormetadata.GeneratorType; import org.openapijsonschematools.codegen.generators.models.VendorExtension; +import org.openapijsonschematools.codegen.generators.openapimodels.CodegenKeyType; import org.openapijsonschematools.codegen.generators.openapimodels.CodegenRefInfo; import org.openapijsonschematools.codegen.generators.openapimodels.CodegenSecurityRequirementObject; import org.openapijsonschematools.codegen.generators.openapimodels.CodegenList; @@ -107,6 +108,7 @@ public interface Generator { String getSchemaFilename(String jsonPath); + @Deprecated String getSchemaPascalCaseName(String name, @NotNull String sourceJsonPath); Set getImports(String sourceJsonPath, CodegenSchema schema, FeatureSet featureSet); String toContentTypeFilename(String name); @@ -201,6 +203,7 @@ public interface Generator { String toSecurityFilename(String baseName, String jsonPath); + @Deprecated String getPascalCaseServer(String baseName, String jsonPath); String toModelImport(String refClass); @@ -305,4 +308,6 @@ public interface Generator { boolean generateSeparateServerSchemas(); boolean shouldGenerateFile(String jsonPath, boolean isDoc); + + String getPascalCase(CodegenKeyType type, String lastJsonPathFragment, String jsonPath); } diff --git a/src/main/java/org/openapijsonschematools/codegen/generators/JavaClientGenerator.java b/src/main/java/org/openapijsonschematools/codegen/generators/JavaClientGenerator.java index 40c987b5364..15123eb8899 100644 --- a/src/main/java/org/openapijsonschematools/codegen/generators/JavaClientGenerator.java +++ b/src/main/java/org/openapijsonschematools/codegen/generators/JavaClientGenerator.java @@ -41,6 +41,7 @@ import org.openapijsonschematools.codegen.generators.models.CliOption; import org.openapijsonschematools.codegen.generators.openapimodels.CodegenHeader; import org.openapijsonschematools.codegen.generators.openapimodels.CodegenKey; +import org.openapijsonschematools.codegen.generators.openapimodels.CodegenKeyType; import org.openapijsonschematools.codegen.generators.openapimodels.CodegenList; import org.openapijsonschematools.codegen.generators.openapimodels.CodegenParameter; import org.openapijsonschematools.codegen.generators.openapimodels.CodegenParametersInfo; @@ -146,39 +147,10 @@ protected void updateServersFilepath(String[] pathPieces) { } } + @Deprecated @Override public String getPascalCaseServer(String basename, String jsonPath) { - if (jsonPath != null) { - String[] pathPieces = jsonPath.split("/"); - if (jsonPath.startsWith("#/servers")) { - if (pathPieces.length == 2) { - // #/servers - return "RootServerInfo"; - } else { - // #/servers/0 - return "Server"+pathPieces[2]; - } - } else if (jsonPath.startsWith("#/paths") && pathPieces.length >= 4 && pathPieces[3].equals("servers")) { - CodegenKey pathKey = getKey(ModelUtils.decodeSlashes(pathPieces[2]), "paths", jsonPath); - if (pathPieces.length == 4) { - // #/paths/somePath/servers - return pathKey.pascalCase + "ServerInfo"; - } else { - // #/paths/somePath/servers/0 - return pathKey.pascalCase + "Server"+ pathPieces[4]; - } - } else if (jsonPath.startsWith("#/paths") && pathPieces.length >= 5 && pathPieces[4].equals("servers")) { - CodegenKey pathKey = getKey(ModelUtils.decodeSlashes(pathPieces[2]), "paths", jsonPath); - if (pathPieces.length == 5) { - // #/paths/somePath/get/servers - return pathKey.pascalCase + StringUtils.capitalize(pathPieces[3]) + "ServerInfo"; - } else { - // #/paths/somePath/get/servers/0 - return pathKey.pascalCase + StringUtils.capitalize(pathPieces[3]) + "Server" + pathPieces[5]; - } - } - } - return "Server" + basename; + return getPascalCase(CodegenKeyType.SERVER, basename, jsonPath); } @Override @@ -1034,13 +1006,31 @@ public void processOpts() { put("src/main/java/packagename/paths/path/PathItem.hbs", ".java"); }} ); - // path apis + // apis jsonPathTemplateFiles.put( CodegenConstants.JSON_PATH_LOCATION_TYPE.API_PATH, new HashMap<>() {{ put("src/main/java/packagename/apis/paths/Api.hbs", ".java"); }} ); + jsonPathDocTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.API_PATH, + new HashMap<>() {{ + put("src/main/java/packagename/apis/paths/ApiDoc.hbs", ".md"); + }} + ); + jsonPathTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.API_TAG, + new HashMap<>() {{ + put("src/main/java/packagename/apis/tags/Api.hbs", ".java"); + }} + ); + jsonPathDocTemplateFiles.put( + CodegenConstants.JSON_PATH_LOCATION_TYPE.API_TAG, + new HashMap<>() {{ + put("src/main/java/packagename/apis/tags/ApiDoc.hbs", ".md"); + }} + ); // schema HashMap schemaTemplates = new HashMap<>(); @@ -1126,7 +1116,8 @@ public String toRequestBodyFilename(String componentName, String jsonPath) { } if (pathPieces.length == 5) { // #/paths/somePath/verb/requestBody - return toModelName(componentName, null); + String pathClassName = getPathClassNamePrefix(jsonPath); + return pathClassName + "RequestBody"; } return toModuleFilename(componentName, null); } @@ -1162,12 +1153,9 @@ public String toHeaderFilename(String componentName, String jsonPath) { return toModuleFilename(componentName, jsonPath); } + @Deprecated public String getPascalCaseResponse(String componentName, String jsonPath) { - if (jsonPath.startsWith("#/components/responses/")) { - return toModelName(componentName, null); - } else { - return toModelName("Code"+componentName+"Response", null); - } + return getPascalCase(CodegenKeyType.RESPONSE, componentName, jsonPath); } @Override @@ -1180,13 +1168,14 @@ public String toResponseModuleName(String componentName, String jsonPath) { } return toModuleFilename(componentName, jsonPath); } + String prefix = getPathClassNamePrefix(jsonPath); switch (pathPieces.length) { case 5: // #/paths/somePath/verb/responses - return "Responses"; + return prefix + "Responses"; case 6: // #/paths/somePath/verb/responses/200 - return toModelName("Code"+componentName+"Response", null); + return prefix + "Code"+ componentName + "Response"; default: return toModuleFilename("code"+componentName+"response", null); } @@ -1206,9 +1195,10 @@ protected boolean isValid(String name) { return name.matches("^[a-zA-Z]\\w*$"); } + @Deprecated @Override public String getSchemaPascalCaseName(String name, @NotNull String sourceJsonPath) { - return getSchemaPascalCaseName(name, sourceJsonPath, true); + return getPascalCase(CodegenKeyType.SCHEMA, name, sourceJsonPath); } protected String getCamelCaseName(String key) { @@ -1365,7 +1355,12 @@ public String getSchemaFilename(String jsonPath) { String modelName = schemaJsonPathToModelName.get(jsonPath); if (modelName == null) { String[] pathPieces = jsonPath.split("/"); - return getSchemaPascalCaseName(pathPieces[pathPieces.length-1], jsonPath, false); + String lastFragment = pathPieces[pathPieces.length-1]; + if (jsonPath.startsWith("#/paths/") && xParameters.contains(lastFragment)) { + String prefix = getPathClassNamePrefix(jsonPath); + lastFragment = prefix + lastFragment; + } + return getSchemaPascalCaseName(lastFragment, jsonPath, false); } return modelName; } @@ -1398,11 +1393,10 @@ private static boolean isInteger(String str) { return true; } + @Deprecated @Override public String getPascalCaseParameter(String basename, String jsonPath) { - - return toParameterFilename(basename, jsonPath); - + return getPascalCase(CodegenKeyType.PARAMETER, basename, jsonPath); } public String toPathFilename(String name, String jsonPath) { @@ -2606,9 +2600,101 @@ protected List> getOperationBuilders(String jsonPath, CodegenReque return builders; } + private String getPathClassNamePrefix(String jsonPath) { + // #/paths/somePath/get -> SomepathGet + String[] pathPieces = jsonPath.split("/"); + String pathJsonPath = "#/paths/"+pathPieces[2]; + String pathClassName = toPathFilename(ModelUtils.decodeSlashes(pathPieces[2]), pathJsonPath); + return pathClassName + StringUtils.capitalize(pathPieces[3]); + } + @Override public String toOperationFilename(String name, String jsonPath) { - return StringUtils.capitalize(name); + String[] pathPieces = jsonPath.split("/"); + String pathJsonPath = "#/paths/"+pathPieces[2]; + String pathClassName = toPathFilename(ModelUtils.decodeSlashes(pathPieces[2]), pathJsonPath); + String operationFileName = pathClassName + StringUtils.capitalize(name); + return operationFileName; + } + + @Override + public String getPascalCase(CodegenKeyType type, String lastJsonPathFragment, String jsonPath) { + switch (type) { + case SCHEMA: + if (jsonPath != null) { + String[] pathPieces = jsonPath.split("/"); + String lastFragment = pathPieces[pathPieces.length-1]; + if (jsonPath.startsWith("#/paths/") && xParameters.contains(lastFragment)) { + String prefix = getPathClassNamePrefix(jsonPath); + lastJsonPathFragment = prefix + lastJsonPathFragment; + } + } + return getSchemaPascalCaseName(lastJsonPathFragment, jsonPath, true); + case PATH: + return camelize(toPathFilename(lastJsonPathFragment, jsonPath)); + case REQUEST_BODY: + if (jsonPath.startsWith("#/paths")) { + String prefix = getPathClassNamePrefix(jsonPath); + return prefix + "RequestBody"; + } + return toModelName(lastJsonPathFragment, jsonPath); + case MISC: + case HEADER: + case SECURITY_SCHEME: + return toModelName(lastJsonPathFragment, jsonPath); + case OPERATION: + return toOperationFilename(lastJsonPathFragment, jsonPath); + case PARAMETER: + return toParameterFilename(lastJsonPathFragment, jsonPath); + case RESPONSE: + if (jsonPath.startsWith("#/components/responses/")) { + return toModelName(lastJsonPathFragment, null); + } else { + String prefix = getPathClassNamePrefix(jsonPath); + if (jsonPath.endsWith("/responses")) { + // #/paths/somePath/get/responses + return prefix + "Responses"; + } + // #/paths/somePath/get/responses/200 + return prefix + "Code" + lastJsonPathFragment + "Response"; + } + case SERVER: + if (jsonPath != null) { + String[] pathPieces = jsonPath.split("/"); + if (jsonPath.startsWith("#/servers")) { + if (pathPieces.length == 2) { + // #/servers + return "RootServerInfo"; + } else { + // #/servers/0 + return "Server"+pathPieces[2]; + } + } else if (jsonPath.startsWith("#/paths") && pathPieces.length >= 4 && pathPieces[3].equals("servers")) { + CodegenKey pathKey = getKey(ModelUtils.decodeSlashes(pathPieces[2]), "paths", jsonPath); + if (pathPieces.length == 4) { + // #/paths/somePath/servers + return pathKey.pascalCase + "ServerInfo"; + } else { + // #/paths/somePath/servers/0 + return pathKey.pascalCase + "Server"+ pathPieces[4]; + } + } else if (jsonPath.startsWith("#/paths") && pathPieces.length >= 5 && pathPieces[4].equals("servers")) { + String prefix = getPathClassNamePrefix(jsonPath); + if (pathPieces.length == 5) { + // #/paths/somePath/get/servers + return prefix + "ServerInfo"; + } else { + // #/paths/somePath/get/servers/0 + return prefix + "Server" + pathPieces[5]; + } + } + } + return "Server" + lastJsonPathFragment; + case SECURITY: + return toSecurityFilename(lastJsonPathFragment, jsonPath); + default: + return null; + } } protected List> getMapBuilders(CodegenSchema schema, String currentJsonPath, String sourceJsonPath) { @@ -3148,12 +3234,12 @@ public String toSecurityFilename(String basename, String jsonPath) { return "SecurityRequirementObject"+pathPieces[pathPieces.length-1]; } else if (pathPieces.length == 5) { // #/paths/somePath/verb/security - CodegenKey pathKey = getKey(ModelUtils.decodeSlashes(pathPieces[2]), "paths", jsonPath); - return pathKey.pascalCase + StringUtils.capitalize(pathPieces[3]) + "SecurityInfo"; + String prefix = getPathClassNamePrefix(jsonPath); + return prefix + "SecurityInfo"; } else if (pathPieces.length == 6) { // #/paths/somePath/verb/security/0 - CodegenKey pathKey = getKey(ModelUtils.decodeSlashes(pathPieces[2]), "paths", jsonPath); - return pathKey.pascalCase + StringUtils.capitalize(pathPieces[3]) + "SecurityRequirementObject"+pathPieces[pathPieces.length-1]; + String prefix = getPathClassNamePrefix(jsonPath); + return prefix + "SecurityRequirementObject"+pathPieces[pathPieces.length-1]; } return null; } @@ -3461,6 +3547,26 @@ public boolean shouldGenerateFile(String jsonPath, boolean isDoc) { return true; } + @Override + public String toApiFilename(String name) { + return toApiName(name); + } + + @Override + public String toApiName(String name) { + if (name.isEmpty()) { + return "DefaultApi"; + } + String usedName = sanitizeName(name, "[^a-zA-Z0-9]+"); + // todo check if empty and if so them use enum name + // todo fix this, this does not handle names starting with numbers + if (usedName.isEmpty()) { + usedName = toEnumVarName(name, null).toLowerCase(Locale.ROOT); + } + usedName = camelize(usedName, false); + return usedName; + } + protected String responsePathFromDocRoot(String sourceJsonPath) { return getPathFromDocRoot(sourceJsonPath); } diff --git a/src/main/java/org/openapijsonschematools/codegen/generators/PythonClientGenerator.java b/src/main/java/org/openapijsonschematools/codegen/generators/PythonClientGenerator.java index a44d13ef2a7..9cf163d032b 100644 --- a/src/main/java/org/openapijsonschematools/codegen/generators/PythonClientGenerator.java +++ b/src/main/java/org/openapijsonschematools/codegen/generators/PythonClientGenerator.java @@ -33,6 +33,7 @@ import org.openapijsonschematools.codegen.generators.generatormetadata.features.OperationFeature; import org.openapijsonschematools.codegen.generators.generatormetadata.features.SchemaFeature; import org.openapijsonschematools.codegen.generators.openapimodels.CodegenDiscriminator; +import org.openapijsonschematools.codegen.generators.openapimodels.CodegenKeyType; import org.openapijsonschematools.codegen.generators.openapimodels.CodegenPatternInfo; import org.openapijsonschematools.codegen.generators.openapimodels.CodegenSchema; import org.openapijsonschematools.codegen.templating.SupportingFile; @@ -826,8 +827,9 @@ public String toModuleFilename(String name, String jsonPath) { return underscore(dropDots(toModelName(name, jsonPath))); } + @Deprecated protected String toSecurityPascalCase(String basename, String jsonPath) { - return "Security"; + return getPascalCase(CodegenKeyType.SECURITY, basename, jsonPath); } @Override @@ -1901,24 +1903,15 @@ public String toSecurityFilename(String basename, String jsonPath) { return "security_requirement_object_" + basename; } + @Deprecated @Override public String getPascalCaseParameter(String name, String jsonPath) { - try { - Integer.parseInt(name); - // for parameters in path, or an endpoint - return "Parameter" + name; - } catch (NumberFormatException nfe) { - // for header parameters in responses - return toModelName(name, null); - } + return getPascalCase(CodegenKeyType.PARAMETER, name, jsonPath); } + @Deprecated public String getPascalCaseResponse(String name, String jsonPath) { - if (name.matches("^\\d[X\\d]{2}$")) { - // 200 or 2XX - return "ResponseFor" + name; - } - return toModelName(name, null); + return getPascalCase(CodegenKeyType.RESPONSE, name, jsonPath); } @Override @@ -2128,21 +2121,59 @@ public void postProcess() { LOGGER.info("################################################################################"); } + @Deprecated @Override public String getSchemaPascalCaseName(String name, @NotNull String sourceJsonPath) { - String usedKey = escapeUnsafeCharacters(name); - HashMap keyToQty = sourceJsonPathToKeyToQty.getOrDefault(sourceJsonPath, new HashMap<>()); - if (!sourceJsonPathToKeyToQty.containsKey(sourceJsonPath)) { - sourceJsonPathToKeyToQty.put(sourceJsonPath, keyToQty); - } - Integer qty = keyToQty.getOrDefault(usedKey.toLowerCase(Locale.ROOT), 0); - qty += 1; - keyToQty.put(usedKey.toLowerCase(Locale.ROOT), qty); - String suffix = ""; - if (qty > 1) { - suffix = qty.toString(); - } - return toModelName(usedKey + suffix, sourceJsonPath); + return getPascalCase(CodegenKeyType.SCHEMA, name, sourceJsonPath); + } + + @Override + public String getPascalCase(CodegenKeyType type, String lastJsonPathFragment, String jsonPath) { + switch (type) { + case SCHEMA: + String usedKey = escapeUnsafeCharacters(lastJsonPathFragment); + HashMap keyToQty = sourceJsonPathToKeyToQty.getOrDefault(jsonPath, new HashMap<>()); + if (!sourceJsonPathToKeyToQty.containsKey(jsonPath)) { + sourceJsonPathToKeyToQty.put(jsonPath, keyToQty); + } + Integer qty = keyToQty.getOrDefault(usedKey.toLowerCase(Locale.ROOT), 0); + qty += 1; + keyToQty.put(usedKey.toLowerCase(Locale.ROOT), qty); + String suffix = ""; + if (qty > 1) { + suffix = qty.toString(); + } + return toModelName(usedKey + suffix, jsonPath); + case PATH: + return camelize(toPathFilename(lastJsonPathFragment, jsonPath)); + case MISC: + case OPERATION: + case REQUEST_BODY: + case HEADER: + case SECURITY_SCHEME: + return toModelName(lastJsonPathFragment, jsonPath); + case PARAMETER: + try { + Integer.parseInt(lastJsonPathFragment); + // for parameters in path, or an endpoint + return "Parameter" + lastJsonPathFragment; + } catch (NumberFormatException nfe) { + // for header parameters in responses + return toModelName(lastJsonPathFragment, null); + } + case RESPONSE: + if (lastJsonPathFragment.matches("^\\d[X\\d]{2}$")) { + // 200 or 2XX + return "ResponseFor" + lastJsonPathFragment; + } + return toModelName(lastJsonPathFragment, null); + case SECURITY: + return "Security"; + case SERVER: + return "Server" + lastJsonPathFragment; + default: + return null; + } } @Override diff --git a/src/main/java/org/openapijsonschematools/codegen/generators/openapimodels/CodegenKeyType.java b/src/main/java/org/openapijsonschematools/codegen/generators/openapimodels/CodegenKeyType.java new file mode 100644 index 00000000000..b98c029544a --- /dev/null +++ b/src/main/java/org/openapijsonschematools/codegen/generators/openapimodels/CodegenKeyType.java @@ -0,0 +1,15 @@ +package org.openapijsonschematools.codegen.generators.openapimodels; + +public enum CodegenKeyType { + SCHEMA, + PATH, + MISC, // content-type, operation method + OPERATION, + PARAMETER, + REQUEST_BODY, + HEADER, + RESPONSE, + SECURITY_SCHEME, + SERVER, + SECURITY +} diff --git a/src/main/java/org/openapijsonschematools/codegen/generators/openapimodels/CodegenList.java b/src/main/java/org/openapijsonschematools/codegen/generators/openapimodels/CodegenList.java index c9ec28837f9..74ecc14182b 100644 --- a/src/main/java/org/openapijsonschematools/codegen/generators/openapimodels/CodegenList.java +++ b/src/main/java/org/openapijsonschematools/codegen/generators/openapimodels/CodegenList.java @@ -10,16 +10,14 @@ public class CodegenList extends AbstractList implements OperationInputPr public final List items; public final CodegenKey jsonPathPiece; public final String subpackage; - public final List> builders; public final CodegenKey operationInputClassName; public final String operationInputVariableName; public final String pathFromDocRoot; - public CodegenList(List items, CodegenKey jsonPathPiece, String subpackage, List> builders, CodegenKey operationInputClassName, String operationInputVariableName, String pathFromDocRoot) { + public CodegenList(List items, CodegenKey jsonPathPiece, String subpackage, CodegenKey operationInputClassName, String operationInputVariableName, String pathFromDocRoot) { this.items = items; this.jsonPathPiece = jsonPathPiece; this.subpackage = subpackage; - this.builders = builders; this.operationInputClassName = operationInputClassName; this.operationInputVariableName = operationInputVariableName; this.pathFromDocRoot = pathFromDocRoot; diff --git a/src/main/java/org/openapijsonschematools/codegen/generators/openapimodels/CodegenOperation.java b/src/main/java/org/openapijsonschematools/codegen/generators/openapimodels/CodegenOperation.java index a3510dd105b..bec0cd6daeb 100644 --- a/src/main/java/org/openapijsonschematools/codegen/generators/openapimodels/CodegenOperation.java +++ b/src/main/java/org/openapijsonschematools/codegen/generators/openapimodels/CodegenOperation.java @@ -21,7 +21,7 @@ import java.util.*; -public class CodegenOperation { +public class CodegenOperation implements PathFromDocRootProvider { public final Boolean deprecated; public final LinkedHashSet nonErrorStatusCodes; // values like 201 public final LinkedHashSet nonErrorWildcardStatusCodes; // values like 2 for @2XX @@ -50,8 +50,10 @@ public class CodegenOperation { public final Map vendorExtensions; public final CodegenKey operationId; public final CodegenKey jsonPathPiece; + public final CodegenKey method; public final List> builders; public final String subpackage; + public final String pathFromDocRoot; public CodegenOperation( Boolean deprecated, @@ -79,9 +81,11 @@ public CodegenOperation( Map vendorExtensions, CodegenKey operationId, CodegenKey jsonPathPiece, + CodegenKey method, CodegenSchema requestBodySchema, List> builders, - String subpackage + String subpackage, + String pathFromDocRoot ) { this.deprecated = deprecated; this.nonErrorStatusCodes = nonErrorStatusCodes; @@ -108,9 +112,11 @@ public CodegenOperation( this.vendorExtensions = vendorExtensions; this.operationId = operationId; this.jsonPathPiece = jsonPathPiece; + this.method = method; this.requestBodySchema = requestBodySchema; this.builders = builders; this.subpackage = subpackage; + this.pathFromDocRoot = pathFromDocRoot; TreeMap nonErrorResponsesMap = new TreeMap<>(); if (statusCodeResponses != null) { for (Map.Entry entry: statusCodeResponses.entrySet()) { @@ -316,4 +322,9 @@ public int hashCode() { vendorExtensions, statusCodeResponses, wildcardCodeResponses, nonDefaultResponses, jsonPathPiece); } + + @Override + public String pathFromDocRoot() { + return pathFromDocRoot; + } } diff --git a/src/main/resources/java/README.hbs b/src/main/resources/java/README.hbs index 928118161f5..bd07d6f6f5b 100644 --- a/src/main/resources/java/README.hbs +++ b/src/main/resources/java/README.hbs @@ -70,8 +70,8 @@ Here is the mapping from json schema types to Java types: | Json Schema Type | Java Base Class | | ---------------- | --------------- | -| object | FrozenMap (HashMap) | -| array | FrozenList (ArrayList) | +| object | FrozenMap (Map) | +| array | FrozenList (List) | | string | String | | number | Number (int, long, float, double) | | integer | int, long, float, double (with values equal to integers) | @@ -107,7 +107,7 @@ invalid Java variable names. Names like: - " " - "from" -To allow these use cases to work, FrozenMap (which extends HashMap) is used as the base class of type object schemas. +To allow these use cases to work, FrozenMap (which extends AbstractMap) is used as the base class of type object schemas. This means that one can use normal Map methods on instances of these classes.
@@ -123,8 +123,6 @@ This means that one can use normal Map methods on instances of these classes. N schemas can be validated on the same payload. To allow multiple schemas to validate, the data must be stored using one base class whether or not a json schema format constraint exists in the schema. -See the below accessors for string data: -- type string + format: See schemas.as_date, schemas.as_datetime, schemas.as_decimal, schemas.as_uuid In json schema, type: number with no format validates both integers and floats, so int and float values are stored for type number. @@ -142,7 +140,7 @@ For example the string payload '2023-12-20' is validates to both of these schema - type: string format: date ``` -Because of use cases like this, a datetime.date is allowed as an input to this schema, but the data +Because of use cases like this, a LocalDate is allowed as an input to this schema, but the data is stored as a string.
@@ -152,108 +150,114 @@ Please follow the [installation procedure](#installation) and then use the JsonS {{packageName}}.components.schemas to validate input payloads and instances of validated Map and List output classes. Json schemas allow multiple types for one schema, so a schema's validate method can have allowed input and output types. +{{#each paths}} + {{#if @first}} + {{#each operations}} + {{#if @first}} + {{#each tags}} + {{#if @first}} + +## Code Sample +{{> src/main/java/packagename/paths/path/verb/_OperationDocCodeSample this=../this apiSubpackage="apis.tags" apiContainerClass=className apiFullyQualifiedClass=className }} + {{/if}} + {{/each}} + {{/if}} + {{/each}} + {{/if}} +{{/each}} {{#if servers}} ## Servers | server_index | Class | Description | | ------------ | ----- | ----------- | -{{#each servers}} + {{#each servers}} | {{@key}} | [{{jsonPathPiece.pascalCase}}](docs/servers/{{jsonPathPiece.pascalCase}}.md) |{{#if description}} {{description.originalWithBr}}{{/if}} | -{{/each}} + {{/each}} {{/if}} -{{#if schemas}} - -## Component Schemas +{{#if securitySchemes}} +## Component SecuritySchemes | Class | Description | | ----- | ----------- | - {{#each schemas}} + {{#each securitySchemes}} {{#with this}} -| [{{containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}](docs/components/schemas/{{containerJsonPathPiece.pascalCase}}.md#{{jsonPathPiece.kebabCase}}) |{{#if description}} {{description.originalWithBr}}{{/if}} | +| [{{jsonPathPiece.pascalCase}}](docs/components/securityschemes/{{jsonPathPiece.snakeCase}}.md) |{{#if description}} {{description.originalWithBr}}{{/if}} | {{/with}} {{/each}} {{/if}} {{#if paths}} ## Endpoints - All URIs are relative to the selected server -- The server is selected by passing in serverInfo into configurations.ApiConfiguration -- The security info is selected by passing in securityInfo into configurations.ApiConfiguration -- TODO Code samples in endpoints documents show how to do this +- The server is selected by passing in serverInfo + serverIndexInfo into configurations.ApiConfiguration +- The security info is selected by passing in securityInfo + securityIndexInfo into configurations.ApiConfiguration - serverIndex + securityIndex can also be passed in to endpoint calls, see endpoint documentation -| HTTP request | Method | Description | -| ------------ | ------ | ----------- | +| HTTP request | Methods | Description | +| ------------ | ------- | ----------- | {{#each paths}} {{#each operations}} -| {{../@key.original}} **{{@key.original}}** | [{{jsonPathPiece.pascalCase}}1.{{jsonPathPiece.camelCase}}](docs/paths/{{../@key.kebabCase}}/{{@key.pascalCase}}.md#{{@key.kebabCase}}1) |{{#if summary}} {{summary.originalWithBr}}{{/if}} | +| {{../@key.original}} **{{@key.original}}** | {{#each tags}}[{{className}}.{{../operationId.camelCase}}](docs/apis/tags/{{className}}.md#{{../operationId.kebabCase}}) {{/each}} [{{../jsonPathPiece.pascalCase}}.{{method.camelCase}}](docs/paths/{{../jsonPathPiece.pascalCase}}.md#{{method.kebabCase}}) [{{jsonPathPiece.pascalCase}}.{{method.pascalCase}}.{{method.camelCase}}](docs/{{pathFromDocRoot}}.md#{{method.kebabCase}}) |{{#if summary}} {{summary.originalWithBr}}{{/if}} | {{/each}} {{/each}} {{/if}} +{{#if schemas}} + +## Component Schemas +| Class | Description | +| ----- | ----------- | + {{#each schemas}} + {{#with this}} +| [{{containerJsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}](docs/components/schemas/{{containerJsonPathPiece.pascalCase}}.md#{{jsonPathPiece.kebabCase}}) |{{#if description}} {{description.originalWithBr}}{{/if}} | + {{/with}} + {{/each}} +{{/if}} {{#if requestBodies}} ## Component RequestBodies - | Class | Description | | ----- | ----------- | -{{#each requestBodies}} - {{#with this}} + {{#each requestBodies}} + {{#with this}} | [{{jsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}1](docs/components/requestbodies/{{jsonPathPiece.pascalCase}}.md#{{jsonPathPiece.kebabCase}}1) |{{#if description}} {{description.originalWithBr}}{{/if}} | - {{/with}} -{{/each}} + {{/with}} + {{/each}} {{/if}} {{#if responses}} ## Component Responses - | Class | Description | | ----- | ----------- | -{{#each responses}} - {{#with this}} + {{#each responses}} + {{#with this}} | [{{jsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}1](docs/components/responses/{{jsonPathPiece.pascalCase}}.md#{{jsonPathPiece.kebabCase}}1) |{{#if description}} {{description.originalWithBr}}{{/if}}| - {{/with}} -{{/each}} + {{/with}} + {{/each}} {{/if}} {{#if headers}} ## Component Headers - | Class | Description | | ----- | ----------- | -{{#each headers}} - {{#with this}} + {{#each headers}} + {{#with this}} | [{{jsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}1](docs/components/headers/{{jsonPathPiece.pascalCase}}.md#{{jsonPathPiece.kebabCase}}1) |{{#if description}} {{description.originalWithBr}}{{/if}} | - {{/with}} -{{/each}} + {{/with}} + {{/each}} {{/if}} {{#if parameters}} ## Component Parameters - | Class | Description | | ----- | ----------- | -{{#each parameters}} - {{#with this}} -| [{{jsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}1](docs/components/parameters/{{jsonPathPiece.pascalCase}}.md#{{jsonPathPiece.kebabCase}}1) |{{#if description}} {{description.originalWithBr}}{{/if}} | - {{/with}} -{{/each}} -{{/if}} -{{#if securitySchemes}} - -## Component SecuritySchemes - -| Class | Description | -| ----- | ----------- | - {{#each securitySchemes}} + {{#each parameters}} {{#with this}} -| [{{jsonPathPiece.pascalCase}}](docs/components/securityschemes/{{jsonPathPiece.snakeCase}}.md) |{{#if description}} {{description.originalWithBr}}{{/if}} | +| [{{jsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}1](docs/components/parameters/{{jsonPathPiece.pascalCase}}.md#{{jsonPathPiece.kebabCase}}1) |{{#if description}} {{description.originalWithBr}}{{/if}} | {{/with}} {{/each}} {{/if}} {{#if infoEmail}} ## Author - {{infoEmail}} {{/if}} diff --git a/src/main/resources/java/src/main/java/packagename/apis/paths/Api.hbs b/src/main/resources/java/src/main/java/packagename/apis/paths/Api.hbs index 9d081afb400..810d50ea53f 100644 --- a/src/main/resources/java/src/main/java/packagename/apis/paths/Api.hbs +++ b/src/main/resources/java/src/main/java/packagename/apis/paths/Api.hbs @@ -9,7 +9,7 @@ import {{packageName}}.{{subpackage}}.{{jsonPathPiece.pascalCase}}; public class {{pathItem.jsonPathPiece.pascalCase}} extends ApiClient implements {{#each pathItem.operations}} - {{jsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}Operation{{#unless @last}},{{/unless}} + {{jsonPathPiece.pascalCase}}.{{method.pascalCase}}Operation{{#unless @last}},{{/unless}} {{/each}} { public {{pathItem.jsonPathPiece.pascalCase}}(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { diff --git a/src/main/resources/java/src/main/java/packagename/apis/paths/ApiDoc.hbs b/src/main/resources/java/src/main/java/packagename/apis/paths/ApiDoc.hbs new file mode 100644 index 00000000000..4cbd53eb180 --- /dev/null +++ b/src/main/resources/java/src/main/java/packagename/apis/paths/ApiDoc.hbs @@ -0,0 +1,49 @@ +# {{pathItem.jsonPathPiece.pascalCase}} + +public class {{pathItem.jsonPathPiece.pascalCase}} extends extends ApiClient implements +{{#each pathItem.operations}} +[{{jsonPathPiece.pascalCase}}.{{method.pascalCase}}Operation]({{docRoot}}{{pathFromDocRoot}}.md#{{method.kebabCase}}operation){{#unless @last}},{{/unless}} +{{/each}} + +{{#with pathItem}} +an api client class which contains all the routes for path="{{original}}" + {{#if description}} +{{description.originalWithBr}} + {{/if}} +{{/with}} + +{{headerSize}}# Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +{{#each pathItem.operations}} +| {{#if nonErrorResponses }}{{#with responses}}[{{jsonPathPiece.pascalCase}}.EndpointResponse]({{docRoot}}{{pathFromDocRoot}}.md#endpointresponse){{/with}}{{else}}Void{{/if}} | [{{method.camelCase}}](#{{method.kebabCase}})([{{jsonPathPiece.pascalCase}}.{{method.pascalCase}}Request]({{docRoot}}{{pathFromDocRoot}}.md#{{method.kebabCase}}request) request){{#if description}}
{{description.originalWithBr}}{{/if}} | +{{/each}} + +{{headerSize}}# Method Detail +{{#each pathItem.operations}} + +{{headerSize}}## {{method.camelCase}} +public {{#if nonErrorResponses }}{{#with responses}}[{{jsonPathPiece.pascalCase}}.EndpointResponse]({{docRoot}}{{pathFromDocRoot}}.md#endpointresponse){{/with}}{{else}}Void{{/if}} {{method.camelCase}}([{{jsonPathPiece.pascalCase}}.{{method.pascalCase}}Request]({{docRoot}}{{pathFromDocRoot}}.md#{{method.kebabCase}}request) request) +{{#if description}} + +{{description.originalWithBr}} +{{/if}} + +**Parameters:**
+request - the input request + +**Returns:**
+{{#if nonErrorResponses }}the deserialized response{{else}}nothing (Void){{/if}} + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +{{headerSize}}### Code Sample +{{> src/main/java/packagename/paths/path/verb/_OperationDocCodeSample apiSubpackage="apis.paths" apiContainerClass=pathItem.jsonPathPiece.pascalCase apiFullyQualifiedClass=pathItem.jsonPathPiece.pascalCase }} +{{/each}} + +[[Back to top]](#top) {{> _helper_footer_links readmePath="../../../" endpointLink=true}} diff --git a/src/main/resources/java/src/main/java/packagename/apis/tags/Api.hbs b/src/main/resources/java/src/main/java/packagename/apis/tags/Api.hbs new file mode 100644 index 00000000000..e267977a943 --- /dev/null +++ b/src/main/resources/java/src/main/java/packagename/apis/tags/Api.hbs @@ -0,0 +1,18 @@ +package {{packageName}}.apis.tags; + +import {{packageName}}.apiclient.ApiClient; +import {{packageName}}.configurations.ApiConfiguration; +import {{packageName}}.configurations.SchemaConfiguration; +{{#each operations}} +import {{packageName}}.{{subpackage}}.{{jsonPathPiece.pascalCase}}; +{{/each}} + +public class {{tag.className}} extends ApiClient implements +{{#each operations}} + {{jsonPathPiece.pascalCase}}.{{operationId.pascalCase}}Operation{{#unless @last}},{{/unless}} +{{/each}} +{ + public {{tag.className}}(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + super(apiConfiguration, schemaConfiguration); + } +} \ No newline at end of file diff --git a/src/main/resources/java/src/main/java/packagename/apis/tags/ApiDoc.hbs b/src/main/resources/java/src/main/java/packagename/apis/tags/ApiDoc.hbs new file mode 100644 index 00000000000..1bf4c7ef3c7 --- /dev/null +++ b/src/main/resources/java/src/main/java/packagename/apis/tags/ApiDoc.hbs @@ -0,0 +1,49 @@ +# {{tag.className}} + +public class {{tag.className}} extends extends ApiClient implements +{{#each operations}} +[{{jsonPathPiece.pascalCase}}.{{operationId.pascalCase}}Operation]({{docRoot}}{{pathFromDocRoot}}.md#{{operationId.kebabCase}}operation){{#unless @last}},{{/unless}} +{{/each}} + +{{#with tag}} +an api client class which contains all the routes for tag="{{name}}" + {{#if description}} +{{description.originalWithBr}} + {{/if}} +{{/with}} + +{{headerSize}}# Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +{{#each operations}} +| {{#if nonErrorResponses }}{{#with responses}}[{{jsonPathPiece.pascalCase}}.EndpointResponse]({{docRoot}}{{pathFromDocRoot}}.md#endpointresponse){{/with}}{{else}}Void{{/if}} | [{{operationId.camelCase}}](#{{operationId.kebabCase}})([{{jsonPathPiece.pascalCase}}.{{method.pascalCase}}Request]({{docRoot}}{{pathFromDocRoot}}.md#{{method.kebabCase}}request) request){{#if description}}
{{description.originalWithBr}}{{/if}} | +{{/each}} + +{{headerSize}}# Method Detail +{{#each operations}} + +{{headerSize}}## {{operationId.camelCase}} +public {{#if nonErrorResponses }}{{#with responses}}[{{jsonPathPiece.pascalCase}}.EndpointResponse]({{docRoot}}{{pathFromDocRoot}}.md#endpointresponse){{/with}}{{else}}Void{{/if}} {{operationId.camelCase}}([{{jsonPathPiece.pascalCase}}.{{method.pascalCase}}Request]({{docRoot}}{{pathFromDocRoot}}.md#{{method.kebabCase}}request) request) +{{#if description}} + +{{description.originalWithBr}} +{{/if}} + +**Parameters:**
+request - the input request + +**Returns:**
+{{#if nonErrorResponses }}the deserialized response{{else}}nothing (Void){{/if}} + +**Throws:**
+IOException, InterruptedException - an exception happened when making the request
+ValidationException - the returned response body or header values do not conform the the schema validation requirements
+NotImplementedException - the request body serialization or deserialization has not yet been implemented
+ or the header content type deserialization has not yet been implemented for this contentType
+ApiException - server returned a response/contentType not defined in the openapi document
+ +{{headerSize}}### Code Sample +{{> src/main/java/packagename/paths/path/verb/_OperationDocCodeSample apiSubpackage="apis.tags" apiContainerClass=tag.className apiFullyQualifiedClass=tag.className }} +{{/each}} + +[[Back to top]](#top) {{> _helper_footer_links readmePath="../../../" endpointLink=true}} diff --git a/src/main/resources/java/src/main/java/packagename/paths/path/verb/Operation.hbs b/src/main/resources/java/src/main/java/packagename/paths/path/verb/Operation.hbs index b04427102fd..9250c991254 100644 --- a/src/main/resources/java/src/main/java/packagename/paths/path/verb/Operation.hbs +++ b/src/main/resources/java/src/main/java/packagename/paths/path/verb/Operation.hbs @@ -62,11 +62,11 @@ import java.util.List; import java.util.Map; public class {{jsonPathPiece.pascalCase}} { - private static class {{jsonPathPiece.pascalCase}}Provider{{#each builders}}{{#if @first}}{{#each keyToBuilder}}{{#eq @key.camelCase "securityIndex"}} extends AuthApplier{{/eq}}{{/each}}{{/if}}{{/each}} { + private static class {{method.pascalCase}}Provider{{#each builders}}{{#if @first}}{{#each keyToBuilder}}{{#eq @key.camelCase "securityIndex"}} extends AuthApplier{{/eq}}{{/each}}{{/if}}{{/each}} { private static final String method = "{{jsonPathPiece.original}}"; - public static {{#if nonErrorResponses }}{{#with responses}}{{jsonPathPiece.pascalCase}}.EndpointResponse{{/with}}{{else}}Void{{/if}} {{jsonPathPiece.camelCase}}( - {{jsonPathPiece.pascalCase}}Request request, + public static {{#if nonErrorResponses }}{{#with responses}}{{jsonPathPiece.pascalCase}}.EndpointResponse{{/with}}{{else}}Void{{/if}} {{method.camelCase}}( + {{method.pascalCase}}Request request, ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration, HttpClient client @@ -187,28 +187,43 @@ public class {{jsonPathPiece.pascalCase}} { request.timeout ); var response = RestClient.getResponse(httpRequest, client); - var responsesDeserializer = new Responses.Responses1(); + {{#if nonErrorResponses }} + var responsesDeserializer = new {{#with responses}}{{jsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}1{{/with}}(); return responsesDeserializer.deserialize(response, schemaConfiguration); + {{else}} + return (Void) null; + {{/if}} + } + } + + public interface {{method.pascalCase}}Operation { + ApiConfiguration getApiConfiguration(); + SchemaConfiguration getSchemaConfiguration(); + HttpClient getClient(); + default {{#if nonErrorResponses }}{{#with responses}}{{jsonPathPiece.pascalCase}}.EndpointResponse{{/with}}{{else}}Void{{/if}} {{jsonPathPiece.camelCase}}({{method.pascalCase}}Request request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return {{method.pascalCase}}Provider.{{method.camelCase}}(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); } } + {{#neq method.pascalCase operationId.pascalCase}} - public interface {{jsonPathPiece.pascalCase}}Operation { + public interface {{operationId.pascalCase}}Operation { ApiConfiguration getApiConfiguration(); SchemaConfiguration getSchemaConfiguration(); HttpClient getClient(); - default {{#if nonErrorResponses }}{{#with responses}}{{jsonPathPiece.pascalCase}}.EndpointResponse{{/with}}{{else}}Void{{/if}} {{jsonPathPiece.camelCase}}({{jsonPathPiece.pascalCase}}Request request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { - return {{jsonPathPiece.pascalCase}}Provider.{{jsonPathPiece.camelCase}}(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); + default {{#if nonErrorResponses }}{{#with responses}}{{jsonPathPiece.pascalCase}}.EndpointResponse{{/with}}{{else}}Void{{/if}} {{operationId.camelCase}}({{method.pascalCase}}Request request) throws IOException, InterruptedException, ValidationException, NotImplementedException, ApiException { + return {{method.pascalCase}}Provider.{{jsonPathPiece.camelCase}}(request, getApiConfiguration(), getSchemaConfiguration(), getClient()); } } + {{/neq}} - public static class {{jsonPathPiece.pascalCase}}1 extends ApiClient implements {{jsonPathPiece.pascalCase}}Operation { - public {{jsonPathPiece.pascalCase}}1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { + public static class {{method.pascalCase}} extends ApiClient implements {{method.pascalCase}}Operation { + public {{method.pascalCase}}(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration) { super(apiConfiguration, schemaConfiguration); } } {{#eq builders.size 1}} - public static class {{jsonPathPiece.pascalCase}}Request { + public static class {{method.pascalCase}}Request { {{#each builders}} {{#each keyToBuilder}} {{#with property}} @@ -227,7 +242,7 @@ public class {{jsonPathPiece.pascalCase}} { } {{else}} - public static class {{jsonPathPiece.pascalCase}}Request { + public static class {{method.pascalCase}}Request { {{#each (reverse builders)}} {{#or @first @last}} {{#each keyToBuilder}} @@ -246,7 +261,7 @@ public class {{jsonPathPiece.pascalCase}} { {{/or}} {{/each}} - public {{jsonPathPiece.pascalCase}}Request( + public {{method.pascalCase}}Request( {{#each (reverse builders)}} {{#or @first @last}} {{#each keyToBuilder}} @@ -275,7 +290,7 @@ public class {{jsonPathPiece.pascalCase}} { } } - public static class {{jsonPathPiece.pascalCase}}NullableRequest { + public static class {{method.pascalCase}}NullableRequest { {{#each (reverse builders)}} {{#or @first @last}} {{#each keyToBuilder}} @@ -300,8 +315,8 @@ public class {{jsonPathPiece.pascalCase}} { {{#each keyToBuilder}} public interface SetterFor{{@key.pascalCase}} { - {{../../jsonPathPiece.pascalCase}}{{#gt ../../builders.size 1}}Nullable{{/gt}}Request getInstance(); - T getBuilderAfter{{@key.pascalCase}}({{../../jsonPathPiece.pascalCase}}{{#gt ../../builders.size 1}}Nullable{{/gt}}Request instance); + {{../../method.pascalCase}}{{#gt ../../builders.size 1}}Nullable{{/gt}}Request getInstance(); + T getBuilderAfter{{@key.pascalCase}}({{../../method.pascalCase}}{{#gt ../../builders.size 1}}Nullable{{/gt}}Request instance); default T {{@key.camelCase}}({{#with property}}{{#if containerJsonPathPiece}}{{containerJsonPathPiece.pascalCase}}.{{else}}{{#if this.jsonPathPiece}}{{jsonPathPiece.pascalCase}}.{{/if}}{{/if}}{{operationInputClassName.pascalCase}}{{/with}} {{@key.camelCase}}) { var instance = getInstance(); instance.{{@key.camelCase}} = {{@key.camelCase}}; @@ -314,20 +329,20 @@ public class {{jsonPathPiece.pascalCase}} { {{#each builders}} public static class {{className.pascalCase}}{{#if keyToBuilder}} implements {{/if}}{{#each keyToBuilder}}SetterFor{{@key.pascalCase}}<{{builder.className.pascalCase}}>{{#unless @last}}, {{/unless}}{{/each}} { - private final {{../jsonPathPiece.pascalCase}}{{#gt ../builders.size 1}}Nullable{{/gt}}Request instance; + private final {{../method.pascalCase}}{{#gt ../builders.size 1}}Nullable{{/gt}}Request instance; {{#if @last }} public {{className.pascalCase}}() { - this.instance = new {{../jsonPathPiece.pascalCase}}{{#gt ../builders.size 1}}Nullable{{/gt}}Request(); + this.instance = new {{../method.pascalCase}}{{#gt ../builders.size 1}}Nullable{{/gt}}Request(); } {{else}} - public {{className.pascalCase}}({{../jsonPathPiece.pascalCase}}{{#gt ../builders.size 1}}Nullable{{/gt}}Request instance) { + public {{className.pascalCase}}({{../method.pascalCase}}{{#gt ../builders.size 1}}Nullable{{/gt}}Request instance) { this.instance = instance; } {{/if}} {{#if @first}} - public {{../jsonPathPiece.pascalCase}}Request build() { + public {{../method.pascalCase}}Request build() { {{#gt ../builders.size 1}} {{#each builders}} {{#if @last}} @@ -339,7 +354,7 @@ public class {{jsonPathPiece.pascalCase}} { {{/each}} {{/if}} {{/each}} - return new {{../jsonPathPiece.pascalCase}}Request( + return new {{../method.pascalCase}}Request( {{#each (reverse builders)}} {{#or @first @last}} {{#each keyToBuilder}} @@ -355,13 +370,13 @@ public class {{jsonPathPiece.pascalCase}} { {{/if}} {{#if keyToBuilder}} - public {{../jsonPathPiece.pascalCase}}{{#gt ../builders.size 1}}Nullable{{/gt}}Request getInstance() { + public {{../method.pascalCase}}{{#gt ../builders.size 1}}Nullable{{/gt}}Request getInstance() { return instance; } {{/if}} {{#each keyToBuilder}} - public {{builder.className.pascalCase}} getBuilderAfter{{@key.pascalCase}}({{../jsonPathPiece.pascalCase}}{{#gt ../builders.size 1}}Nullable{{/gt}}Request instance) { + public {{builder.className.pascalCase}} getBuilderAfter{{@key.pascalCase}}({{../method.pascalCase}}{{#gt ../builders.size 1}}Nullable{{/gt}}Request instance) { {{#eq builder ../this}} {{! property in final builder }} return this; diff --git a/src/main/resources/java/src/main/java/packagename/paths/path/verb/OperationDoc.hbs b/src/main/resources/java/src/main/java/packagename/paths/path/verb/OperationDoc.hbs index edec9e83199..1d2db077a31 100644 --- a/src/main/resources/java/src/main/java/packagename/paths/path/verb/OperationDoc.hbs +++ b/src/main/resources/java/src/main/java/packagename/paths/path/verb/OperationDoc.hbs @@ -1,12 +1,5 @@ {{#with operation}} -{{#eq identifierPieces.size 0}} -{{> src/main/java/packagename/components/_helper_header_from_identifier_pieces identifierPieces=(append identifierPieces jsonPathPiece) }} -{{else}} -{{> src/main/java/packagename/components/_helper_header_from_identifier_pieces }} -{{/eq}} -{{#if componentModule}} -{{jsonPathPiece.pascalCase}}.java -{{/if}} +{{headerSize}} {{jsonPathPiece.pascalCase}} public class {{jsonPathPiece.pascalCase}} @@ -19,42 +12,57 @@ A class that contains necessary endpoint classes {{headerSize}}# Nested Class Summary | Modifier and Type | Class and Description | | ----------------- | --------------------- | -| static class | [{{jsonPathPiece.pascalCase}}1](#{{jsonPathPiece.kebabCase}}1)
The class that has a {{jsonPathPiece.camelCase}} method to call the endpoint | +| static class | [{{method.pascalCase}}](#{{method.kebabCase}})
The class that has a {{method.camelCase}} method to call the endpoint | +{{#neq method.pascalCase operationId.pascalCase}} +| interface | [{{operationId.pascalCase}}Operation](#{{operationId.kebabCase}}operation)
The interface that has a {{operationId.camelCase}} method to call the endpoint | +{{/neq}} {{#eq builders.size 1}} -| static class | [{{jsonPathPiece.pascalCase}}Request](#{{jsonPathPiece.kebabCase}}request)
The request inputs class | +| static class | [{{method.pascalCase}}Request](#{{method.kebabCase}}request)
The request inputs class | {{else}} -| static class | [{{jsonPathPiece.pascalCase}}Request](#{{jsonPathPiece.kebabCase}}request)
The final request inputs class | -| static class | [{{jsonPathPiece.pascalCase}}NullableRequest](#{{jsonPathPiece.kebabCase}}nullablerequest)
The initial request inputs class | +| static class | [{{method.pascalCase}}Request](#{{method.kebabCase}}request)
The final request inputs class | +| static class | [{{method.pascalCase}}NullableRequest](#{{method.kebabCase}}nullablerequest)
The initial request inputs class | {{/eq}} {{#each builders}} | static class | [{{className.pascalCase}}](#{{className.kebabCase}})
A builder for the request input class | {{/each}} -{{> src/main/java/packagename/components/_helper_header_from_identifier_pieces headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces (join jsonPathPiece.pascalCase "1" "")) }} -public static class {{jsonPathPiece.pascalCase}}1 extends ApiClient.ApiClient1 implements {{jsonPathPiece.pascalCase}}Operation
+{{headerSize}}# {{method.pascalCase}} +public static class {{method.pascalCase}} extends ApiClient.ApiClient1 implements {{method.pascalCase}}Operation
-a class that allows one to call the endpoint using a method named {{jsonPathPiece.camelCase}} +a class that allows one to call the endpoint using a method named {{method.camelCase}} {{headerSize}}## Code Sample -{{> src/main/java/packagename/paths/path/verb/_OperationDocCodeSample }} +{{> src/main/java/packagename/paths/path/verb/_OperationDocCodeSample apiSubpackage=subpackage apiContainerClass=jsonPathPiece.pascalCase apiFullyQualifiedClass=(join jsonPathPiece.pascalCase method.pascalCase ".") }} {{headerSize}}## Constructor Summary | Constructor and Description | | --------------------------- | -| {{jsonPathPiece.pascalCase}}1(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | +| {{method.pascalCase}}(ApiConfiguration apiConfiguration, SchemaConfiguration schemaConfiguration)
Creates an instance | {{headerSize}}## Method Summary | Modifier and Type | Method and Description | | ----------------- | ---------------------- | -| {{#if nonErrorResponses }}{{#with responses}}[{{jsonPathPiece.pascalCase}}.EndpointResponse]({{docRoot}}{{pathFromDocRoot}}.md#endpointresponse){{/with}}{{else}}Void{{/if}} | {{jsonPathPiece.camelCase}}([{{jsonPathPiece.pascalCase}}Request](#{{jsonPathPiece.kebabCase}}request) request) | +| {{#if nonErrorResponses }}{{#with responses}}[{{jsonPathPiece.pascalCase}}.EndpointResponse]({{docRoot}}{{pathFromDocRoot}}.md#endpointresponse){{/with}}{{else}}Void{{/if}} | {{method.camelCase}}([{{method.pascalCase}}Request](#{{method.kebabCase}}request) request) | +{{#neq method.pascalCase operationId.pascalCase}} + +{{headerSize}}# {{operationId.pascalCase}}Operation +public interface {{operationId.pascalCase}}Operation
+ +an interface that allows one to call the endpoint using a method named {{operationId.camelCase}} by the operationId + +{{headerSize}}## Method Summary +| Modifier and Type | Method and Description | +| ----------------- | ---------------------- | +| {{#if nonErrorResponses }}{{#with responses}}[{{jsonPathPiece.pascalCase}}.EndpointResponse]({{docRoot}}{{pathFromDocRoot}}.md#endpointresponse){{/with}}{{else}}Void{{/if}} | {{operationId.camelCase}}([{{method.pascalCase}}Request](#{{method.kebabCase}}request) request) | +{{/neq}} {{#eq builders.size 1}} {{> src/main/java/packagename/paths/path/verb/_FinalRequestClassDoc }} {{else}} {{> src/main/java/packagename/paths/path/verb/_FinalRequestClassDoc }} -{{> src/main/java/packagename/components/_helper_header_from_identifier_pieces headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces (join jsonPathPiece.pascalCase "NullableRequest" "")) }} -public static class {{jsonPathPiece.pascalCase}}NullableRequest
+{{headerSize}}# {{method.pascalCase}}NullableRequest +public static class {{method.pascalCase}}NullableRequest
a class that stores the initial request inputs @@ -81,7 +89,7 @@ a class that stores the initial request inputs {{/eq}} {{#each builders}} -{{> src/main/java/packagename/components/_helper_header_from_identifier_pieces headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces className.pascalCase) }} +{{headerSize}}# {{className.pascalCase}} public static class {{className.pascalCase}}
a builder for request inputs @@ -99,7 +107,7 @@ a builder for request inputs | Modifier and Type | Method and Description | | ----------------- | ---------------------- | {{#if @first}} -| [{{jsonPathPiece.pascalCase}}Request](#{{jsonPathPiece.kebabCase}}request) | build()
Returns the request input used to call an endpoint method | +| [{{method.pascalCase}}Request](#{{method.kebabCase}}request) | build()
Returns the request input used to call an endpoint method | {{/if}} {{#each keyToBuilder}} | [{{builder.className.pascalCase}}](#{{builder.className.kebabCase}}) | {{@key.camelCase}}({{#with property}}{{#if containerJsonPathPiece}}[{{containerJsonPathPiece.pascalCase}}{{else}}{{#if this.jsonPathPiece}}[{{jsonPathPiece.pascalCase}}.{{/if}}{{/if}}{{operationInputClassName.pascalCase}}{{#or containerJsonPathPiece this.jsonPathPiece}}]({{docRoot}}{{pathFromDocRoot}}.md#{{operationInputClassName.kebabCase}}){{/or}}{{/with}} {{@key.camelCase}})
sets the {{#if ../@first}}optional {{/if}}property{{#or (eq @key.camelCase "securityIndex") (eq @key.camelCase "serverIndex") (eq @key.camelCase "timeout")}}. Note: this will override the value in apiConfiguration{{/or}} | diff --git a/src/main/resources/java/src/main/java/packagename/paths/path/verb/_FinalRequestClassDoc.hbs b/src/main/resources/java/src/main/java/packagename/paths/path/verb/_FinalRequestClassDoc.hbs index 8815dea554b..e53398ccf3e 100644 --- a/src/main/resources/java/src/main/java/packagename/paths/path/verb/_FinalRequestClassDoc.hbs +++ b/src/main/resources/java/src/main/java/packagename/paths/path/verb/_FinalRequestClassDoc.hbs @@ -1,5 +1,5 @@ -{{> src/main/java/packagename/components/_helper_header_from_identifier_pieces headerSize=(join headerSize "#" "") identifierPieces=(append identifierPieces (join jsonPathPiece.pascalCase "Request" "")) }} -public static class {{jsonPathPiece.pascalCase}}Request
+{{headerSize}}# {{method.pascalCase}}Request +public static class {{method.pascalCase}}Request
a class that stores the final request inputs diff --git a/src/main/resources/java/src/main/java/packagename/paths/path/verb/_OperationDocCodeSample.hbs b/src/main/resources/java/src/main/java/packagename/paths/path/verb/_OperationDocCodeSample.hbs index 8762d450860..02cf79ee2dc 100644 --- a/src/main/resources/java/src/main/java/packagename/paths/path/verb/_OperationDocCodeSample.hbs +++ b/src/main/resources/java/src/main/java/packagename/paths/path/verb/_OperationDocCodeSample.hbs @@ -1,5 +1,4 @@ ``` -{{#with operation}} import {{packageName}}.configurations.ApiConfiguration; import {{packageName}}.configurations.SchemaConfiguration; import {{packageName}}.configurations.JsonSchemaKeywordFlags; @@ -82,7 +81,7 @@ import {{{packageName}}}.{{subpackage}}.{{containerJsonPathPiece.pascalCase}}; {{#with servers}} import {{packageName}}.{{#if subpackage}}{{subpackage}}{{else}}servers{{/if}}.{{jsonPathPiece.pascalCase}}; {{/with}} -import {{packageName}}.{{subpackage}}.{{jsonPathPiece.pascalCase}}; +import {{packageName}}.{{apiSubpackage}}.{{apiContainerClass}}; {{#with responses}} import {{packageName}}.{{subpackage}}.{{jsonPathPiece.pascalCase}}; {{/with}} @@ -161,7 +160,7 @@ ApiConfiguration apiConfiguration = new ApiConfiguration( timeout ); SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchemaKeywordFlags.Builder().build()); -{{jsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}1 apiClient = new {{jsonPathPiece.pascalCase}}.{{jsonPathPiece.pascalCase}}1(apiConfiguration, schemaConfiguration); +{{apiFullyQualifiedClass}} apiClient = new {{apiFullyQualifiedClass}}(apiConfiguration, schemaConfiguration); {{#gt builders.size 1}} {{#each builders}} @@ -198,12 +197,12 @@ SchemaConfiguration schemaConfiguration = new SchemaConfiguration(new JsonSchema {{#eq builders.size 1}} {{! only option props}} {{#each builders}} -var request = new {{className.pascalCase}}().build(); +var request = new {{../jsonPathPiece.pascalCase}}.{{className.pascalCase}}().build(); {{/each}} {{else}} {{#each builders}} {{#if @last}} -var request = new {{className.pascalCase}}() +var request = new {{../jsonPathPiece.pascalCase}}.{{className.pascalCase}}() {{#each keyToBuilder}} .{{@key.camelCase}}({{@key.camelCase}}) {{#if @last}} @@ -263,5 +262,4 @@ if (response instanceof {{responses.jsonPathPiece.pascalCase}}.Endpoint{{jsonPat } {{/eq}} {{/if}} -{{/with}} ``` \ No newline at end of file